auth

package
v0.0.0-...-4c26945 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIPCount        = 100
	ExpireDuration    = 30 * time.Minute
	MaxFailedAttempts = 10
	LockDuration      = 5 * time.Minute
)
View Source
const (
	MFASessionTTL             = 5 * time.Minute
	MFASessionStoreMaxEntries = 1024
	MFASessionMaxFailures     = 5
)

Variables

This section is empty.

Functions

func GetMFASessionStore

func GetMFASessionStore() *mfaSessionStore

Types

type IPRecord

type IPRecord struct {
	NeedCaptcha bool
	FailedCount int
	LockedUntil time.Time
	LastUpdate  time.Time
}

type IPTracker

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

func NewIPTracker

func NewIPTracker() *IPTracker

func (*IPTracker) Clear

func (t *IPTracker) Clear(ip string)

func (*IPTracker) IsLocked

func (t *IPTracker) IsLocked(ip string) bool

func (*IPTracker) NeedCaptcha

func (t *IPTracker) NeedCaptcha(ip string) bool

func (*IPTracker) RecordFailure

func (t *IPTracker) RecordFailure(ip string)

func (*IPTracker) SetNeedCaptcha

func (t *IPTracker) SetNeedCaptcha(ip string)

Jump to

Keyboard shortcuts

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