fix(cabana): scope the token last_used_at throttle to the guard instance
- The process-global debounce map was keyed by token ID, so a stamp from one test database suppressed a later write in another and turned TestBackendTokenPostgres red depending on order - Each compositeGuard now owns a stampThrottle; the backend guard and the ResolveBackend guard of one activation share it, so a single-app binary still writes last_used_at at most once a minute per token - TestTokenLastUsedThrottlePerGuard pins the per-guard isolation
This commit is contained in:
@@ -348,7 +348,7 @@ func TestTokenGatesSmoke(t *testing.T) {
|
||||
}
|
||||
|
||||
// Stamp debounce: two auths within a minute → one store stamp.
|
||||
lastStamp.Delete(uint(101))
|
||||
guard.stamps.last.Delete(uint(101))
|
||||
store.stampN = 0
|
||||
r = httptest.NewRequest(http.MethodGet, "/x", nil)
|
||||
r.Header.Set("Authorization", "Bearer "+demoTok)
|
||||
|
||||
Reference in New Issue
Block a user