users

package
v1.0.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthInsufficientPermissions = errors.New(errors.ErrForbidden, "insufficient_role_permissions")
	ErrAuth2faRequired             = errors.New(errors.ErrUnauthorized, "2fa_required")
	ErrAuthInvalidToken            = errors.New(errors.ErrUnauthorized, "invalid_token")
)

Functions

func NewJwtKey

func NewJwtKey(size int) string

Create JWT key

func WithAuthRolesOption

func WithAuthRolesOption(roles ...string) authRolesOption

func WithoutAuthMfaOption

func WithoutAuthMfaOption() authMfaOption

Types

type AuthOption

type AuthOption interface {
	Apply(server.ReqCtx, *tokenValidateResult) error
}

type Middleware

type Middleware interface {
	Auth(options ...AuthOption) func(server.ReqHandler) server.ReqHandler
}

func NewMiddleware

func NewMiddleware(config *MiddlewareConfig) Middleware

type MiddlewareConfig

type MiddlewareConfig struct {
	UsersService string
	HttpClient   client.Client
}

Jump to

Keyboard shortcuts

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