Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthentication ¶
func RegisterAuthentication(reg AuthenticationRegistration)
func RegisteredAuthenticationNames ¶
func RegisteredAuthenticationNames() []string
Types ¶
type Authentication ¶
type AuthenticationDeps ¶ added in v0.11.0
type AuthenticationDeps struct {
ErrorMessages config.ErrorMessages
ClientConfig config.ClientConfig
Datastores datastore.DatastoreRegistry
// Built from the TLS profiles ClientConfig references. Nil means http.DefaultTransport
Transport http.RoundTripper
// Builds the transport for a client overriding ClientConfig, from the TLS profiles it references
ClientTransport func(config.ClientConfig) (http.RoundTripper, error)
}
New dependencies are added as fields so the Initialize signature stays stable
type AuthenticationRegistration ¶
type AuthenticationRegistration interface {
Name() string
Initialize(config any, deps AuthenticationDeps) (Authentication, error)
InitializeConfig() any
}
func RegisteredAuthentication ¶
func RegisteredAuthentication(name string) (AuthenticationRegistration, bool)
type ValidationResult ¶ added in v0.12.0
type ValidationResult struct {
// Whether the request should proceed
Pass bool
// When validate should be called again. Pass should be false for already-expired tokens
Expiration time.Time
// By default only used for logging
UserID string
// The user's tenant or organization. By default only used for logging and analytics
TenantID string
// Layer IDs this token may access. Empty allows all layers
AllowedLayers []string
}
Returned by a custom auth script's validate. New fields avoid breaking the validate signature again
Click to show internal directories.
Click to hide internal directories.