Files
mtusi2026lab2/evidence/test-api.txt

24 lines
1.7 KiB
Plaintext

# 2026-10-26T17:31:57Z native stand; Linux 6.18.44-fc-v153 x86_64; nproc=2; mem=8027MiB
$ python3 student-tests/test_api.py
## API, auth, validation, ACL, transactions (http://localhost:8080)
PASS password stored only as scrypt KDF hash; User has no secret fields 0.36s
PASS wrong password and unknown user: identical 401 + Basic challenge 0.80s
PASS malformed Basic / Bearer on /auth/sessions / body on login 0.01s
PASS password with ':' and non-ASCII UTF-8 works (RFC 7617) 0.57s
PASS opaque 256-bit token, unique per login, DB stores only SHA-256 0.66s
PASS only Bearer accepted; Basic and X-User-Id never authenticate 0.01s
PASS logout revokes only the current session; repeat -> 401 0.92s
PASS strict JSON validation -> 400 0.02s
PASS message text: 4000 code points OK, 4001 / whitespace / sender_id -> 400 0.02s
PASS SQL is parameterized: injection payloads stored verbatim 0.01s
PASS ACL: outsider gets 404 everywhere (even for invalid body) 0.02s
PASS create chat validation: duplicates, caller missing, unknown member 0.00s
PASS compound create-chat rolls back on FK failure (no orphan chat) 0.14s chats before=2, failed insert left 0 rows
PASS registration race: 20 parallel same username -> exactly one 201 2.91s 201x1, 409x19, rows=1
PASS keyset pagination: 120 msgs, varying limit, no gaps/duplicates 0.54s 4 pages
PASS chat list: only own chats, ordered, cursor bound to user 0.64s
PASS read-after-write: confirmed message visible to next read 0.01s
PASS unknown route 404 / wrong method 405 in error format 0.01s
summary: 18 passed, 0 failed
exit=0