jwt

package
v0.5.23 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IsRefreshTokenClaim is the claim for refresh token
	IsRefreshTokenClaim = "irt"
)

Variables

View Source
var (
	UnableToReadKeyFileError     = errors.New("unable to read private key file")
	UnableToParsePrivateKeyError = errors.New("unable to parse private key")
	UnableToParsePublicKeyError  = errors.New("unable to parse public key")
	InvalidTokenError            = errors.New("invalid token")
	UnableToIssueTokenError      = errors.New("unable to issue token")
	UnexpectedSigningMethodError = errors.New("unexpected signing method")
	InvalidClaimsError           = errors.New("invalid claims")
	IRTNotValidError             = errors.New("irt not valid")
	MustBeAccessTokenError       = errors.New("must be access token")
	MustBeRefreshTokenError      = errors.New("must be refresh token")
)

Functions

func LoadJwtKey

func LoadJwtKey(jwtKey string) (string, error)

LoadJwtKey loads the JWT key from the environment

func ReadJwtKey

func ReadJwtKey(path string) ([]byte, error)

ReadJwtKey reads the JWT key from the given path

Types

type Token

type Token string

Token represents a token type

const (
	// RefreshToken represents a refresh token
	RefreshToken Token = "refresh_token"

	// AccessToken represents an access token
	AccessToken Token = "access_token"
)

func (Token) String

func (t Token) String() string

String returns the string representation of the token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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