Documentation ¶
Index ¶
- type TokenValidator
- func (v *TokenValidator) Authorize(ctx context.Context, r *http.Request, ar *requests.AuthorizationRequest) (usr *user.User, err error)
- func (v *TokenValidator) CacheUser(usr *user.User) error
- func (v *TokenValidator) Configure(ctx context.Context, keys []*kms.CryptoKey, accessList *acl.AccessList, ...) error
- func (v *TokenValidator) GetAuthCookies() map[string]interface{}
- func (v *TokenValidator) GetSourcePriority() []string
- func (v *TokenValidator) RegisterAuthProxy(cfg *authproxy.Config, authenticators []authproxy.Authenticator) error
- func (v *TokenValidator) SetSourcePriority(arr []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenValidator ¶
type TokenValidator struct {
// contains filtered or unexported fields
}
TokenValidator validates tokens in http requests.
func NewTokenValidator ¶
func NewTokenValidator() *TokenValidator
NewTokenValidator returns an instance of TokenValidator
func (*TokenValidator) Authorize ¶
func (v *TokenValidator) Authorize(ctx context.Context, r *http.Request, ar *requests.AuthorizationRequest) (usr *user.User, err error)
Authorize authorizes HTTP requests based on the presence and the content of the tokens in the requests.
func (*TokenValidator) CacheUser ¶
func (v *TokenValidator) CacheUser(usr *user.User) error
CacheUser adds a user to token validator cache.
func (*TokenValidator) Configure ¶
func (v *TokenValidator) Configure(ctx context.Context, keys []*kms.CryptoKey, accessList *acl.AccessList, opts *options.TokenValidatorOptions) error
Configure adds access list and keys for the verification of tokens.
func (*TokenValidator) GetAuthCookies ¶
func (v *TokenValidator) GetAuthCookies() map[string]interface{}
GetAuthCookies returns auth cookies registered with TokenValidator.
func (*TokenValidator) GetSourcePriority ¶
func (v *TokenValidator) GetSourcePriority() []string
GetSourcePriority returns the allowed token sources in their priority order.
func (*TokenValidator) RegisterAuthProxy ¶
func (v *TokenValidator) RegisterAuthProxy(cfg *authproxy.Config, authenticators []authproxy.Authenticator) error
RegisterAuthProxy registers authproxy.Authenticator with TokenValidator.
func (*TokenValidator) SetSourcePriority ¶
func (v *TokenValidator) SetSourcePriority(arr []string) error
SetSourcePriority sets the order in which various token sources are being evaluated for the presence of keys. The default order is cookie, header, and query parameters.