jwtsvid

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenExpiry

func GetTokenExpiry(token string) (time.Time, time.Time, error)

func ValidateToken

func ValidateToken(ctx context.Context, token string, keyStore KeyStore, audience []string) (spiffeid.ID, map[string]interface{}, error)

Types

type KeyStore

type KeyStore interface {
	FindPublicKey(ctx context.Context, td spiffeid.TrustDomain, kid string) (crypto.PublicKey, error)
}

func NewKeyStore

func NewKeyStore(trustDomainKeys map[spiffeid.TrustDomain]map[string]crypto.PublicKey) KeyStore

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner(config SignerConfig) *Signer

func (*Signer) SignToken

func (s *Signer) SignToken(id spiffeid.ID, audience []string, expires time.Time, signer crypto.Signer, kid string) (string, error)

type SignerConfig

type SignerConfig struct {
	Clock clock.Clock

	// Issuer is used as the value of the issuer (iss) claim, if set.
	Issuer string
}

Jump to

Keyboard shortcuts

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