basculejwt

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL