forked from mtusi2026/mtusi2026lab4
Реализовать ЛР 4 на 3: приватное S3 и вложения — Гавриленко БПИ2303
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"""Run against an API started with SESSION_TTL_SECONDS=2; tokens never printed."""
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'tests'))
|
||||
from client import Client, arguments
|
||||
|
||||
args = arguments('Short-TTL session expiry')
|
||||
c = Client(args.base_url, args.ca_file)
|
||||
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)
|
||||
c.call('DELETE', '/api/v1/auth/sessions/current', 401, actor=a)
|
||||
print('PASS: session expires with TTL=2; expired token cannot read or logout')
|
||||
Reference in New Issue
Block a user