Реализовать lab2: PostgreSQL и постоянные Bearer-сессии
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Надежда Карпова
2026-11-05 01:43:30 +03:00
parent 65003b6119
commit 3daebda0cb
40 changed files with 4208 additions and 20 deletions
+14
View File
@@ -0,0 +1,14 @@
"""Run against a separate API with SESSION_TTL_SECONDS=2."""
import sys,time
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'tests'))
from client import Client,run
def main():
c=Client('http://localhost:8081')
a=c.user('expiry')
c.call('GET','/api/v1/users/me',actor=a,schema='User')
time.sleep(3)
c.call('GET','/api/v1/users/me',401,actor=a)
print('PASS: a real short-lived session authenticates before expiry and returns 401 after expiry')
if __name__=='__main__': run(main)