token

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnsupportedAlgorithm = errors.New("substratum: algorithm not supported")
)

Functions

func Init

func Init()

Types

type JwtToken

type JwtToken struct{}

func (*JwtToken) Generate

func (t *JwtToken) Generate(s *secret.Info) (string, error)

Generate a new token with specified options.

func (*JwtToken) NewSecretKey

func (t *JwtToken) NewSecretKey(alg secret.Algorithm) ([]byte, error)

func (*JwtToken) Parse

func (t *JwtToken) Parse(md *common.Metadata) (*secret.Info, error)

Parse the metadata.

func (*JwtToken) ParseRaw

func (t *JwtToken) ParseRaw(token string) (*secret.Info, error)

ParseRaw parses a token string.

func (*JwtToken) Refresh

func (t *JwtToken) Refresh(s *secret.Info) (string, error)

Refresh the token with expired time renewed.

Jump to

Keyboard shortcuts

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