feat: enhance service discovery and proxy management
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from core.security import create_access_token, decode_access_token
|
||||
|
||||
|
||||
def test_create_access_token_uses_twelve_hour_default_window(monkeypatch):
|
||||
monkeypatch.setattr("core.security.settings.JWT_EXPIRE_MINUTES", 720)
|
||||
|
||||
issued_at = datetime.now(UTC)
|
||||
token = create_access_token(subject="admin")
|
||||
payload = decode_access_token(token)
|
||||
expires_at = datetime.fromtimestamp(payload.exp, UTC)
|
||||
|
||||
lifetime_seconds = (expires_at - issued_at).total_seconds()
|
||||
|
||||
assert 11.9 * 60 * 60 <= lifetime_seconds <= 12.1 * 60 * 60
|
||||
Reference in New Issue
Block a user