auth

package
v1.147.0-pfs-237-be-jwt.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Client  Client
	EnvVars EnvVars
}

func (*Auth) Authenticate

func (a *Auth) Authenticate(next http.Handler) http.Handler

type Claims

type Claims struct {
	Roles []string `json:"roles"`
	jwt.RegisteredClaims
}

type Client

type Client interface {
	GetUserSession(ctx context.Context) (*shared.User, error)
}

type Context

type Context struct {
	context.Context
	Cookies   []*http.Cookie
	XSRFToken string
	User      *shared.User
}

func (Context) WithContext

func (c Context) WithContext(ctx context.Context) Context

type EnvVars

type EnvVars struct {
	SiriusPublicURL string
	Prefix          string
}

type JWT

type JWT struct {
	Secret string
}

func (*JWT) CreateJWT

func (j *JWT) CreateJWT(ctx context.Context) string

Jump to

Keyboard shortcuts

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