Auth: Add setting to disable username based brute force login protection (#109152)

* Add setting to disable username based brute force login protection

* Use new DisableUsernameLoginProtection setting in tests where appropriate

* Update documentation for other brute force directives

* Avoid unecessary database calls

* Add test cases for username and IP protection settings
This commit is contained in:
Théo Brigitte
2025-08-06 14:08:49 +00:00
committed by GitHub
parent f82ea23061
commit 5c50fc6385
6 changed files with 156 additions and 48 deletions
+2
View File
@@ -157,6 +157,7 @@ type Cfg struct {
DisableInitAdminCreation bool
DisableBruteForceLoginProtection bool
BruteForceLoginProtectionMaxAttempts int64
DisableUsernameLoginProtection bool
DisableIPAddressLoginProtection bool
CookieSecure bool
CookieSameSiteDisabled bool
@@ -1587,6 +1588,7 @@ func readSecuritySettings(iniFile *ini.File, cfg *Cfg) error {
cfg.DisableBruteForceLoginProtection = security.Key("disable_brute_force_login_protection").MustBool(false)
cfg.BruteForceLoginProtectionMaxAttempts = security.Key("brute_force_login_protection_max_attempts").MustInt64(5)
cfg.DisableUsernameLoginProtection = security.Key("disable_username_login_protection").MustBool(false)
cfg.DisableIPAddressLoginProtection = security.Key("disable_ip_address_login_protection").MustBool(true)
// Ensure at least one login attempt can be performed.