Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoCredentials indicates no recognizable credentials were supplied. ErrNoCredentials = errors.New("access: no credentials provided") // ErrInvalidCredential signals that supplied credentials were rejected by a provider. ErrInvalidCredential = errors.New("access: invalid credential") // ErrNotHandled tells the manager to continue trying other providers. ErrNotHandled = errors.New("access: not handled") )
Functions ¶
func RegisterProvider ¶
func RegisterProvider(typ string, factory ProviderFactory)
RegisterProvider registers a provider factory for a given type identifier.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates authentication providers.
func (*Manager) Authenticate ¶
Authenticate evaluates providers until one succeeds.
func (*Manager) SetProviders ¶
SetProviders replaces the active provider list.
type Provider ¶
type Provider interface {
Identifier() string
Authenticate(ctx context.Context, r *http.Request) (*Result, error)
}
Provider validates credentials for incoming requests.
func BuildProviders ¶
BuildProviders constructs providers declared in configuration.
func ReconcileProviders ¶ added in v6.0.8
func ReconcileProviders(oldCfg, newCfg *config.Config, existing []Provider) (result []Provider, added, updated, removed []string, err error)
ReconcileProviders builds the desired provider list by reusing existing providers when possible and creating or removing providers only when their configuration changed. It returns the final ordered provider slice along with the identifiers of providers that were added, updated, or removed compared to the previous configuration.
type ProviderFactory ¶
ProviderFactory builds a provider from configuration data.