auth

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginKey = "login"
)

Variables

View Source
var NoLogin = &NoLoginError{}

Functions

func User

func User[T any](r *AuthenticationFilter, request *web.Request) (T, error)

func WithLogin

func WithLogin() web.MetaOption

Types

type Authentication

type Authentication interface {
	SignIn(user any, request *web.Request) (any, error)
	SignOut(request *web.Request) (any, error)
	User(request *web.Request, ctx *core.Context) (any, error)
}

type AuthenticationFilter

type AuthenticationFilter struct {
	// contains filtered or unexported fields
}

func NewAuthenticationFilter

func NewAuthenticationFilter(authentication Authentication) *AuthenticationFilter

func (*AuthenticationFilter) Handle

func (s *AuthenticationFilter) Handle(filterChain web.FilterChain, request *web.Request) (any, error)

func (*AuthenticationFilter) Init

func (s *AuthenticationFilter) Init(ctx *core.Context) error

func (*AuthenticationFilter) SignIn

func (s *AuthenticationFilter) SignIn(user any, request *web.Request) (any, error)

func (*AuthenticationFilter) SignOut

func (s *AuthenticationFilter) SignOut(request *web.Request) (any, error)

func (*AuthenticationFilter) User

func (s *AuthenticationFilter) User(request *web.Request) (any, error)

type NoLoginError

type NoLoginError struct {
	// contains filtered or unexported fields
}

func (*NoLoginError) Error

func (e *NoLoginError) Error() string

Jump to

Keyboard shortcuts

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