Rotate the 1-minute anomaly detection window if expired.
(&self)
| 141 | |
| 142 | /// Rotate the 1-minute anomaly detection window if expired. |
| 143 | fn rotate_window_if_needed(&self) { |
| 144 | let now = now_secs(); |
| 145 | let start = self.window_start_secs.load(Ordering::Relaxed); |
| 146 | if now - start >= 60 { |
| 147 | self.window_start_secs.store(now, Ordering::Relaxed); |
| 148 | self.failed_login_window.store(0, Ordering::Relaxed); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | /// Open the JWKS circuit breaker (JWKS unreachable + cache expired). |
| 153 | pub fn open_jwks_circuit(&self) { |
no test coverage detected