auth

package
v1.11.9 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultActionDispatcher

type DefaultActionDispatcher struct{}

func (DefaultActionDispatcher) Dispatch

func (DefaultActionDispatcher) Dispatch(view *core.StateView, featureName string, luaAction definitions.LuaAction)

Dispatch sends an action to the Lua execution pipeline, initializing context and preparing authentication details. It blocks until the action is completed and ensures proper resource cleanup.

type DefaultBruteForceService

type DefaultBruteForceService struct{}

DefaultBruteForceService implements core.BruteForceService in the auth subpackage. It mirrors the legacy behavior previously implemented in core.

func (DefaultBruteForceService) LoadHistories

func (DefaultBruteForceService) LoadHistories(ctx *gin.Context, auth *core.AuthState, accountName string)

LoadHistories mirrors the legacy logic that created a BucketManager and populated the AuthState's LoginAttempts/Passwords* counters.

func (DefaultBruteForceService) WaitDelay

func (DefaultBruteForceService) WaitDelay(maxWaitDelay, loginAttempt uint) int

WaitDelay implements the same hyperbolic tangent curve used previously in calculateWaitDelay.

type DefaultCacheService

type DefaultCacheService struct{}

DefaultCacheService implements core.CacheService in the auth subpackage. It mirrors the legacy behavior: on success, write a PositivePasswordCache to Redis. On failure, there is no Redis write here (brute-force bookkeeping is handled elsewhere).

func (DefaultCacheService) OnFailure

func (DefaultCacheService) OnFailure(_ *core.AuthState, _ string)

OnFailure handles the actions required in case of an unsuccessful authentication attempt for the given account name. No negative cache is written here (historic behavior); brute-force metrics are handled by other parts of the pipeline.

func (DefaultCacheService) OnSuccess

func (DefaultCacheService) OnSuccess(auth *core.AuthState, accountName string) error

OnSuccess updates the positive cache after a successful authentication attempt for the specified account name.

type DefaultFeatureEngine

type DefaultFeatureEngine struct{}

DefaultFeatureEngine implements the Lua feature evaluation analogous to the previous AuthState.FeatureLua (excluding the localhost/whitelist shortcuts; those remain in the orchestrator in core/features.go).

func (DefaultFeatureEngine) Evaluate

func (DefaultFeatureEngine) Evaluate(ctx *gin.Context, view *core.StateView) (bool, bool, []any, *string, error)

type DefaultLuaFilter

type DefaultLuaFilter struct{}

DefaultLuaFilter mirrors the previous AuthState.FilterLua behavior. Implemented in subpackage to avoid import cycles; registered via core.RegisterLuaFilter.

func (DefaultLuaFilter) Filter

func (DefaultLuaFilter) Filter(ctx *gin.Context, view *core.StateView, passDBResult *core.PassDBResult) definitions.AuthResult

Filter implements the Lua filter logic with identical behavior to the legacy inline method.

type DefaultPasswordVerifier

type DefaultPasswordVerifier struct{}

DefaultPasswordVerifier implements core.PasswordVerifier by mirroring the legacy verification loop using core helpers. It iterates configured backends and returns the first decisive result or an aggregated configuration error.

func (DefaultPasswordVerifier) Verify

func (DefaultPasswordVerifier) Verify(ctx *gin.Context, auth *core.AuthState, passDBs []*core.PassDBMap) (*core.PassDBResult, error)

type DefaultPostAction

type DefaultPostAction struct{}

DefaultPostAction mirrors the previous AuthState.PostLuaAction behavior.

func (DefaultPostAction) Run

Run implements the Lua post action dispatch with identical behavior to the legacy inline method.

type DefaultRBLService

type DefaultRBLService struct{}

DefaultRBLService implements the parallel RBL checks analogous to the previous logic in features.go.

func (DefaultRBLService) Score

func (DefaultRBLService) Score(ctx *gin.Context, view *core.StateView) (int, error)

func (DefaultRBLService) Threshold

func (DefaultRBLService) Threshold() int

Jump to

Keyboard shortcuts

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