Documentation ¶
Index ¶
- type ExampleStorage
- func (s *ExampleStorage) Close() error
- func (s *ExampleStorage) DeleteAuthorizeData(ctx context.Context, code string) error
- func (s *ExampleStorage) DeleteRefreshTokenData(ctx context.Context, token string) error
- func (s *ExampleStorage) GetAuthorizeData(_ context.Context, code string) (*niso.AuthorizationData, error)
- func (s *ExampleStorage) GetClientData(_ context.Context, id string) (*niso.ClientData, error)
- func (s *ExampleStorage) GetRefreshTokenData(ctx context.Context, token string) (*niso.RefreshTokenData, error)
- func (s *ExampleStorage) SaveAccessData(ctx context.Context, data *niso.AccessData) error
- func (s *ExampleStorage) SaveAuthorizeData(_ context.Context, data *niso.AuthorizationData) error
- func (s *ExampleStorage) SaveRefreshTokenData(ctx context.Context, data *niso.RefreshTokenData) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExampleStorage ¶
type ExampleStorage struct {
// contains filtered or unexported fields
}
ExampleStorage is a backend used to persist data generated by the example OAuth2 server
func NewExampleStorage ¶
func NewExampleStorage() *ExampleStorage
NewExampleStorage returns a new ExampleStorage
func (*ExampleStorage) Close ¶
func (s *ExampleStorage) Close() error
Close the resources the Storage potentially holds. (Implements io.Closer)
func (*ExampleStorage) DeleteAuthorizeData ¶
func (s *ExampleStorage) DeleteAuthorizeData(ctx context.Context, code string) error
DeleteAuthorizeData revokes or deletes the authorization code.
func (*ExampleStorage) DeleteRefreshTokenData ¶
func (s *ExampleStorage) DeleteRefreshTokenData(ctx context.Context, token string) error
DeleteRefreshTokenData revokes or deletes a RefreshToken.
func (*ExampleStorage) GetAuthorizeData ¶
func (s *ExampleStorage) GetAuthorizeData(_ context.Context, code string) (*niso.AuthorizationData, error)
GetAuthorizeData looks up AuthorizeData by a code. // ClientData information MUST be loaded together. Optionally can return error if expired.
func (*ExampleStorage) GetClientData ¶
func (s *ExampleStorage) GetClientData(_ context.Context, id string) (*niso.ClientData, error)
GetClientData fetches the data for a ClientData by id Should return NotFoundError, so an EInvalidClient error will be returned instead of EServerError
func (*ExampleStorage) GetRefreshTokenData ¶
func (s *ExampleStorage) GetRefreshTokenData(ctx context.Context, token string) (*niso.RefreshTokenData, error)
GetRefreshTokenData retrieves refresh token data from the token string.
func (*ExampleStorage) SaveAccessData ¶
func (s *ExampleStorage) SaveAccessData(ctx context.Context, data *niso.AccessData) error
SaveAccessData writes AccessData to storage.
func (*ExampleStorage) SaveAuthorizeData ¶
func (s *ExampleStorage) SaveAuthorizeData(_ context.Context, data *niso.AuthorizationData) error
SaveAuthorizeData saves authorize data.
func (*ExampleStorage) SaveRefreshTokenData ¶
func (s *ExampleStorage) SaveRefreshTokenData(ctx context.Context, data *niso.RefreshTokenData) error
SaveRefreshTokenData saves refresh token data so it can be retrieved with GetRefreshTokenData