jwt

package
v0.0.0-...-ccbf026 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeyBitSize = 2048
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStore

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

func NewKeyStore

func NewKeyStore(issuer string, tokenTTL time.Duration, keyTTL *time.Duration, keyBitSize int) (*KeyStore, error)

func NewSingleKeyStore

func NewSingleKeyStore(issuer string, tokenTTL time.Duration) (*KeyStore, error)

func (*KeyStore) GenerateJWT

func (ks *KeyStore) GenerateJWT(email string) (string, error)

func (*KeyStore) JWTS

func (ks *KeyStore) JWTS() jose.JSONWebKeySet

func (*KeyStore) ParseJWT

func (ks *KeyStore) ParseJWT(signedJwt string) (*UserClaims, error)

type UserClaims

type UserClaims struct {
	jwt.Claims
	Email string `json:"email"`
}

Jump to

Keyboard shortcuts

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