Automatically clean failed login attempts

This commit is contained in:
2022-04-03 16:45:25 +02:00
parent 05e911bfc5
commit 9943df4952
3 changed files with 26 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
use std::time::Duration;
/// File in storage containing users list
pub const USERS_LIST_FILE: &str = "users.json";
@@ -32,3 +34,4 @@ pub const LOGIN_ROUTE: &str = "/login";
/// Bruteforce protection
pub const KEEP_FAILED_LOGIN_ATTEMPTS_FOR: u64 = 3600;
pub const MAX_FAILED_LOGIN_ATTEMPTS: u64 = 15;
pub const FAIL_LOGIN_ATTEMPT_CLEANUP_INTERVAL: Duration = Duration::from_secs(60);