token

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Paseto added in v0.0.10

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

func NewPaseto added in v0.0.10

func NewPaseto(publicKey paseto.V4AsymmetricPublicKey, privateKey paseto.V4AsymmetricSecretKey, options ...option.OptionArgs) *Paseto

func (*Paseto) Decrypt added in v0.0.10

func (p *Paseto) Decrypt(token string) (*paseto.Token, error)

func (*Paseto) Encrypt added in v0.0.10

func (p *Paseto) Encrypt(options ...TokenArgs) (string, error)

type Token

type Token interface {
	Decrypt(token string) (*paseto.Token, error)
	Encrypt(options ...TokenArgs) (string, error)
}

type TokenArgs added in v0.0.10

type TokenArgs func(token *paseto.Token) error

func WithAudience added in v0.0.10

func WithAudience(s string) TokenArgs

func WithClaims added in v0.0.10

func WithClaims[T any](key string, value T) TokenArgs

func WithExpiration added in v0.0.10

func WithExpiration(d time.Duration) TokenArgs

func WithIssuer added in v0.0.10

func WithIssuer(s string) TokenArgs

func WithNotBefore added in v0.0.10

func WithNotBefore(d time.Duration) TokenArgs

func WithSubject added in v0.0.10

func WithSubject(s string) TokenArgs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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