Close certificate auth before revoking worker tokens and rotating its secret
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user