session

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GeneratorCreateFailure = "failed to create session generator: %w"
)

Variables

This section is empty.

Functions

func ProcessJWTTemplate

func ProcessJWTTemplate(token jwt.Token, claims map[string]interface{}, user dto.UserJWT) error

ProcessJWTTemplate processes a map of claims using the provided user data and sets them on the token

Types

type JWTOptions

type JWTOptions func(token jwt.Token)

func WithValue

func WithValue(key string, value interface{}) JWTOptions

type JWTTemplateData

type JWTTemplateData struct {
	User *dto.UserJWT
}

JWTTemplateData holds the data available for template processing

type Manager

type Manager interface {
	GenerateJWT(user dto.UserJWT, opts ...JWTOptions) (string, jwt.Token, error)
	Verify(string) (jwt.Token, error)
	GenerateCookie(token string) (*http.Cookie, error)
	DeleteCookie() (*http.Cookie, error)
}

func NewManager

func NewManager(jwkManager hankoJwk.Manager, config config.Config) (Manager, error)

NewManager returns a new Manager which will be used to create and verify sessions JWTs

Jump to

Keyboard shortcuts

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