test(auth): cover expired-key rejection in APIKeyAuthBackend (Stage 1 PR2)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -125,3 +125,13 @@ async def test_authenticate_suspended_workspace_returns_none(tmp_path):
|
||||
assert await backend.authenticate(gen.plaintext) is None
|
||||
finally:
|
||||
await _cleanup()
|
||||
|
||||
|
||||
async def test_authenticate_expired_key_returns_none(tmp_path):
|
||||
from datetime import UTC, datetime
|
||||
|
||||
backend, gen = await _setup_backend(tmp_path, expires_at=datetime(2000, 1, 1, tzinfo=UTC))
|
||||
try:
|
||||
assert await backend.authenticate(gen.plaintext) is None
|
||||
finally:
|
||||
await _cleanup()
|
||||
|
||||
Reference in New Issue
Block a user