middleware

package
v0.0.0-...-b24cf89 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxLoginAttempts    = 5
	InitialLockDuration = 1 * time.Minute
	MaxLockDuration     = 15 * time.Minute
	AttemptWindow       = 5 * time.Minute
)

Variables

This section is empty.

Functions

func AuthRateLimiter

func AuthRateLimiter(c *fiber.Ctx) error

AuthRateLimiter provides brute-force protection for authentication endpoints

func CleanupOldAttempts

func CleanupOldAttempts()

CleanupOldAttempts removes stale entries from the map (call periodically)

func MasterAuth

func MasterAuth(c *fiber.Ctx) error

func RecordFailedLogin

func RecordFailedLogin(ip string)

RecordFailedLogin should be called after a failed login attempt

func RecordSuccessfulLogin

func RecordSuccessfulLogin(ip string)

RecordSuccessfulLogin should be called after a successful login

func SecurityHeaders

func SecurityHeaders(c *fiber.Ctx) error

SecurityHeaders adds security-related HTTP headers to all responses

Types

This section is empty.

Jump to

Keyboard shortcuts

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