auth

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultHostServices

func NewDefaultHostServices() core.AuthnHostServices

NewDefaultHostServices constructs the explicit production host implementation bundle.

Types

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.

func (DefaultCacheService) Purge

func (DefaultCacheService) Purge(auth *core.AuthState, username string)

Purge removes all cached entries for the specified username.

type DefaultLuaSubject

type DefaultLuaSubject struct{}

DefaultLuaSubject executes exact generation-owned Lua subject sources.

func (DefaultLuaSubject) AnalyzeSource

func (DefaultLuaSubject) AnalyzeSource(
	ctx *gin.Context,
	view *core.StateView,
	passDBResult *core.PassDBResult,
	name string,
	prototype *lua.FunctionProto,
	pools *vmpool.Manager,
	poolKey vmpool.PoolKey,
	modules *luaseal.Modules,
) definitions.AuthResult

AnalyzeSource executes one exact generation-owned precompiled subject source.

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)

Verify provides the exported Verify method.

type DefaultRBLService

type DefaultRBLService struct{}

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

func (DefaultRBLService) Score

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

Score provides the exported Score method.

func (DefaultRBLService) ScoreWithFacts

func (DefaultRBLService) ScoreWithFacts(ctx *gin.Context, view *core.StateView) (core.RBLPolicyFact, error)

ScoreWithFacts computes the aggregated RBL score and request-local policy facts.

Jump to

Keyboard shortcuts

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