jwt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsernameKey = "username"
	ExpKey      = "exp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateTokensParams

type GenerateTokensParams struct {
	Username        string
	AccessTokenTTL  time.Duration
	RefreshTokenTTL time.Duration
	Secret          string
}

type GeneratedTokens

type GeneratedTokens struct {
	AccessToken  string
	RefreshToken string
}

type TokenGenerator

type TokenGenerator interface {
	GenerateFor(username string) (*GeneratedTokens, error)
}

func New

func New(cfg *config.Config, log *slog.Logger) TokenGenerator

Jump to

Keyboard shortcuts

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