Documentation
¶
Overview ¶
Package basculejwt provides JWT support for the bascule workflow. The canonical parser is implemented in terms of https://pkg.go.dev/github.com/lestrrat-go/jwx/v2/jwt#Parse.
Index ¶
Constants ¶
View Source
const CapabilitiesKey = "capabilities"
CapabilitiesKey is the JWT claims key where capabilities are expected.
Variables ¶
This section is empty.
Functions ¶
func NewTokenParser ¶
func NewTokenParser(options ...jwt.ParseOption) (bascule.TokenParser[string], error)
NewTokenParser constructs a parser using the supplied set of parse options.
Types ¶
type Claims ¶
type Claims interface {
// Audience returns the aud field of the JWT.
Audience() []string
// Expiration returns the exp field of the JWT.
Expiration() time.Time
// IssuedAt returns the iat field of the JWT.
IssuedAt() time.Time
// Issuer returns the iss field of the JWT.
Issuer() string
// JwtID returns the jti field of the JWT.
JwtID() string
// NotBefore returns the nbf field of the JWT.
NotBefore() time.Time
// Subject returns the sub field of the JWT. For tokens that
// implement this interface, this method returns the same value
// as tne Principal method.
Subject() string
}
Claims exposes standard JWT claims from a Token.
Click to show internal directories.
Click to hide internal directories.