Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func (Authenticator) Authenticate ¶
func (a Authenticator) Authenticate(ctx context.Context, tokenStr string) (*auth.Customer, *auth.Token, error)
Authenticate takes a JWT and returns an authenticated auth.Customer
func (Authenticator) CanAccept ¶
func (a Authenticator) CanAccept(token string) bool
CanAccept returns true if the token can be handled by this Authenticator. This does not confirm the token is a valid JWT, just that there 3 base64url strings separated by periods.
type Authority ¶
type Authority interface { // JWK takes a kid from a JWT and returns a matching JWK JWK(kid string) (jwk.Key, bool) // NewCustomerClaims returns a pointer to an implementation of CustomerClaims NewCustomerClaims() CustomerClaims }
Authority represents a JWT Authority that can validate the token and define the customer claims.
type CustomerClaims ¶
type CustomerClaims interface { // Customer returns the customer built from custom claims. Customer() *auth.Customer jwt.Claims }
CustomerClaims represents a struct that JWT claims can be unmarshalled into. As well as the standard registered claims, there should also be customer claims that represent the authenticated auth.Customer.
Click to show internal directories.
Click to hide internal directories.