Documentation ¶
Overview ¶
Package mock implements connectors which help test various server components.
Index ¶
- func NewCallbackConnector() connector.Connector
- type Callback
- func (m *Callback) HandleCallback(s connector.Scopes, r *http.Request) (connector.Identity, error)
- func (m *Callback) LoginURL(s connector.Scopes, callbackURL, state string) (string, error)
- func (m *Callback) Refresh(ctx context.Context, s connector.Scopes, identity connector.Identity) (connector.Identity, error)
- type CallbackConfig
- type PasswordConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callback ¶
Callback is a connector that requires no user interaction and always returns the same identity.
func (*Callback) HandleCallback ¶
HandleCallback parses the request and returns the user's identity
func (*Callback) LoginURL ¶
LoginURL returns the URL to redirect the user to login with.
type CallbackConfig ¶
type CallbackConfig struct{}
CallbackConfig holds the configuration parameters for a connector which requires no interaction.
func (*CallbackConfig) Open ¶
func (c *CallbackConfig) Open() (connector.Connector, error)
Open returns an authentication strategy which requires no user interaction.
type PasswordConfig ¶
PasswordConfig holds the configuration for a mock connector which prompts for the supplied username and password.
func (*PasswordConfig) Open ¶
func (c *PasswordConfig) Open() (connector.Connector, error)
Open returns an authentication strategy which prompts for a predefined username and password.