21 lines
534 B
Python
21 lines
534 B
Python
#!/usr/bin/env python3
|
|
"""Проверка expiry; запускается при SESSION_TTL_SECONDS=2."""
|
|
from pathlib import Path
|
|
import sys
|
|
import time
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tests"))
|
|
from client import Client, check, run # noqa: E402
|
|
|
|
|
|
def main() -> None:
|
|
client = Client()
|
|
actor = client.user("expiry")
|
|
time.sleep(3)
|
|
client.call("GET", "/api/v1/users/me", 401, actor=actor)
|
|
print("PASS: expired Bearer session was rejected")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
run(main)
|