19 lines
562 B
Python
19 lines
562 B
Python
#!/usr/bin/env python3
|
|
"""Run against a test stack configured with SESSION_TTL_SECONDS=2."""
|
|
import time
|
|
from client import Client, arguments, check, run
|
|
|
|
|
|
def main():
|
|
args = arguments('Check that a short lived session expires')
|
|
client = Client(args.base_url, args.ca_file)
|
|
actor = client.user('expiry')
|
|
client.call('GET', '/api/v1/users/me', actor=actor, schema='User')
|
|
time.sleep(3)
|
|
client.call('GET', '/api/v1/users/me', 401, actor=actor)
|
|
print('PASS: expired Bearer token was rejected')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
run(main)
|