Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // signer is an interface for an opaque private key // that can be used for signing operations Signer crypto.Signer // Kid is the id of the key used for signing Kid string }
Config is the configuration for the JWTCA
type DefaultJWTValidator ¶
type DefaultJWTValidator struct {
// contains filtered or unexported fields
}
func NewDefaultJWTValidator ¶
func NewDefaultJWTValidator(c *ValidatorConfig) *DefaultJWTValidator
func (*DefaultJWTValidator) ValidateToken ¶
func (v *DefaultJWTValidator) ValidateToken(ctx context.Context, token string) (*jwt.RegisteredClaims, error)
type Issuer ¶
type Issuer interface { // IssueJWT issues a JWT and returns the JWT. IssueJWT(context.Context, *JWTParams) (string, error) }
Issuer is the interface used to sign JWTs.
type JWTCA ¶
type JWTCA struct {
// contains filtered or unexported fields
}
JWTCA is an implementation of the Issuer interface that issues JWTs.
type JWTParams ¶
type JWTParams struct { Issuer string Subject spiffeid.TrustDomain Audience []string TTL time.Duration }
JWTParams holds the parameters for issuing a JWT.
type Validator ¶
type Validator interface { // ValidateToken ValidateJWT validates a JWT and returns the claims. ValidateToken(context.Context, string) (*jwt.RegisteredClaims, error) }
Validator validates JWT tokens using a public key.
type ValidatorConfig ¶
type ValidatorConfig struct { // KeyManager is the key manager used to get the public key for validating the JWT. KeyManager keymanager.KeyManager ExpectedAudience []string }
Click to show internal directories.
Click to hide internal directories.