authentication

package
v1.0.71 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExpired = errors.New("token expired")
	ErrInvalidToken = errors.New("invalid token")
)

Functions

func NewBearerToken

func NewBearerToken(sharedSecret string, opts ...TokenOpt) (string, error)

NewBearerToken generates a new bearer token

func ValidateToken

func ValidateToken(sharedSecret string, auth string) error

Types

type TokenOpt

type TokenOpt func(*tokenOpts) error

func WithExpiration

func WithExpiration(expiration time.Time) TokenOpt

func WithNonce deprecated

func WithNonce(nonce string) TokenOpt

WithNonce is a TokenOpt that sets the nonce for the token

Deprecated: it is better to pass no token and let the function generate a random token

Jump to

Keyboard shortcuts

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