Documentation ¶
Index ¶
- type TokenValidator
- func (v *TokenValidator) Authorize(ctx context.Context, r *http.Request) (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) 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) (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 ¶ added in v1.3.1
func (v *TokenValidator) CacheUser(usr *user.User) error
CacheUser adds a user to token validator cache.
func (*TokenValidator) Configure ¶ added in v1.3.1
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 ¶ added in v1.3.1
func (v *TokenValidator) GetAuthCookies() map[string]interface{}
GetAuthCookies returns auth cookies registered with TokenValidator.
func (*TokenValidator) GetSourcePriority ¶ added in v1.3.1
func (v *TokenValidator) GetSourcePriority() []string
GetSourcePriority returns the allowed token sources in their priority order.
func (*TokenValidator) SetSourcePriority ¶ added in v1.3.1
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.