Реализовать lab2: PostgreSQL и постоянные Bearer-сессии
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user