Documentation ¶
Index ¶
Constants ¶
View Source
const ( ExtractModeHeader = "header" ExtractModeCookie = "cookie" ExtractModeQuery = "query" ExtractModePathSuffix = "path" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Custom ¶
type Custom struct { CustomConfig // contains filtered or unexported fields }
type CustomConfig ¶
type CustomConfig struct { Token map[string]string // How to extract the auth token from the request. Key should be one of the ExtractMode and Value is the specific identifier (or blank if inapplicable) CacheSize int // Configures the size of the cache of already verified tokens to avoid re-verifying every request. Set to -1 to disable. Defaults to 100 File string // Contains the go code to perform validation of the auth token as a file. Script string // Contains the go code to perform validation of the auth token inline. }
type CustomRegistration ¶
type CustomRegistration struct { }
func (CustomRegistration) Initialize ¶
func (s CustomRegistration) Initialize(cfgAny any, errorMessages config.ErrorMessages) (authentication.Authentication, error)
func (CustomRegistration) InitializeConfig ¶
func (s CustomRegistration) InitializeConfig() any
func (CustomRegistration) Name ¶
func (s CustomRegistration) Name() string
type JWT ¶
type JWTConfig ¶
type JWTConfig struct { //TODO: Performance profile if the cache is actually worthwhile CacheSize uint16 // Configures the size of the cache of already verified JWTs to avoid re-verifying keys for every token. Expiration still applies. Set to 0 to disable. Defaults to 0 Key string // The key for verifying the signature. The public key if using asymmetric signing. Required Algorithm string // Algorithm to allow for JWT signature. Required HeaderName string // The header to extract the JWT from. If this is "Authorization" it removes the "Bearer " from the start. Defaults to "Authorization" MaxExpiration uint32 // How many seconds from now can the expiration be. JWTs more than X seconds from now will result in a 401. Defaults to 1 day ExpectedAudience string // If specified, require the "aud" grant to be this string ExpectedSubject string // If specified, require the "sub" grant to be this string ExpectedIssuer string // If specified, require the "iss" grant to be this string ExpectedScope string // If specified, require the "scope" grant to contain this string. LayerScope bool // If specified, the "scope" grant is used to limit access to layer ScopePrefix string // If LayerScope is true, this prefix indicates scopes to use UserID string // Use the specified grant as the user identifier. Defaults to sub }
type JWTRegistration ¶
type JWTRegistration struct { }
func (JWTRegistration) Initialize ¶
func (s JWTRegistration) Initialize(configAny any, errorMessages config.ErrorMessages) (authentication.Authentication, error)
func (JWTRegistration) InitializeConfig ¶
func (s JWTRegistration) InitializeConfig() any
func (JWTRegistration) Name ¶
func (s JWTRegistration) Name() string
type Noop ¶
type Noop struct {
NoopConfig
}
type NoopConfig ¶
type NoopConfig struct { }
type NoopRegistration ¶
type NoopRegistration struct { }
func (NoopRegistration) Initialize ¶
func (s NoopRegistration) Initialize(config any, _ config.ErrorMessages) (authentication.Authentication, error)
func (NoopRegistration) InitializeConfig ¶
func (s NoopRegistration) InitializeConfig() any
func (NoopRegistration) Name ¶
func (s NoopRegistration) Name() string
type StaticKey ¶
type StaticKey struct {
StaticKeyConfig
}
type StaticKeyConfig ¶
type StaticKeyConfig struct {
Key string
}
type StaticKeyRegistration ¶
type StaticKeyRegistration struct { }
func (StaticKeyRegistration) Initialize ¶
func (s StaticKeyRegistration) Initialize(cfgAny any, _ config.ErrorMessages) (authentication.Authentication, error)
func (StaticKeyRegistration) InitializeConfig ¶
func (s StaticKeyRegistration) InitializeConfig() any
func (StaticKeyRegistration) Name ¶
func (s StaticKeyRegistration) Name() string
type ValidationResult ¶
type ValidationResult struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.