Documentation ¶
Overview ¶
Package test contains an identity provider useful for testing other parts of the system. The test identity provider is insecure by design so should not be used in any production system.
Index ¶
- func NewIdentityProvider(p Params) idp.IdentityProvider
- type Interactor
- func (i Interactor) Interact(ctx context.Context, client *httpbakery.Client, location string, ...) (*httpbakery.DischargeToken, error)
- func (i Interactor) Kind() string
- func (i Interactor) LegacyInteract(ctx context.Context, client *httpbakery.Client, location string, u *url.URL) error
- func (i Interactor) OpenWebBrowser(u *url.URL) error
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIdentityProvider ¶
func NewIdentityProvider(p Params) idp.IdentityProvider
NewIdentityProvider creates an idp.IdentityProvider that can be used for tests.
Types ¶
type Interactor ¶
type Interactor struct { // User contains the user to log in as. User may be fully defined // in which case the user is added to the database or can be a // Username or ExternalID. If the latter two cases the database // will be checked for a matching user. User *params.User // Doer contatins an httprequest.Doer that will be used with // OpenWebPage. Doer httprequest.Doer }
func (Interactor) Interact ¶
func (i Interactor) Interact(ctx context.Context, client *httpbakery.Client, location string, ierr *httpbakery.Error) (*httpbakery.DischargeToken, error)
Interact implements httpbakery.Interactor.Interact.
func (Interactor) Kind ¶
func (i Interactor) Kind() string
Kind implements httpbakery.Interactor.Kind.
func (Interactor) LegacyInteract ¶
func (i Interactor) LegacyInteract(ctx context.Context, client *httpbakery.Client, location string, u *url.URL) error
LegacyInteract implements httpbakery.LegacyInteractor.LegacyInteract.
func (Interactor) OpenWebBrowser ¶
func (i Interactor) OpenWebBrowser(u *url.URL) error
OpenWebBrowser implements an OpenWebBrowser function for use with httpbakery.WebBrowserInteractor.
type Params ¶
type Params struct { // Name is the name that will be used with the identity provider. Name string // Domain contains the domain that will be used with the identity // provider. Domain string // GetGroups contains function that if set will be called by // GetGroups to obtain the groups to return. GetGroups func(*store.Identity) ([]string, error) }
Click to show internal directories.
Click to hide internal directories.