teststorage

package
v3.6.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Test

type Test struct {
	Clients       map[string]osin.Client
	AuthorizeData *osin.AuthorizeData
	Authorize     map[string]*osin.AuthorizeData
	AccessData    *osin.AccessData
	Access        map[string]*osin.AccessData
	Err           error
}

func New

func New() *Test

func (*Test) Clone

func (t *Test) Clone() osin.Storage

func (*Test) Close

func (t *Test) Close()

func (*Test) GetClient

func (t *Test) GetClient(id string) (osin.Client, error)

GetClient loads the client by id (client_id)

func (*Test) LoadAccess

func (t *Test) LoadAccess(token string) (*osin.AccessData, error)

LoadAccess retrieves access data by token. Client information MUST be loaded together. AuthorizeData and AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.

func (*Test) LoadAuthorize

func (t *Test) LoadAuthorize(code string) (*osin.AuthorizeData, error)

LoadAuthorize looks up AuthorizeData by a code. Client information MUST be loaded together. Optionally can return error if expired.

func (*Test) LoadRefresh

func (t *Test) LoadRefresh(token string) (*osin.AccessData, error)

LoadRefresh retrieves refresh AccessData. Client information MUST be loaded together. AuthorizeData and AccessData DON'T NEED to be loaded if not easily available. Optionally can return error if expired.

func (*Test) RemoveAccess

func (t *Test) RemoveAccess(token string) error

RemoveAccess revokes or deletes an AccessData.

func (*Test) RemoveAuthorize

func (t *Test) RemoveAuthorize(code string) error

RemoveAuthorize revokes or deletes the authorization code.

func (*Test) RemoveRefresh

func (t *Test) RemoveRefresh(token string) error

RemoveRefresh revokes or deletes refresh AccessData.

func (*Test) SaveAccess

func (t *Test) SaveAccess(data *osin.AccessData) error

SaveAccess writes AccessData. If RefreshToken is not blank, it must save in a way that can be loaded using LoadRefresh.

func (*Test) SaveAuthorize

func (t *Test) SaveAuthorize(data *osin.AuthorizeData) error

SaveAuthorize saves authorize data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL