tokens

package
v0.0.0-...-a6f3d4c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const DefaultIssuer = "http://auth-service"

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 Parser

type Parser interface {
	ParseToken(string) (entity.Token, error)
}

type Translator

type Translator interface {
	TranslateAccessToken(ctx context.Context, opaqueAccessToken string) (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