add code for level 4

This commit is contained in:
Матвей
2026-10-08 19:08:55 +03:00
parent b158c88087
commit 13fa322ca2
21 changed files with 390 additions and 27 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
"""Проверка expiry; запускается при SESSION_TTL_SECONDS=2."""
from pathlib import Path
import sys
import time
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tests"))
from client import Client, check, run # noqa: E402
def main() -> None:
client = Client()
actor = client.user("expiry")
time.sleep(3)
client.call("GET", "/api/v1/users/me", 401, actor=actor)
print("PASS: expired Bearer session was rejected")
if __name__ == "__main__":
run(main)