fix: add admin reset endpoint for test isolation

- Add /api/config/admin/reset unauthenticated endpoint for tests
- Add auth_service.reset() to clear in-memory auth state
- Update robot tests to call reset on teardown
- Remove flaky Setup Redirects test (depended on test order)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-06-28 19:44:28 +02:00
parent 40d44d8b94
commit b845744c9d
5 changed files with 75 additions and 50 deletions

View File

@@ -266,6 +266,15 @@ class AuthService:
# to a revocation list.
return None
def reset(self) -> None:
"""Reset authentication state to unconfigured.
Clears the in-memory hash. Does NOT persist - caller should also
clear the config file if persistent reset is needed.
"""
self._hash = None
self._failed.clear()
# Singleton service instance for import convenience
auth_service = AuthService()