Implement lab2 PostgreSQL authentication and Redis sessions

This commit is contained in:
ferraronp
2026-10-23 18:33:06 +03:00
parent 65003b6119
commit 5dd32a77ac
23 changed files with 1126 additions and 55 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Requires a separate short-TTL run (SESSION_TTL_SECONDS=2); checks expiry automatically."""
import time
from client import Client, run
def main():
c = Client()
alice = c.user('expiry')
time.sleep(3.1)
c.call('GET','/api/v1/users/me',401,actor=alice)
print('PASS: short-lived Bearer session expires and is rejected')
if __name__ == '__main__':
run(main)