forked from mtusi2026/mtusi2026lab3
24 lines
1.6 KiB
Plaintext
24 lines
1.6 KiB
Plaintext
# 2026-11-03T09:51:04Z commit=n/a host=Linux 6.18.44-fc-v230 x86_64 cpus=2
|
|
$ python3 student-tests/test_api.py
|
|
## API, auth, validation, ACL, transactions (http://127.0.0.1:8080)
|
|
PASS password stored only as scrypt KDF hash; User has no secret fields 0.66s
|
|
PASS wrong password and unknown user: identical 401 + Basic challenge 0.86s
|
|
PASS malformed Basic / Bearer on /auth/sessions / body on login 0.01s
|
|
PASS password with ':' and non-ASCII UTF-8 works (RFC 7617) 0.53s
|
|
PASS opaque 256-bit token, unique per login, DB stores only SHA-256 0.97s
|
|
PASS only Bearer accepted; Basic and X-User-Id never authenticate 0.02s
|
|
PASS logout revokes only the current session; repeat -> 401 1.14s
|
|
PASS strict JSON validation -> 400 0.04s
|
|
PASS message text: 4000 code points OK, 4001 / whitespace / sender_id -> 400 0.04s
|
|
PASS SQL is parameterized: injection payloads stored verbatim 0.02s
|
|
PASS ACL: outsider gets 404 everywhere (even for invalid body) 0.03s
|
|
PASS create chat validation: duplicates, caller missing, unknown member 0.01s
|
|
PASS compound create-chat rolls back on FK failure (no orphan chat) 0.56s chats before=2, failed insert left 0 rows
|
|
PASS registration race: 20 parallel same username -> exactly one 201 3.49s 201x1, 409x19, rows=1
|
|
PASS keyset pagination: 120 msgs, varying limit, no gaps/duplicates 0.94s 4 pages
|
|
PASS chat list: only own chats, ordered, cursor bound to user 0.77s
|
|
PASS read-after-write: confirmed message visible to next read 0.01s
|
|
PASS unknown route 404 / wrong method 405 in error format 0.00s
|
|
summary: 18 passed, 0 failed
|
|
exit=0
|