Documentation ¶
Overview ¶
Package examples provides ...
Package examples provides ...
Package examples provides ...
Index ¶
- Variables
- type TestClient
- func (c *TestClient) ClientID() string
- func (c *TestClient) ClientSecret() string
- func (c *TestClient) ClientType() protocol.ClientType
- func (c *TestClient) DeviceAuthPath() string
- func (c *TestClient) ExpirationOptions() protocol.Expirations
- func (c *TestClient) GrantTypes() []protocol.GrantType
- func (c *TestClient) IsScopeAllowed(scope string) bool
- func (c *TestClient) JWTSigningMethod() jwt.SigningMethod
- func (c *TestClient) PrivateKey() (crypto.Signer, error)
- func (c *TestClient) RedirectURI() string
- func (c *TestClient) ResponseTypes() []protocol.ResponseType
- type TestSession
- type TestStorage
- func (s *TestStorage) Client(clientID string) (protocol.Client, error)
- func (s *TestStorage) LoadAccess(token string) (data *protocol.AccessData, err error)
- func (s *TestStorage) LoadAuthorize(code string) (data *protocol.AuthorizeData, err error)
- func (s *TestStorage) LoadRefresh(refresh string) (data *protocol.AccessData, err error)
- func (s *TestStorage) RemoveAccess(token string) error
- func (s *TestStorage) RemoveAuthorize(code string) error
- func (s *TestStorage) RemoveRefresh(refresh string) error
- func (s *TestStorage) SaveAccess(token string, data *protocol.AccessData, exp int) error
- func (s *TestStorage) SaveAuthorize(code string, data *protocol.AuthorizeData, exp int) error
- func (s *TestStorage) SaveRefresh(refresh, token string, exp int) (err error)
- func (s *TestStorage) UserDataScopes(uid string, scopes []protocol.Scope) (*protocol.UserInfo, error)
Constants ¶
This section is empty.
Variables ¶
var Signer crypto.Signer
Signer for crypto
Functions ¶
This section is empty.
Types ¶
type TestClient ¶
type TestClient struct { ID string Secret string Redirect string Type protocol.ClientType }
TestClient oidc
func (*TestClient) ClientSecret ¶
func (c *TestClient) ClientSecret() string
ClientSecret return client secret
func (*TestClient) ClientType ¶
func (c *TestClient) ClientType() protocol.ClientType
ClientType return client type
func (*TestClient) DeviceAuthPath ¶
func (c *TestClient) DeviceAuthPath() string
DeviceAuthPath device authorize path
func (*TestClient) ExpirationOptions ¶
func (c *TestClient) ExpirationOptions() protocol.Expirations
ExpirationOptions client expirations, seconds
func (*TestClient) GrantTypes ¶
func (c *TestClient) GrantTypes() []protocol.GrantType
GrantTypes grant types
func (*TestClient) IsScopeAllowed ¶
func (c *TestClient) IsScopeAllowed(scope string) bool
IsScopeAllowed allowed scopes
func (*TestClient) JWTSigningMethod ¶
func (c *TestClient) JWTSigningMethod() jwt.SigningMethod
JWTSigningMethod sign with idtoken
func (*TestClient) PrivateKey ¶
func (c *TestClient) PrivateKey() (crypto.Signer, error)
PrivateKey loads the client private key
func (*TestClient) RedirectURI ¶
func (c *TestClient) RedirectURI() string
RedirectURI return client redirect uri, multiple URLs by comma-separating
func (*TestClient) ResponseTypes ¶
func (c *TestClient) ResponseTypes() []protocol.ResponseType
ResponseTypes allowed authorize type
type TestSession ¶
type TestSession struct{}
TestSession test
func (*TestSession) AllowedOrigin ¶
func (s *TestSession) AllowedOrigin() string
AllowedOrigin is that postMessage from op host
func (*TestSession) SessionExpiresIn ¶
func (s *TestSession) SessionExpiresIn(cookie string) int
SessionExpiresIn user session expires with cookie
type TestStorage ¶
type TestStorage struct {
// contains filtered or unexported fields
}
TestStorage storage
func (*TestStorage) Client ¶
func (s *TestStorage) Client(clientID string) (protocol.Client, error)
Client loads the client by id (client_id)
func (*TestStorage) LoadAccess ¶
func (s *TestStorage) LoadAccess(token string) (data *protocol.AccessData, err 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 (*TestStorage) LoadAuthorize ¶
func (s *TestStorage) LoadAuthorize(code string) (data *protocol.AuthorizeData, err error)
LoadAuthorize looks up AuthorizeData by a code. Client information MUST be loaded together. Optionally can return error if expired.
func (*TestStorage) LoadRefresh ¶
func (s *TestStorage) LoadRefresh(refresh string) (data *protocol.AccessData, err 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 (*TestStorage) RemoveAccess ¶
func (s *TestStorage) RemoveAccess(token string) error
RemoveAccess revokes or deletes an AccessData.
func (*TestStorage) RemoveAuthorize ¶
func (s *TestStorage) RemoveAuthorize(code string) error
RemoveAuthorize revokes or deletes the authorization code.
func (*TestStorage) RemoveRefresh ¶
func (s *TestStorage) RemoveRefresh(refresh string) error
RemoveRefresh revokes or deletes refresh AccessData.
func (*TestStorage) SaveAccess ¶
func (s *TestStorage) SaveAccess(token string, data *protocol.AccessData, exp int) error
SaveAccess writes AccessData. If RefreshToken is not blank, it must save in a way that can be loaded using LoadRefresh.
func (*TestStorage) SaveAuthorize ¶
func (s *TestStorage) SaveAuthorize(code string, data *protocol.AuthorizeData, exp int) error
SaveAuthorize saves authorize data.
func (*TestStorage) SaveRefresh ¶
func (s *TestStorage) SaveRefresh(refresh, token string, exp int) (err error)
SaveRefresh save refresh token
func (*TestStorage) UserDataScopes ¶
func (s *TestStorage) UserDataScopes(uid string, scopes []protocol.Scope) (*protocol.UserInfo, error)
UserDataScopes get user info from scopes