tokens

package
v0.0.0-...-7974e50 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedToken   = errors.New("malformed token")
	ErrInvalidTokenType = errors.New("invalid token type")
	ErrInvalidAlgorithm = errors.New("invalid algorithm")
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Encode(privateKey entity.Key, token entity.Token) ([]byte, error)
	GenerateOpaque(typ OpaqueTokenPrefix) (opaqueAccessToken string, seed string, err error)
	DecodeOpaque(typ OpaqueTokenPrefix, encodedOpaqueToken string) (string, error)
}

type OpaqueTokenPrefix

type OpaqueTokenPrefix int
const (
	// Opaque Refresh tokens are prefixed with "dfr_"
	RefreshToken OpaqueTokenPrefix = iota
	// Opaque Access tokens are prefixed with "dfa_"
	AccessToken
)

func (OpaqueTokenPrefix) String

func (t OpaqueTokenPrefix) String() (string, error)

type Validator

type Validator interface {
	VerifyToken(string) error
}

Directories

Path Synopsis
Opaque Tokens are generated from a random string with appended 8 digit crc32 hex checksum and encoded in base64 with a prefix depending on their type.
Opaque Tokens are generated from a random string with appended 8 digit crc32 hex checksum and encoded in base64 with a prefix depending on their type.

Jump to

Keyboard shortcuts

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