Close certificate auth before revoking worker tokens and rotating its secret

This commit is contained in:
2026-11-16 12:03:49 +03:00
parent d8455d9417
commit 040fa8d4da
6 changed files with 156 additions and 5 deletions
+5 -3
View File
@@ -16,12 +16,14 @@ def honor_login_retry_after():
self, method, path, expected=200, body=None, actor=None, headers=None, raw=None, schema=None
):
global _paced_logins
if method != "POST" or path != "/api/v1/auth/sessions" or expected != 201:
if method != "POST" or path != "/api/v1/auth/sessions" or expected not in (201, 401):
return original(self, method, path, expected, body, actor, headers, raw, schema)
deadline = time.monotonic() + 90
while True:
response = original(self, method, path, [201, 429], body, actor, headers, raw, schema)
if response["status"] == 201:
response = original(
self, method, path, [expected, 429], body, actor, headers, raw, schema
)
if response["status"] == expected:
return response
if time.monotonic() >= deadline:
pytest.fail("Shared login budget did not recover within test deadline")