forked from mtusi2026/mtusi2026lab2
Implement lab2 PostgreSQL authentication and Redis sessions
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user