Documentation ¶
Index ¶
- type AuthenticateMethod
- type CallbackMethod
- type Identifier
- func (m *Identifier) Authenticate(ctx context.Context, request *web.Request) web.Result
- func (m *Identifier) Broker() string
- func (m *Identifier) Callback(ctx context.Context, request *web.Request, ...) web.Result
- func (m *Identifier) Identify(ctx context.Context, r *web.Request) (auth.Identity, error)
- func (m *Identifier) Logout(ctx context.Context, request *web.Request)
- func (m *Identifier) SetAuthenticateMethod(method AuthenticateMethod) *Identifier
- func (m *Identifier) SetBroker(broker string)
- func (m *Identifier) SetCallbackMethod(method CallbackMethod) *Identifier
- func (m *Identifier) SetIdentifyMethod(method IdentifyMethod) *Identifier
- func (m *Identifier) SetLogoutMethod(method LogoutMethod) *Identifier
- type IdentifyMethod
- type Identity
- type LogoutMethod
- type OIDCIdentity
- func (i *OIDCIdentity) AccessTokenClaims(into interface{}) error
- func (i *OIDCIdentity) IDToken() *oidc.IDToken
- func (i *OIDCIdentity) IDTokenClaims(into interface{}) error
- func (i *OIDCIdentity) SetAccessTokenClaims(claims interface{}) (err error)
- func (i *OIDCIdentity) SetIDTokenClaims(claims interface{}) (err error)
- func (i *OIDCIdentity) SetTokenSource(source oauth2.TokenSource)
- func (i *OIDCIdentity) TokenSource() oauth2.TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticateMethod ¶
AuthenticateMethod callback for Mock Identifier
type CallbackMethod ¶
type CallbackMethod func(*Identifier, context.Context, *web.Request, func(*web.Request) *url.URL) web.Result
CallbackMethod callback for Mock Identifier
type Identifier ¶
type Identifier struct {
// contains filtered or unexported fields
}
Identifier mocks request identification
func SingleIdentityIdentifier ¶
func SingleIdentityIdentifier(broker string, identity auth.Identity) *Identifier
SingleIdentityIdentifier returns a mocked broker with a given identity
func (*Identifier) Authenticate ¶
Authenticate an incoming request
func (*Identifier) Callback ¶
func (m *Identifier) Callback(ctx context.Context, request *web.Request, returnTo func(*web.Request) *url.URL) web.Result
Callback an incoming request
func (*Identifier) Logout ¶
func (m *Identifier) Logout(ctx context.Context, request *web.Request)
Logout an incoming request
func (*Identifier) SetAuthenticateMethod ¶
func (m *Identifier) SetAuthenticateMethod(method AuthenticateMethod) *Identifier
SetAuthenticateMethod for mock identifier
func (*Identifier) SetBroker ¶
func (m *Identifier) SetBroker(broker string)
SetBroker identity for the identifier
func (*Identifier) SetCallbackMethod ¶
func (m *Identifier) SetCallbackMethod(method CallbackMethod) *Identifier
SetCallbackMethod for mock identifier
func (*Identifier) SetIdentifyMethod ¶
func (m *Identifier) SetIdentifyMethod(method IdentifyMethod) *Identifier
SetIdentifyMethod for mock identifier
func (*Identifier) SetLogoutMethod ¶
func (m *Identifier) SetLogoutMethod(method LogoutMethod) *Identifier
SetLogoutMethod for mock identifier
type IdentifyMethod ¶
IdentifyMethod callback for Mock Identifier
func SingleIdentityIdentifyMethod ¶
func SingleIdentityIdentifyMethod(identity auth.Identity) IdentifyMethod
SingleIdentityIdentifyMethod returns an IdentifyMethod which will always return the specified identity
type Identity ¶
type Identity struct { Sub string // contains filtered or unexported fields }
Identity mocks auth.Identity
type LogoutMethod ¶
type LogoutMethod func(*Identifier, context.Context, *web.Request)
LogoutMethod callback for Mock Identifier
type OIDCIdentity ¶
type OIDCIdentity struct { Identity // contains filtered or unexported fields }
OIDCIdentity mocks oauth.OpenIDIdentity
func (*OIDCIdentity) AccessTokenClaims ¶
func (i *OIDCIdentity) AccessTokenClaims(into interface{}) error
AccessTokenClaims unmarshals the given claims
func (*OIDCIdentity) IDTokenClaims ¶
func (i *OIDCIdentity) IDTokenClaims(into interface{}) error
IDTokenClaims unmarshals the given claims
func (*OIDCIdentity) SetAccessTokenClaims ¶
func (i *OIDCIdentity) SetAccessTokenClaims(claims interface{}) (err error)
SetAccessTokenClaims marshals the given claims
func (*OIDCIdentity) SetIDTokenClaims ¶
func (i *OIDCIdentity) SetIDTokenClaims(claims interface{}) (err error)
SetIDTokenClaims marshals the given claims
func (*OIDCIdentity) SetTokenSource ¶
func (i *OIDCIdentity) SetTokenSource(source oauth2.TokenSource)
SetTokenSource to specify a test/mock token source
func (*OIDCIdentity) TokenSource ¶
func (i *OIDCIdentity) TokenSource() oauth2.TokenSource
TokenSource getter