forked from mtusi2026/mtusi2026lab2
16 lines
405 B
Python
16 lines
405 B
Python
#!/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)
|