Check if failed login rate exceeds threshold (anomaly alert).
(&self, threshold: u64)
| 135 | |
| 136 | /// Check if failed login rate exceeds threshold (anomaly alert). |
| 137 | pub fn failed_login_spike(&self, threshold: u64) -> bool { |
| 138 | self.rotate_window_if_needed(); |
| 139 | self.failed_login_window.load(Ordering::Relaxed) > threshold |
| 140 | } |
| 141 | |
| 142 | /// Rotate the 1-minute anomaly detection window if expired. |
| 143 | fn rotate_window_if_needed(&self) { |
nothing calls this directly
no test coverage detected