forked from mtusi2026/mtusi2026lab2
lab2
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# 2026-10-16 05:20:30 +0300, commit 65003b6 (+ незакоммиченные изменения)
|
||||
|
||||
## Таблицы PostgreSQL и применённые миграции
|
||||
List of relations
|
||||
Schema | Name | Type | Owner
|
||||
--------+-------------------+-------+-----------
|
||||
public | chat_members | table | messenger
|
||||
public | chats | table | messenger
|
||||
public | messages | table | messenger
|
||||
public | schema_migrations | table | messenger
|
||||
public | sessions | table | messenger
|
||||
public | users | table | messenger
|
||||
(6 rows)
|
||||
schema_migrations: 1,2
|
||||
|
||||
## Регистрация и password KDF
|
||||
OK POST /users: HTTP 201 (ожидалось 201)
|
||||
OK POST /users: HTTP 201 (ожидалось 201)
|
||||
OK POST /users: HTTP 201 (ожидалось 201)
|
||||
OK POST /users: HTTP 201 (ожидалось 201)
|
||||
OK POST /users: HTTP 201 (ожидалось 201)
|
||||
время POST /users (5 запросов): медиана 158 ms, min 142, max 162
|
||||
в ответе нет password/password_hash: True
|
||||
параметры hash в БД: argon2id$v=19$m=65536,t=2,p=1 (соль и hash не выводятся)
|
||||
|
||||
## Basic только на POST /auth/sessions, Bearer на остальных
|
||||
OK Basic → POST /auth/sessions: HTTP 201 (ожидалось 201)
|
||||
тело: {"expires_at": "2026-10-16T03:20:32Z", "token": "<64 hex-символов, скрыт>", "token_type": "Bearer", "user": {"created_at": "2026-10-16T02:20:31Z", "display_name": "Evidence", "id": "4e0662a9-cc8d-45d6-821f-040a1179ec68", "username": "ev_8a65abedae"}}
|
||||
OK неверный пароль → POST /auth/sessions: HTTP 401 (ожидалось 401) WWW-Authenticate: Basic realm="messenger", charset="UTF-8"
|
||||
OK Basic → GET /users/me: HTTP 401 (ожидалось 401) WWW-Authenticate: Bearer realm="messenger"
|
||||
OK X-User-Id без Bearer → GET /users/me: HTTP 401 (ожидалось 401) WWW-Authenticate: Bearer realm="messenger"
|
||||
OK Bearer → GET /users/me: HTTP 200 (ожидалось 200)
|
||||
тело: {"created_at": "2026-10-16T02:20:31Z", "display_name": "Evidence", "id": "4e0662a9-cc8d-45d6-821f-040a1179ec68", "username": "ev_8a65abedae"}
|
||||
|
||||
## Атомарное создание чата
|
||||
OK POST /chats с несуществующим участником: HTTP 400 (ожидалось 400)
|
||||
тело: {"error": {"code": "invalid_request", "message": "invalid members", "request_id": "17"}}
|
||||
чатов с title=atomic-b8723771: 0, строк chat_members с этим участником: 0
|
||||
|
||||
## Logout
|
||||
OK DELETE /auth/sessions/current: HTTP 204 (ожидалось 204)
|
||||
OK тот же токен → GET /users/me: HTTP 401 (ожидалось 401) WWW-Authenticate: Bearer realm="messenger"
|
||||
OK повторный logout: HTTP 401 (ожидалось 401) WWW-Authenticate: Bearer realm="messenger"
|
||||
Reference in New Issue
Block a user