ЛР 2 — БВТ2301 — Васильев — на 5 #137
+7
-20
@@ -1,20 +1,7 @@
|
||||
.git
|
||||
.github
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
secrets
|
||||
certs
|
||||
volumes
|
||||
data
|
||||
backups
|
||||
*.key
|
||||
*.pem
|
||||
*.p12
|
||||
*.pfx
|
||||
*.jks
|
||||
.venv
|
||||
__pycache__
|
||||
node_modules
|
||||
evidence
|
||||
.DS_Store
|
||||
*
|
||||
!pyproject.toml
|
||||
!uv.lock
|
||||
!src/
|
||||
!src/**
|
||||
!migrations/
|
||||
!migrations/**
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
## Лабораторная 2
|
||||
|
||||
Автор / группа: TODO
|
||||
Целевая оценка (3/4/5): TODO
|
||||
Трек 5, если заявлен: TODO
|
||||
Васильев Никита, БВТ2301. Целевая оценка5. Трек: План запроса и восстановление.
|
||||
|
||||
Что реализовано и что перенесено: TODO
|
||||
Команды запуска из чистого clone: TODO
|
||||
Результаты проверок и ссылка на REPORT.md: TODO
|
||||
Ограничения / известные ошибки: TODO
|
||||
Источники и использование ИИ: TODO
|
||||
Реализованы обязательный API и все пункты уровня4; методика выбранного исследования,
|
||||
реальные результаты и ограничения приведены в `REPORT.md`.
|
||||
Команды запуска: `uv sync --locked --python 3.12`, `make up`, `make test`,
|
||||
`make check validate PYTHON=.venv/bin/python`, `make lint test-student`.
|
||||
Подробные проверки отказов и повторение исследования — в отчёте.
|
||||
|
||||
- [ ] Весь обязательный минимум текущей и предыдущих работ сохранён с объявленными переходами.
|
||||
- [ ] Контракт и публичные тесты не ослаблены.
|
||||
- [ ] make check и make test выполнены; приложен реальный вывод.
|
||||
- [ ] Сценарии отказов/безопасности своего уровня воспроизведены.
|
||||
- [ ] Все секреты и приватные ключи находятся вне Git; отчёт не содержит tokens.
|
||||
- [ ] README задания сохранён, REPORT.md содержит инструкцию именно моего решения.
|
||||
Исходные contracts и публичные tests сохранены. Secrets, .env и volumes в Git не входят.
|
||||
Чистый clone проверен отдельно; evidence локальные, удалённый CI пока не запускался.
|
||||
Работа опубликована: https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2/pulls/137.
|
||||
Помощь ИИ использована при подготовке и проверке; результаты проверены реальными запусками.
|
||||
|
||||
- [x] Обязательный минимум сохранён с объявленным переходом API.
|
||||
- [x] Контракт и публичные tests не ослаблены.
|
||||
- [x] Проверки и ограничения описаны в REPORT.md.
|
||||
- [x] Исходный README задания сохранён.
|
||||
|
||||
@@ -30,3 +30,5 @@ coverage/
|
||||
.vscode/
|
||||
# Keep small, sanitized evidence summaries in evidence/ under version control.
|
||||
# Inspect git diff --cached: ignore rules are not a secret scanner.
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
# Конспект защиты — ЛР2
|
||||
|
||||
Васильев Никита, БВТ2301. Целевая оценка — 5, трек 2: план запроса и восстановление.
|
||||
Это объяснение кода и план демонстрации; завершённые проверки и измеренные значения
|
||||
нужно смотреть в `REPORT.md` и `evidence/`.
|
||||
|
||||
## Что изменилось после ЛР1
|
||||
|
||||
В ЛР1 состояние было памятью одного процесса, а `X-User-Id` позволял выбрать любую
|
||||
существующую личность. В ЛР2 `src/messenger/app.py` создаёт `PostgresStore`:
|
||||
пользователи, чаты, участники, сообщения и сессии находятся в PostgreSQL.
|
||||
Регистрация принимает пароль. Только создание сессии использует Basic; защищённые
|
||||
endpoint принимают Bearer. `X-User-Id` больше не задаёт пользователя.
|
||||
|
||||
`models.py` проверяет входные данные, `app.py` содержит HTTP-маршруты и единый формат
|
||||
ошибок, `postgres.py` — запросы, транзакции, сессии и кэш. `domain.py` сохраняет общий
|
||||
формат UUID, серверного времени и cursor. Подробная схема приведена в `SCHEMA.md`,
|
||||
ограничения — в `migrations/001_initial.sql`.
|
||||
|
||||
Compose запускает API, PostgreSQL и Valkey. Миграции выполняет отдельный сервис
|
||||
`migrate` до старта API. На хост публикуется только loopback-порт API 8082.
|
||||
PostgreSQL использует именованный volume; Valkey — одноразовый кэш без persistence.
|
||||
|
||||
## Что подтверждает COMMIT
|
||||
|
||||
Транзакция объединяет несколько изменений: они либо фиксируются вместе, либо
|
||||
откатываются. Создание чата и всех строк `members` выполняется в одном
|
||||
`conn.transaction()`. Неизвестный участник нарушит внешний ключ, и PostgreSQL
|
||||
откатит уже созданный чат и предыдущих участников. Читатель не должен получить
|
||||
наполовину созданный чат.
|
||||
|
||||
При успешном COMMIT PostgreSQL фиксирует транзакцию и делает её результат видимым
|
||||
последующим чтениям. В Compose явно включены `fsync=on`, `synchronous_commit=on`,
|
||||
`full_page_writes=on`: подтверждение связано с записью WAL согласно гарантиям
|
||||
PostgreSQL и дискового стека. WAL позволяет восстановить согласованное состояние
|
||||
после аварии процесса. `full_page_writes` защищает от частичной записи страниц
|
||||
при восстановлении, но не заменяет резервную копию.
|
||||
|
||||
COMMIT не означает, что данные переживут уничтожение единственного диска/volume,
|
||||
всей машины или неисправное оборудование, которое неверно подтверждает flush.
|
||||
В стенде нет репликации PostgreSQL. Именованный volume переживает пересоздание
|
||||
контейнера, но не явное удаление volume. Резервная копия и проверенное восстановление
|
||||
решают другую задачу: получение нового хранилища из сохранённого снимка.
|
||||
|
||||
Если клиент потерял HTTP-ответ после COMMIT, он может не знать, произошла ли запись.
|
||||
В обязательной ЛР2 нет ключей идемпотентности сообщения: слепой повтор POST может
|
||||
создать ещё одно сообщение. Эта проблема отдельно решается в следующей работе.
|
||||
|
||||
## Таблицы, ограничения и миграции
|
||||
|
||||
- `users`: UUID PK, уникальный username, публичное имя, Argon2id hash и время.
|
||||
- `chats`: UUID PK, название и время.
|
||||
- `members`: составной PK `(chat_id,user_id)`, внешние ключи, позиция участника.
|
||||
- `messages`: UUID PK и составной FK `(chat_id,sender_id)` на `members`.
|
||||
- `sessions`: SHA-256 digest токена, пользователь и абсолютный `expires_at`.
|
||||
- `schema_migrations`: имя миграции и её SHA-256.
|
||||
|
||||
Уникальность username обеспечивается `UNIQUE` в БД, включая конкурентную регистрацию.
|
||||
Предварительный SELECT не заменил бы это ограничение: между SELECT и INSERT другая
|
||||
транзакция могла бы занять имя. Параметры SQL передаются отдельно от текста запроса.
|
||||
|
||||
`migrate.py` берёт транзакционную advisory-блокировку: два мигратора не применяют
|
||||
одну миграцию одновременно. Повтор пропускает уже применённый файл, если checksum
|
||||
совпадает. Изменённая старая миграция вызывает ошибку; исправление схемы должно быть
|
||||
новой миграцией. Таблицы и отметки миграции фиксируются атомарно.
|
||||
|
||||
## Где живут сессии и что произойдёт после flush/restart Valkey
|
||||
|
||||
Случайный токен создаётся `secrets.token_urlsafe(32)` — 32 случайных байта, то есть
|
||||
256 бит исходной энтропии. Клиент получает исходный токен, а таблица `sessions`
|
||||
хранит только его SHA-256 digest. Время истечения вычисляется один раз при входе.
|
||||
Каждый защищённый запрос проверяет в PostgreSQL одновременно digest и
|
||||
`expires_at > now()`. Рестарт не выдаёт новую сессию и не продлевает TTL.
|
||||
|
||||
Logout удаляет сессию из PostgreSQL. Поэтому даже существующая запись кэша не
|
||||
может оживить отозванный токен. Повторный logout с тем же токеном — 401.
|
||||
|
||||
Valkey хранит только неизменяемые публичные карточки пользователей под
|
||||
`user:v1:<uuid>` на 60 секунд. Ни паролей, ни токенов, ни истории в кэше нет.
|
||||
Проверка сессии остаётся в БД даже при cache hit. При miss карточка читается из БД
|
||||
и кладётся в кэш. Отдельная инвалидация не требуется, потому что обязательный API
|
||||
не умеет менять или удалять пользователя. Если эти операции появятся, правило
|
||||
неизменяемости и политика инвалидации потребуют пересмотра.
|
||||
|
||||
Flush или restart Valkey удаляет только ускоряющие копии. Запрос может снова
|
||||
прочитать карточку из PostgreSQL. Недоступный Valkey обходится с коротким сетевым
|
||||
таймаутом. Недоступная БД не обходится авторизацией из кэша: запрос возвращает 503,
|
||||
а `/health/ready` не сообщает готовность. `/health/live` проверяет только процесс.
|
||||
Кэш — доверенный внутренний компонент; это учебный локальный стенд, не модель
|
||||
защиты от компрометации самого кэша.
|
||||
|
||||
## Аутентификация и право доступа к чату
|
||||
|
||||
Аутентификация отвечает: «какой пользователь предъявил действующий секрет?».
|
||||
В `actor()` Bearer проверяется через `PostgresStore.authenticate()`.
|
||||
Неизвестная/истёкшая/отозванная сессия даёт 401 с `WWW-Authenticate: Bearer`.
|
||||
Basic на бизнес-endpoint не заменяет Bearer.
|
||||
|
||||
Авторизация отвечает: «может ли этот пользователь выполнить действие над этим
|
||||
чатом?». `_chat()` проверяет строку `members` для пары чат/текущий пользователь.
|
||||
Наличие действующей сессии само по себе не даёт доступ ко всем чатам. Чужой
|
||||
и неизвестный чат возвращают одинаковый 404, чтобы не раскрывать существование.
|
||||
Автор сообщения берётся из сессии; `sender_id` в JSON-запросе запрещён.
|
||||
|
||||
## Argon2id и быстрый digest решают разные задачи
|
||||
|
||||
Пароли выбирают люди, и они могут быть слабыми. `PasswordHasher` использует
|
||||
Argon2id с солью и затратами времени/памяти: текущие параметры — 64 MiB памяти,
|
||||
две итерации, parallelism 1. Это повышает стоимость перебора утёкших hash.
|
||||
Соль и параметры входят в строку hash. Глобальный `BoundedSemaphore(2)` ограничивает
|
||||
число одновременно дорогих KDF-операций в одном процессе.
|
||||
|
||||
Пароли принимаются целиком в Unicode-диапазоне 12–128 code points без усечения.
|
||||
В Basic строка декодируется как UTF-8 и делится по первому двоеточию: двоеточия
|
||||
в пароле допустимы. Basic — base64-кодирование, оно не шифрует пароль. HTTP здесь
|
||||
разрешён только для локального изолированного стенда с синтетическими данными;
|
||||
для удалённой демонстрации нужен TLS.
|
||||
|
||||
Токен сессии уже случайный и имеет высокую энтропию. SHA-256 нужен для компактного
|
||||
поиска такого секрета и отказа от хранения его исходного значения. Быстрый SHA-256
|
||||
подходит здесь, но не был бы достаточным password KDF. Третий случай — checksum
|
||||
миграции или резервной копии: он обнаруживает изменение байтов, а не подтверждает
|
||||
личность и не восстанавливает потерянные данные.
|
||||
|
||||
## Индекс истории и исследование
|
||||
|
||||
Запрос истории фильтрует один чат и границу `(created_at,id)`, сортирует в том же
|
||||
порядке и берёт `limit+1`. Индекс `messages_history_idx(chat_id,created_at,id)`
|
||||
соответствует фильтру и порядку, позволяя читать небольшую нужную часть индекса.
|
||||
Индекс только по `chat_id` находит чат, но для большой истории может потребовать
|
||||
прочитать много строк и выполнить сортировку перед LIMIT.
|
||||
|
||||
`EXPLAIN (ANALYZE, BUFFERS)` показывает фактический план, время и обращения к
|
||||
буферам; сам ANALYZE исполняет запрос. На защите нужно показать реальные raw-планы
|
||||
и условия прогрева. SQL execution time не равен HTTP latency: в HTTP добавляются
|
||||
сессия, ACL, сеть, пул и сериализация.
|
||||
|
||||
Дополнительный индекс расходует место и увеличивает работу INSERT/WAL. Исследование
|
||||
должно сравнивать чтение и запись при нескольких повторах, а не только красивый
|
||||
одиночный SELECT. Неравномерные размеры чатов важны: план для маленького чата
|
||||
не объясняет цену глубокой страницы в крупном.
|
||||
|
||||
Пул ограничен восемью соединениями, ожидание — 2 секунды, connect timeout — 2 секунды,
|
||||
statement timeout — 2500 мс, lock timeout — 1500 мс. Это отдельные бюджеты разных
|
||||
этапов, а не обещание общего SLA каждого HTTP-запроса. Список чатов сейчас использует
|
||||
дополнительные запросы за участниками каждого результата; это предел эффективности,
|
||||
который можно улучшить пакетной выборкой при росте нагрузки.
|
||||
|
||||
## Команды демонстрации
|
||||
|
||||
Из корня независимого репозитория:
|
||||
|
||||
```sh
|
||||
uv sync --locked --python 3.12
|
||||
make bootstrap
|
||||
make check validate PYTHON=.venv/bin/python
|
||||
VCS_REF=$(git rev-parse HEAD) make up
|
||||
make migrate
|
||||
make test
|
||||
make student-test
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
```
|
||||
|
||||
`make bootstrap` сохраняет существующие secret-файлы. Их нельзя пересоздавать
|
||||
с новым паролем поверх уже инициализированного volume: пароль БД от этого не меняется.
|
||||
Повтор миграций должен пройти без повторного создания таблиц.
|
||||
|
||||
Persistence-сценарий создаёт данные, держит Bearer только в памяти, перезапускает
|
||||
API, PostgreSQL и Valkey с сохранением volume и читает данные прежним токеном.
|
||||
Новый login после restart не доказывал бы сохранение сессии. Дополнительно сравниваются
|
||||
фактические StartedAt/PID контейнеров до и после. Команды исследований и отдельной
|
||||
проверки expiry с коротким TTL приведены в соответствующих инструкциях и отчёте.
|
||||
|
||||
Для трека 5 следуйте `research/README.md`: исследовательская БД отделена от рабочей,
|
||||
backup восстанавливается в новую БД. Сверяются число записей и выбранные сообщения.
|
||||
Время восстановления зависит от размера, машины и способа backup. Снимок не
|
||||
содержит записи, подтверждённые после его границы; непрерывного архивирования WAL
|
||||
и автоматического point-in-time recovery в этом стенде нет.
|
||||
|
||||
Безопасная остановка:
|
||||
|
||||
```sh
|
||||
make down
|
||||
```
|
||||
|
||||
Она сохраняет volume PostgreSQL. `docker compose down --volumes` — отдельное
|
||||
намеренное удаление учебных данных; для обычной остановки эта команда не нужна.
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
FROM python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b AS build
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python
|
||||
|
||||
FROM python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
ARG VCS_REF=uncommitted
|
||||
LABEL org.opencontainers.image.revision=$VCS_REF
|
||||
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/app/src PATH=/app/.venv/bin:$PATH
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/.venv /app/.venv
|
||||
COPY src ./src
|
||||
COPY migrations ./migrations
|
||||
USER 10001:10001
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=3s --timeout=2s --start-period=5s --retries=5 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=1)"]
|
||||
CMD ["python", "-m", "messenger"]
|
||||
@@ -24,3 +24,27 @@ load:
|
||||
test-persistence:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
# Student commands; original acceptance targets above are preserved.
|
||||
PUBLIC_PORT ?= 8082
|
||||
BASE_URL = http://127.0.0.1:$(PUBLIC_PORT)
|
||||
|
||||
bootstrap:
|
||||
python3 scripts/bootstrap.py
|
||||
|
||||
up: bootstrap
|
||||
VCS_REF=$$(git rev-parse HEAD) docker compose up -d --build --wait
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
migrate:
|
||||
docker compose run --rm migrate
|
||||
|
||||
lint:
|
||||
uv run --locked ruff check src student-tests research
|
||||
|
||||
student-test test-student:
|
||||
BASE_URL=$(BASE_URL) uv run --locked pytest -q
|
||||
|
||||
.PHONY: up down image lint student-test test-student bootstrap migrate
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Сдача ЛР2
|
||||
|
||||
Васильев Никита, БВТ2301. Целевая оценка5.
|
||||
|
||||
- [Публичный fork](https://gitea.privcloud.tech/NikiPshg/mtusi2026lab2).
|
||||
- [Открытый МР](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2/pulls/137): **ЛР 2 — БВТ2301 — Васильев — на 5**.
|
||||
- Источник: собственная `solution/bvt2301-vasilev`, цель: преподавательская `master`.
|
||||
- МР не слит; проверку и принятие выполняет преподаватель.
|
||||
- Runtime совпадает с версией независимой чистой проверки; после неё менялись только документы/evidence.
|
||||
- SHA отправленной ветки проверяется отдельно через remote refs и свежий анонимный clone.
|
||||
|
||||
CI ожидает одобрения преподавателя; это не ошибка локальных тестов.
|
||||
@@ -1,37 +1,172 @@
|
||||
# Отчёт — лабораторная 2
|
||||
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
Автор: **Васильев Никита, БВТ2301**. Целевая оценка: **5**.
|
||||
|
||||
Подтверждённый профиль: `NikiPshg`. Создан собственный публичный [fork](https://gitea.privcloud.tech/NikiPshg/mtusi2026lab2).
|
||||
Работа опубликована: [МР ЛР2](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2/pulls/137) открыт в исходный проект преподавателя.
|
||||
Исходная ветка `solution/bvt2301-vasilev`, целевая `master`.
|
||||
Ветка: `solution/bvt2301-vasilev`. Автор коммитов: `n.a.vasilev@edu.mtuci.ru`.
|
||||
Исходные README, COURSE, CONTRIBUTING, contracts и публичные tests сохранены.
|
||||
|
||||
Помощь ИИ использована при разборе требований, подготовке реализации, тестов и
|
||||
материалов защиты. Все заявленные результаты подтверждаются реальными запусками;
|
||||
чужие реализации, история и результаты измерений не использованы как собственные.
|
||||
|
||||
Выбран трек2: **план запроса и восстановление**.
|
||||
Исходный проект: [задание преподавателя](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2)
|
||||
Название будущего МР: **ЛР 2 — БВТ2301 — Васильев — на 5**.
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
Нужны Docker с Compose, Git, uv и Python3.12. Все зависимости закреплены uv.lock.
|
||||
Runtime Python3.12.13, FastAPI0.162.0, Pydantic2.14.2, Uvicorn0.54.0;
|
||||
PostgreSQL17.10-alpine и Valkey8.1.3-alpine. Dockerfile использует digest Python.
|
||||
|
||||
## Архитектура и решения
|
||||
```sh
|
||||
uv sync --locked --python 3.12
|
||||
make up
|
||||
make check validate PYTHON=.venv/bin/python
|
||||
make lint test-student
|
||||
make test
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
```
|
||||
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab1, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
`make up` вызывает bootstrap, собирает образ с OCI revision, поднимает PostgreSQL
|
||||
и Valkey, выполняет миграции отдельным сервисом, ждёт healthy API.
|
||||
API: http://127.0.0.1:8082. Обычный Compose не публикует порты PostgreSQL/Valkey.
|
||||
|
||||
Полная проверка короткого TTL и реальных отказов:
|
||||
|
||||
```sh
|
||||
VCS_REF=$(git rev-parse HEAD) docker compose -f compose.yaml -f compose.test.yaml up -d --build --wait
|
||||
python3 scripts/verify_lifecycle.py --output evidence/lifecycle-repeat.json
|
||||
python3 scripts/verify_pool.py --output evidence/pool-repeat.json
|
||||
uv run --locked python research/run.py --output evidence/query-study-repeat.json
|
||||
uv run --locked python research/analyze.py evidence/query-study-repeat.json
|
||||
```
|
||||
|
||||
Test override добавляет только отдельную API на127.0.0.1:18082 с TTL 2 s. Обычный
|
||||
TTL 3600 s, для public persistence не меньше300s. Эксперименты отказов запускать
|
||||
последовательно. Каждому повтору нужен новый evidence-файл.
|
||||
|
||||
Остановка с сохранением данных: `docker compose -f compose.yaml -f compose.test.yaml down`.
|
||||
Намеренное удаление **только данных этой учебной ЛР2**: та же команда с `--volumes`;
|
||||
она необратимо удаляет пользователей, сообщения и сессии. Обычная остановка volumes
|
||||
не удаляет. Не используйте глобальную очистку Docker.
|
||||
|
||||
### Настройки и секреты
|
||||
|
||||
`scripts/bootstrap.py` создаёт secrets один раз и сохраняет существующие значения.
|
||||
`.env.example` исходный, переменные сопоставлены так: `APP_HOST/APP_PORT` читаются
|
||||
сервером; `APP_ENV` зарезервирован; `SESSION_TTL_SECONDS` — срок сессии;
|
||||
`DATABASE_URL_FILE` и `CACHE_URL_FILE` — файлы URL подключений; `SESSION_STORE`
|
||||
в этой реализации фиксирован PostgreSQL. Созданный `.env` содержит только PUBLIC_PORT
|
||||
и TTL. Для другого порта задайте PUBLIC_PORT в окружении и make test PUBLIC_PORT=...
|
||||
|
||||
Secrets каталог имеет host mode0700. Файлы0644 внутри него нужны для переносимых
|
||||
file-backed Compose secret mounts non-root API; в API смонтированы только DB/cache URL,
|
||||
в PostgreSQL только password. Ни значения, ни `.env`, ни volumes не входят в Git,
|
||||
образ и сдаваемый пакет. При сохранённых volumes нельзя генерировать новый пароль
|
||||
вместо старого. Valkey не требует пароля в изолированной внутренней сети; пользователь
|
||||
с доступом к Docker-host считается доверенным. Для удалённого стенда это требует
|
||||
дополнительного hardening и TLS.
|
||||
|
||||
## Архитектура, схема, транзакции
|
||||
|
||||
Клиент → один API → PostgreSQL; Valkey содержит disposable User-карточки с TTL 60 s.
|
||||
Из собственной ЛР1 перенесены маршруты, строгие схемы, ошибки, ACL, cursor и тесты.
|
||||
In-memory adapter заменён на `src/messenger/postgres.py`; добавлены password и сессии.
|
||||
Оригинальные contracts/tests ЛР2 сохранены. Проект не зависит от соседней lab1.
|
||||
|
||||
Схема и границы были описаны до SQL: [SCHEMA.md](SCHEMA.md).
|
||||
Миграция: [001_initial.sql](migrations/001_initial.sql). PK/FK/UNIQUE защищают
|
||||
users/chats/members/messages/sessions. Составной FK сообщения требует реального
|
||||
участника чата. Порядок member_ids сохраняется через position. Создание чата и
|
||||
всех membership — одна транзакция; неизвестный участник откатывает всё.
|
||||
Миграции выполняются под advisory lock, сохраняют checksum и при изменении
|
||||
применённого файла завершаются ошибкой. Повторный запуск идемпотентен.
|
||||
|
||||
Все значения SQL параметризованы. Пул1..8 соединений, очередь≤32, ожидание2s,
|
||||
connect2s, statement2.5s, lock1.5s; исчерпание и недоступность дают503.
|
||||
История использует `(chat_id,created_at,id)` и keyset, без OFFSET.
|
||||
Чтения autocommit, составные записи в явной транзакции.
|
||||
|
||||
Пароли12..128 Unicode code points, без усечения, Argon2id time_cost=2,
|
||||
memory_cost=65536 KiB, parallelism=1, максимум2 KDF одновременно. Basic разбирается
|
||||
как UTF-8 по первому двоеточию, только при создании сессии; тело входа игнорируется.
|
||||
Opaque token —32 случайных байта; PostgreSQL хранит SHA-256 token и абсолютный expiry.
|
||||
Каждый защищённый запрос сначала читает сессию из PostgreSQL, затем карточку из
|
||||
Valkey или PostgreSQL. Logout удаляет сессию из источника истины. Кэш не может
|
||||
воскресить её после logout/expiry и не разрешает авторизацию при отказе PostgreSQL.
|
||||
Карточки User неизменяемы в обязательном API; поэтому не требуется инвалидация,
|
||||
TTL/eviction/flush/restart безопасны. История не кэшируется и не бывает stale.
|
||||
|
||||
## Доказательства критериев
|
||||
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
| Критерий README | Реализация / команда | Наблюдение / evidence |
|
||||
|---|---|---|
|
||||
| Сохранённый API с новой идентификацией | make test | [smoke-final.txt](evidence/smoke-final.txt) |
|
||||
| PG users/chats/members/messages, FK/UNIQUE, атомарность | migrations; test_chat_validation_and_atomicity | [tests-final.txt](evidence/tests-final.txt), [lifecycle.json](evidence/lifecycle.json) |
|
||||
| Basic/Bearer, password KDF, TTL/logout, X-User-Id игнорируется | test_sessions.py; verify_lifecycle.py | [tests-final.txt](evidence/tests-final.txt), [lifecycle.json](evidence/lifecycle.json) |
|
||||
| Перезапуск API+PG+cache с тем же токеном | public persistence и actual CID/PID/StartedAt | [lifecycle.json](evidence/lifecycle.json) |
|
||||
| Повтор миграций, secrets вне Git | verify_lifecycle.py; bootstrap; audit | [lifecycle.json](evidence/lifecycle.json), [audit.json](evidence/audit.json) |
|
||||
| Valkey реально кэширует, TTL/flush/failure | DBSIZE→flush→repopulate, stop cache | [lifecycle.json](evidence/lifecycle.json) |
|
||||
| SQL/pool/timeouts, гонка username, rollback | собственные HTTP-тесты; verify_pool.py | [tests-final.txt](evidence/tests-final.txt), [pool.json](evidence/pool.json) |
|
||||
| Индекс и EXPLAIN≥10000 | реальный dataset100000 | [query-study-final.json](evidence/query-study-final.json) |
|
||||
| Автоматические expiry/logout/wrong password/отказы | короткий TTL 2 s, рестарт short API, stopPG/cache | [lifecycle.json](evidence/lifecycle.json) |
|
||||
| Трек5:100k/skew/2индекса/запись/backup/restore | research/run.py | [Методика](research/README.md), [raw](evidence/query-study-final.json), [график](evidence/query-study-final.svg) |
|
||||
| Чистый независимый clone | новый project/secrets/volume | [clean-clone.json](evidence/clean-clone.json) |
|
||||
| Структура, OpenAPI, lint | make check validate lint | [contract-final.txt](evidence/contract-final.txt) |
|
||||
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
## Исследование и отказы
|
||||
|
||||
## Эксперименты и отказы
|
||||
100000 сообщений, размеры чатов80000/15000/8×625. Сравниваются индекс chat_id
|
||||
и индекс(chat_id,created_at,id), одинаковый запрос глубокой страницы,5 прогревов,
|
||||
3фазы на индекс и7 EXPLAIN на фазу. Измерены insertion5000+COMMIT, размер и WAL.
|
||||
Порядок A/B, B/A, A/B уменьшает дрейф. Все EXPLAIN ANALYZE BUFFERS сохранены.
|
||||
Числа приведены в [итоге исследования](evidence/query-study-final-summary.md).
|
||||
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
Реальный pg_dump-Fc восстановлен в новую БД; совпали counts всех5таблиц,
|
||||
20полных сообщений и checksum всех100000. Исследовательские БД удаляются finally;
|
||||
рабочая messenger не очищается. При реальном stopPG старый token получает503,
|
||||
после восстановления снова действует. При stopcache корректный fallback сохраняет
|
||||
доступ, а анонимный запрос остаётся401. Повторный logout/expiry —401.
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
| --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
SQL latency не равна HTTP latency. WAL общий для кластера; короткие3серии записи
|
||||
не доказывают небольшое ускорение/замедление. Прогретый локальный restore не включает
|
||||
доставку копии или замену hardware. Backup отражает снимок; изменения после него
|
||||
потеряются без PITR. Одна БД, одинhost и отсутствие TLS остаются ограничениями.
|
||||
Список чатов содержит дополнительные SQL-запросы для member_ids (N+1 до100чатов);
|
||||
это ограничивает масштабирование, но не корректность. Старые истёкшие сессии могут
|
||||
оставаться в таблице до операторской уборки, хотя авторизоваться ими нельзя.
|
||||
|
||||
## Ограничения и следующие шаги
|
||||
## Ответы на вопросы защиты
|
||||
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
1. **COMMIT:** транзакция становится видимой целиком. fsync=on,
|
||||
synchronous_commit=on и full_page_writes=on обеспечивают запись WAL по настройкам
|
||||
PostgreSQL; volume сохраняет данные при рестарте, но не при потере единственного диска.
|
||||
2. **Сессии:** digest и expiry находятся в PostgreSQL. Flush/restart Valkey теряет
|
||||
только кэш публичных карточек; срок сессии не продлевается и logout не отменяется.
|
||||
3. **Аутентификация/ACL:** Bearer определяет пользователя, membership разрешает
|
||||
конкретный чат. Даже действующий token постороннего получает404.
|
||||
4. **Пароль/checksum:** пароль низкоэнтропийный, нужен дорогой salted KDF;
|
||||
случайный256-битный token имеет другую модель, SHA-256 используется для его поиска
|
||||
без хранения оригинального секрета. SHA не подходит вместо Argon2id для паролей.
|
||||
|
||||
Подробный конспект: [DEFENSE.md](DEFENSE.md).
|
||||
Источники: исходный контракт, [PostgreSQL](https://www.postgresql.org/docs/17/),
|
||||
[psycopg](https://www.psycopg.org/psycopg3/docs/),
|
||||
[Argon2](https://argon2-cffi.readthedocs.io/), [Valkey](https://valkey.io/topics/).
|
||||
|
||||
## Проверенная версия и итог
|
||||
|
||||
Независимый чистый clone проверен на `35764f730c90f9797925313875be0a484c13dcff`.
|
||||
Хеши runtime-модулей в контейнере совпали с исходниками. После этой проверки
|
||||
runtime-код не изменялся; финальные коммиты добавляют только отчёт и evidence.
|
||||
Локальные проверки выполнены. Статус публикации фиксируется в начале отчёта;
|
||||
удалённый CI отдельно не подтверждён.
|
||||
Собственные HTTP-тесты: **61 passed**, без пропусков.
|
||||
Публичный smoke, структура, OpenAPI, lint и существенные отказы прошли.
|
||||
|
||||
Статус удалённого CI при создании МР: workflow ожидает одобрения владельца исходного
|
||||
репозитория (approval required). Локальные проверки завершены успешно.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Модель хранения до реализации запросов
|
||||
|
||||
Источник истины — PostgreSQL. Таблицы: users (UUID PK, UNIQUE username, hash пароля),
|
||||
chats (UUID PK), members (PK chat_id/user_id, FK на chat и user, position),
|
||||
messages (UUID PK; FK (chat_id,sender_id) на members), sessions (digest PK,
|
||||
FK user_id, абсолютный expires_at), schema_migrations (имя и SHA-256).
|
||||
|
||||
Создание чата и всех участников — одна транзакция. Регистрация опирается на UNIQUE,
|
||||
а не на небезопасную предварительную проверку. Вход сохраняет только digest
|
||||
случайного токена; logout удаляет эту запись. Авторизация всегда читает PostgreSQL.
|
||||
Valkey хранит только неизменяемую публичную карточку User на 60 секунд.
|
||||
Кэш не содержит сессий или истории; его потеря обходится чтением PostgreSQL.
|
||||
|
||||
История: WHERE chat_id=? AND (created_at,id)>(?,?) ORDER BY created_at,id LIMIT ?.
|
||||
Индекс messages_history_idx(chat_id,created_at,id) обеспечивает keyset-пагинацию.
|
||||
Транзакции составных записей явные; одиночные чтения используют autocommit.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Подготовка к сдаче ЛР2
|
||||
|
||||
Название МР: **ЛР 2 — БВТ2301 — Васильев — на 5**.
|
||||
Автор: Васильев Никита, БВТ2301. Ветка: `solution/bvt2301-vasilev`.
|
||||
Площадка: Gitea.
|
||||
[Исходный проект](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2), базовая ветка `master`.
|
||||
|
||||
Работа опубликована в собственный публичный [fork](https://gitea.privcloud.tech/NikiPshg/mtusi2026lab2).
|
||||
[МР](https://gitea.privcloud.tech/mtusi2026/mtusi2026lab2/pulls/137) создан и открыт в исходный проект преподавателя.
|
||||
Ветки source/target и название проверены; МР не слит.
|
||||
|
||||
Описание МР: содержимое [.github/pull_request_template.md](.github/pull_request_template.md)
|
||||
с действительной ссылкой на [REPORT.md](REPORT.md).
|
||||
Публичность и source/target подтверждены; окончательные remote SHA фиксируются
|
||||
в отдельной квитанции публикации.
|
||||
МР за преподавателя не сливается. Удалённый CI не считается выполненным
|
||||
по одним локальным результатам.
|
||||
@@ -0,0 +1,8 @@
|
||||
services:
|
||||
api-short:
|
||||
extends:
|
||||
file: compose.yaml
|
||||
service: api
|
||||
environment:
|
||||
SESSION_TTL_SECONDS: "2"
|
||||
ports: !override ["127.0.0.1:${SHORT_PORT:-18082}:8080"]
|
||||
@@ -0,0 +1,66 @@
|
||||
name: mtusi-vasilev-lab2
|
||||
x-application: &application
|
||||
image: ${API_IMAGE:-mtusi-vasilev:lab2}
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
VCS_REF: ${VCS_REF:-uncommitted}
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
CACHE_URL_FILE: /run/secrets/cache_url
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
secrets: [database_url, cache_url]
|
||||
cpus: 1
|
||||
mem_limit: 512m
|
||||
pids_limit: 96
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:size=16m,noexec,nosuid"]
|
||||
cap_drop: [ALL]
|
||||
security_opt: [no-new-privileges:true]
|
||||
stop_grace_period: 8s
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17.10-alpine
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
secrets: [postgres_password]
|
||||
volumes: [postgres_data:/var/lib/postgresql/data]
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, "pg_isready -U messenger -d messenger"]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 15
|
||||
cpus: 1
|
||||
mem_limit: 768m
|
||||
command: [postgres, -c, fsync=on, -c, synchronous_commit=on, -c, full_page_writes=on]
|
||||
cache:
|
||||
image: valkey/valkey:8.1.3-alpine
|
||||
command: [valkey-server, --save, "", --appendonly, "no", --maxmemory, 64mb, --maxmemory-policy, allkeys-lru]
|
||||
healthcheck:
|
||||
test: [CMD, valkey-cli, ping]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 15
|
||||
cpus: 0.5
|
||||
mem_limit: 128m
|
||||
migrate:
|
||||
<<: *application
|
||||
command: [python, -m, messenger.migrate]
|
||||
healthcheck:
|
||||
disable: true
|
||||
depends_on:
|
||||
postgres: {condition: service_healthy}
|
||||
api:
|
||||
<<: *application
|
||||
ports: ["127.0.0.1:${PUBLIC_PORT:-8082}:8080"]
|
||||
depends_on:
|
||||
migrate: {condition: service_completed_successfully}
|
||||
cache: {condition: service_healthy}
|
||||
volumes:
|
||||
postgres_data:
|
||||
secrets:
|
||||
postgres_password: {file: ./secrets/postgres_password}
|
||||
database_url: {file: ./secrets/database_url}
|
||||
cache_url: {file: ./secrets/cache_url}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"passed": true,
|
||||
"candidate_files": 80,
|
||||
"reachable_objects": 109,
|
||||
"required_source_files": {
|
||||
"README.md": "unchanged",
|
||||
"COURSE.md": "unchanged",
|
||||
"CONTRIBUTING.md": "unchanged",
|
||||
"contracts": "unchanged",
|
||||
"tests": "unchanged"
|
||||
},
|
||||
"known_local_password_checked": true,
|
||||
"scope": "candidate files and all reachable Git objects; no remote publication"
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.23kB done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [migrate internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 941B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [migrate internal] load metadata for ghcr.io/astral-sh/uv:0.11.7
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [api internal] load .dockerignore
|
||||
#5 transferring context: 109B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [api internal] load build context
|
||||
#6 transferring context: 11.64kB done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [migrate build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#7 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [api] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
|
||||
#8 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [migrate build 3/5] WORKDIR /app
|
||||
#9 CACHED
|
||||
|
||||
#10 [migrate build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python
|
||||
#10 CACHED
|
||||
|
||||
#11 [migrate build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv
|
||||
#11 CACHED
|
||||
|
||||
#12 [migrate stage-1 2/5] WORKDIR /app
|
||||
#12 CACHED
|
||||
|
||||
#13 [migrate build 4/5] COPY pyproject.toml uv.lock ./
|
||||
#13 CACHED
|
||||
|
||||
#14 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv
|
||||
#14 CACHED
|
||||
|
||||
#15 [api stage-1 4/5] COPY src ./src
|
||||
#15 DONE 0.0s
|
||||
|
||||
#16 [migrate stage-1 5/5] COPY migrations ./migrations
|
||||
#16 DONE 0.0s
|
||||
|
||||
#17 [api] exporting to image
|
||||
#17 exporting layers 0.0s done
|
||||
#17 exporting manifest sha256:42d0b1c18c4aa8b6a295c492ead287ece57a3187acd7db461d8e848d6330aa25 done
|
||||
#17 exporting config sha256:8449b4652509011c64cb2779c5708c8eb31137f461238e926a636739d5706e1a done
|
||||
#17 exporting attestation manifest sha256:603b58c37312ba725c194aba4b804c8774df018263c58a610a3fe87441801c93
|
||||
#17 exporting attestation manifest sha256:603b58c37312ba725c194aba4b804c8774df018263c58a610a3fe87441801c93 0.0s done
|
||||
#17 exporting manifest list sha256:2ea0407e09abffcf5f1e1905a395fcea97b988085675ab77e805d83758db43cc done
|
||||
#17 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#17 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done
|
||||
#17 DONE 0.1s
|
||||
|
||||
#18 [migrate] exporting to image
|
||||
#18 exporting layers 0.0s done
|
||||
#18 exporting manifest sha256:f93fcbfab9362ac536c54359b4d63fa2b9f1b2c6bbd020f03bbc60b4e71606ba done
|
||||
#18 exporting config sha256:801010193b0453f24d48c97a39d21f5b3f5b104568d4ec2c59c7e3209040654c done
|
||||
#18 exporting attestation manifest sha256:9000fcdcf7fdb3d2f6461b3e7b9fc26ccec4c23915ea2cd80df4fc9492c973fc 0.0s done
|
||||
#18 exporting manifest list sha256:1940fd33577ea36bd5f65c20e9b7ba73f83f347d5bd0565af0e5b5629c8af1b7 done
|
||||
#18 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#18 unpacking to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#18 DONE 0.1s
|
||||
|
||||
#19 [api] resolving provenance for metadata file
|
||||
#19 DONE 0.0s
|
||||
|
||||
#20 [migrate] resolving provenance for metadata file
|
||||
#20 DONE 0.0s
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Container mtusi-vasilev-lab2-postgres-1 Running
|
||||
Container mtusi-vasilev-lab2-cache-1 Running
|
||||
Container mtusi-vasilev-lab2-migrate-1 Recreate
|
||||
Container mtusi-vasilev-lab2-migrate-1 Recreated
|
||||
Container mtusi-vasilev-lab2-api-1 Recreate
|
||||
Container mtusi-vasilev-lab2-api-1 Recreated
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Starting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Started
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-api-1 Starting
|
||||
Container mtusi-vasilev-lab2-api-1 Started
|
||||
Container mtusi-vasilev-lab2-api-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-api-1 Healthy
|
||||
@@ -0,0 +1,135 @@
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.91kB done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [api internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 941B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [api-short internal] load metadata for ghcr.io/astral-sh/uv:0.11.7
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [api-short internal] load .dockerignore
|
||||
#5 transferring context: 109B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [api internal] load build context
|
||||
#6 transferring context: 9.70kB done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [api-short build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#7 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b 0.0s done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [api-short] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
|
||||
#8 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [api stage-1 2/5] WORKDIR /app
|
||||
#9 CACHED
|
||||
|
||||
#10 [api build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python
|
||||
#10 CACHED
|
||||
|
||||
#11 [api build 4/5] COPY pyproject.toml uv.lock ./
|
||||
#11 CACHED
|
||||
|
||||
#12 [api build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv
|
||||
#12 CACHED
|
||||
|
||||
#13 [api build 3/5] WORKDIR /app
|
||||
#13 CACHED
|
||||
|
||||
#14 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv
|
||||
#14 CACHED
|
||||
|
||||
#15 [api-short stage-1 4/5] COPY src ./src
|
||||
#15 DONE 0.0s
|
||||
|
||||
#16 [migrate stage-1 5/5] COPY migrations ./migrations
|
||||
#16 DONE 0.0s
|
||||
|
||||
#17 [api] exporting to image
|
||||
#17 exporting layers 0.1s done
|
||||
#17 exporting manifest sha256:432f1d88a72a81ebe646da23f3af7eb1eb0ca2938d88f24eaae54042ede38952
|
||||
#17 exporting manifest sha256:432f1d88a72a81ebe646da23f3af7eb1eb0ca2938d88f24eaae54042ede38952 done
|
||||
#17 exporting config sha256:1b5cc3ea17af385ea711e8686c39c109a0284e6263a6852a8d94db000b3970d4 done
|
||||
#17 exporting attestation manifest sha256:87135ff983f505b882a8aefcdc2acf64f7e72d35b7c4604f7066cef6893ff64f 0.0s done
|
||||
#17 exporting manifest list sha256:f6e168c1f546b74ac5180bd3aa195e8f4cf5f002c9ae366d16bf7f574c6a09eb 0.0s done
|
||||
#17 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#17 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done
|
||||
#17 DONE 0.1s
|
||||
|
||||
#18 [migrate] exporting to image
|
||||
#18 exporting layers 0.1s done
|
||||
#18 exporting manifest sha256:391536dc94736476a626531cce9d1fd30471f5daa44139f932596d818182cb6e done
|
||||
#18 exporting config sha256:8e63b319ea923b635b77feba2f00aeff8fc6b8d35579d2d7b3ac9c1135e0c3c8 done
|
||||
#18 exporting attestation manifest sha256:7c69a3e54c93e797e961190b37e5f3993adad21d31b3db18a599d0c290344cad 0.0s done
|
||||
#18 exporting manifest list sha256:49dd8cf9ad65fe8ab8934a5a95987674643c3cc9aa9805cabf12e77662bbc291 done
|
||||
#18 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#18 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done
|
||||
#18 DONE 0.1s
|
||||
|
||||
#19 [api-short] exporting to image
|
||||
#19 exporting layers 0.1s done
|
||||
#19 exporting manifest sha256:45021bba21b93e50c897e3d4812790e0b6b674d0f5bd3f423b0847124262fb52 0.0s done
|
||||
#19 exporting config sha256:bbd200e3f66dd1035503f37a73ffd1bb10f73619e0447a512ea6085891f5f496 done
|
||||
#19 exporting attestation manifest sha256:772c450f4673d5d7dc6f4e8c55c92d22c444ae88a3d36c4322a835a142a0ded7 0.0s done
|
||||
#19 exporting manifest list sha256:068b48dec587d6fa1758022fe42da6a2cfb95bb68e56303ef23d0115b0284598 done
|
||||
#19 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#19 unpacking to docker.io/library/mtusi-vasilev:lab2 0.0s done
|
||||
#19 DONE 0.1s
|
||||
|
||||
#20 [migrate] resolving provenance for metadata file
|
||||
#20 DONE 0.0s
|
||||
|
||||
#21 [api] resolving provenance for metadata file
|
||||
#21 DONE 0.0s
|
||||
|
||||
#22 [api-short] resolving provenance for metadata file
|
||||
#22 DONE 0.0s
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Container mtusi-vasilev-lab2-migrate-1 Recreate
|
||||
Container mtusi-vasilev-lab2-migrate-1 Recreated
|
||||
Container mtusi-vasilev-lab2-api-short-1 Creating
|
||||
Container mtusi-vasilev-lab2-api-1 Recreate
|
||||
Container mtusi-vasilev-lab2-api-short-1 Created
|
||||
Container mtusi-vasilev-lab2-api-1 Recreated
|
||||
Container mtusi-vasilev-lab2-postgres-1 Starting
|
||||
Container mtusi-vasilev-lab2-cache-1 Starting
|
||||
Container mtusi-vasilev-lab2-cache-1 Started
|
||||
Container mtusi-vasilev-lab2-postgres-1 Started
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Starting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Started
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-api-short-1 Starting
|
||||
Container mtusi-vasilev-lab2-api-1 Starting
|
||||
Container mtusi-vasilev-lab2-api-1 Started
|
||||
Container mtusi-vasilev-lab2-api-short-1 Started
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-api-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-api-short-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-api-1 Healthy
|
||||
Container mtusi-vasilev-lab2-api-short-1 Healthy
|
||||
@@ -0,0 +1,111 @@
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
Image mtusi-vasilev:lab2 Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.23kB done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [migrate internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 941B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [api internal] load metadata for docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [api internal] load metadata for ghcr.io/astral-sh/uv:0.11.7
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [api internal] load .dockerignore
|
||||
#5 transferring context: 109B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [migrate internal] load build context
|
||||
#6 transferring context: 586B done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [api] FROM ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
|
||||
#7 resolve ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [api build 1/5] FROM docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b
|
||||
#8 resolve docker.io/library/python:3.12-slim@sha256:646fb0bca3dd3ea1bcc6feb72c17ed16eed6e10cffc732fcc1478bd3e7f02d7b done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [api build 2/5] COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv
|
||||
#9 CACHED
|
||||
|
||||
#10 [api build 4/5] COPY pyproject.toml uv.lock ./
|
||||
#10 CACHED
|
||||
|
||||
#11 [api stage-1 4/5] COPY src ./src
|
||||
#11 CACHED
|
||||
|
||||
#12 [api stage-1 2/5] WORKDIR /app
|
||||
#12 CACHED
|
||||
|
||||
#13 [api build 5/5] RUN uv sync --locked --no-dev --no-install-project --python /usr/local/bin/python
|
||||
#13 CACHED
|
||||
|
||||
#14 [api build 3/5] WORKDIR /app
|
||||
#14 CACHED
|
||||
|
||||
#15 [api stage-1 3/5] COPY --from=build /app/.venv /app/.venv
|
||||
#15 CACHED
|
||||
|
||||
#16 [migrate stage-1 5/5] COPY migrations ./migrations
|
||||
#16 CACHED
|
||||
|
||||
#17 [api] exporting to image
|
||||
#17 exporting layers done
|
||||
#17 exporting manifest sha256:a767adf69349b1bb5561480dbf515c392464a1957932c97e1ca1bd0cf159253f done
|
||||
#17 exporting config sha256:ba01ce5652357b766bc456c242e3101eb21bd40d5531376cbcd32fdbfa79d71a done
|
||||
#17 exporting attestation manifest sha256:425e718cd419a7742bd0a810cd660eceab2ce3377d2e5877b4a24dc051816515 0.0s done
|
||||
#17 exporting manifest list sha256:cefafcb7c510133bef6010069951db0afd233005fc01e791ab3fcc59436e717f done
|
||||
#17 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#17 unpacking to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 [migrate] exporting to image
|
||||
#18 exporting layers done
|
||||
#18 exporting manifest sha256:5908354cc99a403d6885ba41971b36feea08217e3a10e8d5172939e8a8db8495 done
|
||||
#18 exporting config sha256:8fbc9f74072452224d88e4ec4aae7d226f608649d38c1125573666ddfe91ebf9 done
|
||||
#18 exporting attestation manifest sha256:1b82bbbfc074915201d8e616d64f87cc7ffdf060e742637775b19026380df44d 0.0s done
|
||||
#18 exporting manifest list sha256:1c9527cd7b80ac00a7d5d43ec865ae759ddb11b275802ff0df97b87b74627073 done
|
||||
#18 naming to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#18 unpacking to docker.io/library/mtusi-vasilev:lab2 done
|
||||
#18 DONE 0.0s
|
||||
|
||||
#19 [api] resolving provenance for metadata file
|
||||
#19 DONE 0.0s
|
||||
|
||||
#20 [migrate] resolving provenance for metadata file
|
||||
#20 DONE 0.0s
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Image mtusi-vasilev:lab2 Built
|
||||
Container mtusi-vasilev-lab2-migrate-1 Creating
|
||||
Container mtusi-vasilev-lab2-cache-1 Recreate
|
||||
Container mtusi-vasilev-lab2-migrate-1 Created
|
||||
Container mtusi-vasilev-lab2-cache-1 Recreated
|
||||
Container mtusi-vasilev-lab2-api-1 Creating
|
||||
Container mtusi-vasilev-lab2-api-1 Created
|
||||
Container mtusi-vasilev-lab2-cache-1 Starting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Starting
|
||||
Container mtusi-vasilev-lab2-cache-1 Started
|
||||
Container mtusi-vasilev-lab2-postgres-1 Started
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Starting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Started
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-api-1 Starting
|
||||
Container mtusi-vasilev-lab2-api-1 Started
|
||||
Container mtusi-vasilev-lab2-api-1 Waiting
|
||||
Container mtusi-vasilev-lab2-postgres-1 Waiting
|
||||
Container mtusi-vasilev-lab2-cache-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Waiting
|
||||
Container mtusi-vasilev-lab2-migrate-1 Exited
|
||||
Container mtusi-vasilev-lab2-cache-1 Healthy
|
||||
Container mtusi-vasilev-lab2-postgres-1 Healthy
|
||||
Container mtusi-vasilev-lab2-api-1 Healthy
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"passed": true,
|
||||
"source_commit": "35764f730c90f9797925313875be0a484c13dcff",
|
||||
"source_hashes": {
|
||||
"messenger/app.py": "d54a8c28491eef19026ab53fb18f66f7fa9ebeeaa3ef7f7d43654fb56a960502",
|
||||
"messenger/migrate.py": "eb5cad7ac6abe38dd40b2db307d298b297abe9543b3928c36bab8ef06283664e",
|
||||
"messenger/models.py": "cf44680f8f39228ffc89910577df70354f8d660a6652d62091007cfe074ccbe2",
|
||||
"messenger/__init__.py": "9a72a49106367ca514cc6147d0e727e62c4d33fefd61572d209a5c9494551a2c",
|
||||
"messenger/postgres.py": "8e224cbab14872a54abb23937b7d290975d4209779897aaa551e5cb952cb8365",
|
||||
"messenger/domain.py": "33086cb229083ecee3bcee09f143b4bc09e48896a0c497bd9902e738e2e6b1af",
|
||||
"messenger/config.py": "e4d4aaf674ede8b5abdc361f77c7793ee94d8d7856030c28834eb7c95291b193",
|
||||
"messenger/__main__.py": "ba9a59ad44ee8884cd65cf88d5ea15cbd7051b10f7c729043ddd44ca2f34defe"
|
||||
},
|
||||
"image_id": "sha256:e3f29f12c4f5abd90e7fc25187ec0be0d30836c964ce4661b35d3adf28a316f1",
|
||||
"image_revision": "35764f730c90f9797925313875be0a484c13dcff",
|
||||
"new_secret_set": true,
|
||||
"isolated_project": "vasilev-clean-lab2",
|
||||
"steps": [
|
||||
{
|
||||
"command": "uv sync --locked --python 3.12",
|
||||
"passed": true,
|
||||
"seconds": 0.061
|
||||
},
|
||||
{
|
||||
"command": "make bootstrap",
|
||||
"passed": true,
|
||||
"seconds": 0.03
|
||||
},
|
||||
{
|
||||
"command": "docker compose -f compose.yaml -f compose.test.yaml up -d --build --wait",
|
||||
"passed": true,
|
||||
"seconds": 9.414
|
||||
},
|
||||
{
|
||||
"command": "uv run --locked python research/run.py --output evidence/query-study-final.json",
|
||||
"passed": true,
|
||||
"seconds": 5.001
|
||||
},
|
||||
{
|
||||
"command": "uv run --locked python research/analyze.py evidence/query-study-final.json",
|
||||
"passed": true,
|
||||
"seconds": 0.037
|
||||
},
|
||||
{
|
||||
"command": "make check validate lint PYTHON=.venv/bin/python",
|
||||
"passed": true,
|
||||
"seconds": 1.373
|
||||
},
|
||||
{
|
||||
"command": "make test PUBLIC_PORT=18092",
|
||||
"passed": true,
|
||||
"seconds": 0.608
|
||||
},
|
||||
{
|
||||
"command": "make test-student PUBLIC_PORT=18092",
|
||||
"passed": true,
|
||||
"seconds": 19.274
|
||||
},
|
||||
{
|
||||
"command": "python3 scripts/verify_lifecycle.py --base-url http://127.0.0.1:18092 --short-url http://127.0.0.1:28092 --output evidence/lifecycle-clean.json",
|
||||
"passed": true,
|
||||
"seconds": 15.829
|
||||
},
|
||||
{
|
||||
"command": "python3 scripts/verify_pool.py --output evidence/pool-clean.json",
|
||||
"passed": true,
|
||||
"seconds": 3.052
|
||||
}
|
||||
],
|
||||
"runtime_unchanged_after_tested_source": true
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
.venv/bin/python scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
uv run --locked ruff check src student-tests research
|
||||
All checks passed!
|
||||
@@ -0,0 +1,4 @@
|
||||
.venv/bin/python scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"date_utc": "2026-10-30T14:32:25.833684+00:00",
|
||||
"passed": true,
|
||||
"public_persistence": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.",
|
||||
"before": {
|
||||
"api": {
|
||||
"cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2",
|
||||
"pid": 29220,
|
||||
"started_at": "2026-10-30T14:31:53.619517906Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5",
|
||||
"pid": 28778,
|
||||
"started_at": "2026-10-30T14:31:50.484820839Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0",
|
||||
"pid": 28777,
|
||||
"started_at": "2026-10-30T14:31:50.485089224Z"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api": {
|
||||
"cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2",
|
||||
"pid": 32006,
|
||||
"started_at": "2026-10-30T14:32:27.197264989Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5",
|
||||
"pid": 31862,
|
||||
"started_at": "2026-10-30T14:32:27.001543385Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0",
|
||||
"pid": 31777,
|
||||
"started_at": "2026-10-30T14:32:26.935843635Z"
|
||||
}
|
||||
},
|
||||
"same_token_and_message_after_restart": true,
|
||||
"cache_flush_repopulates": true,
|
||||
"cache_failure": {
|
||||
"authenticated_status": 200,
|
||||
"anonymous_status": 401,
|
||||
"seconds": 0.0051
|
||||
},
|
||||
"database_failure": {
|
||||
"cached_actor_status": 503,
|
||||
"ready_status": 503,
|
||||
"live_status": 200,
|
||||
"seconds": 2.0111
|
||||
},
|
||||
"session_after_database_recovery": true,
|
||||
"failed_chat_transaction_left_rows": 0,
|
||||
"migrations_reapplied_twice": true,
|
||||
"expiry": {
|
||||
"configured_ttl_seconds": 2,
|
||||
"observed_after_seconds": 2.4192,
|
||||
"expired_status": 401,
|
||||
"short_api_restarted_before_check": true
|
||||
},
|
||||
"logout_with_cached_user": 401,
|
||||
"credentials_absent_from_api_logs": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
PASS: real restart, same token, cache/DB faults, rollback, expiry and logout
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"date_utc": "2026-10-30T14:29:20.955064+00:00",
|
||||
"passed": true,
|
||||
"public_persistence": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.",
|
||||
"before": {
|
||||
"api": {
|
||||
"cid": "1a09782c5a2e1415b9d658444fc0336bb5eda6ad0660e36cf84659fd2bbb7594",
|
||||
"pid": 19077,
|
||||
"started_at": "2026-10-30T14:28:23.635694089Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "12a042ef8a5ab3098d941461b5971c7521ecd7a0838b1f1eb2f2319a8587313b",
|
||||
"pid": 18807,
|
||||
"started_at": "2026-10-30T14:28:20.486422322Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "3e542fd46e4ff3e93f51a47a2de728ef0d5d9146373671ae461aa82e81ed28bb",
|
||||
"pid": 18806,
|
||||
"started_at": "2026-10-30T14:28:20.486758282Z"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api": {
|
||||
"cid": "1a09782c5a2e1415b9d658444fc0336bb5eda6ad0660e36cf84659fd2bbb7594",
|
||||
"pid": 21859,
|
||||
"started_at": "2026-10-30T14:29:22.238596408Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "12a042ef8a5ab3098d941461b5971c7521ecd7a0838b1f1eb2f2319a8587313b",
|
||||
"pid": 21728,
|
||||
"started_at": "2026-10-30T14:29:22.040913407Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "3e542fd46e4ff3e93f51a47a2de728ef0d5d9146373671ae461aa82e81ed28bb",
|
||||
"pid": 21673,
|
||||
"started_at": "2026-10-30T14:29:22.004637237Z"
|
||||
}
|
||||
},
|
||||
"same_token_and_message_after_restart": true,
|
||||
"cache_flush_repopulates": true,
|
||||
"cache_failure": {
|
||||
"authenticated_status": 200,
|
||||
"anonymous_status": 401,
|
||||
"seconds": 0.0427
|
||||
},
|
||||
"database_failure": {
|
||||
"cached_actor_status": 503,
|
||||
"ready_status": 503,
|
||||
"live_status": 200,
|
||||
"seconds": 2.0018
|
||||
},
|
||||
"session_after_database_recovery": true,
|
||||
"failed_chat_transaction_left_rows": 0,
|
||||
"migrations_reapplied_twice": true,
|
||||
"expiry": {
|
||||
"configured_ttl_seconds": 2,
|
||||
"observed_after_seconds": 2.3825,
|
||||
"expired_status": 401,
|
||||
"short_api_restarted_before_check": true
|
||||
},
|
||||
"logout_with_cached_user": 401,
|
||||
"credentials_absent_from_api_logs": true
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"passed": true,
|
||||
"clients": 50,
|
||||
"max_pool_size": 8,
|
||||
"max_waiting": 32,
|
||||
"admitted": 8,
|
||||
"rejected_503": 42,
|
||||
"max_seconds": 2.225532210955862,
|
||||
"rows": [
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0021635820157826
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.4174031093716621e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020112140337005
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 4.960980731993914e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019857849692926
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.729995710775256e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0002509180339985
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002100343001075
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020874189794995
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020374360028654
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.0297051630914211e-05
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2069947799900547
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2116657389560714
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.218611836025957
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.211599581001792
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2174383330275305
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.5440316423773766e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002133609028533
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019869100069627
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020533190108836
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002086877997499
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002052652009297
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019422639743425
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002054319018498
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019010339747183
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022103139781393
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0021815079962835
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0008202450117096
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002282141998876
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022370780352503
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022053119610064
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022150659933686
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022375360131264
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022462070337497
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.046796726062894e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.2798001989722252e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002062240964733
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.222286756034009
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.225532210955862
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.503957021981478e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 8.045986760407686e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.0440278351306915e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.921014912426472e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 5.376990884542465e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.7510104700922966e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.003021892160177e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.421011105179787e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.0850060284137726e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.6259804144501686e-06
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2048024350078776
|
||||
}
|
||||
],
|
||||
"date_utc": "2026-10-30T14:32:44.301114+00:00"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
PASS: real bounded connection pool overload returns 503
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"passed": true,
|
||||
"clients": 50,
|
||||
"max_pool_size": 8,
|
||||
"max_waiting": 32,
|
||||
"admitted": 8,
|
||||
"rejected_503": 42,
|
||||
"max_seconds": 2.226985312998295,
|
||||
"rows": [
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0008593890233897
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 9.08802030608058e-06
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2165114110102877
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.226985312998295
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.3715005479753017e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0015193020226434
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.001966067997273
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 8.628994692116976e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0018118239822797
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.668013960123062e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 8.004019036889076e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.001962565991562
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002134026028216
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.001673088001553
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002291854994837
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002486660028808
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.00323870300781
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.001060738984961
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0012402459979057
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.959983587265015e-06
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2083417040412314
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.214471307990607
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2163876409758814
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.001500209036749
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0021683349623345
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0028698940295726
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.960034180432558e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.709981683641672e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020870030275546
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.00253055797657
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0026431559817865
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0026960149989463
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002982742036693
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002759379975032
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.504015229642391e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.668013960123062e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.001012373715639e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022876450093463
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.001012373715639e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0025205940473825
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.2798001989722252e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 5.378038622438908e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.496501499786973e-05
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.222472182009369
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.222849245008547
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002373645955231
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 5.418958608061075e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.003417416999582
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.627035766839981e-06
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2056722860434093
|
||||
}
|
||||
],
|
||||
"date_utc": "2026-10-30T14:29:39.194790+00:00"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Итог исследования ЛР2: план запроса и восстановление
|
||||
|
||||
Источник: [неизменённые raw-данные](query-study-final.json).
|
||||
Измерено из чистого clone `35764f730c90f9797925313875be0a484c13dcff`, рабочий каталог в начале опыта чистый.
|
||||
|
||||
| Метрика | Индекс chat_id | Индекс (chat_id,created_at,id) |
|
||||
|---|---:|---:|
|
||||
| Медиана SQL, мс | 3.215 | 0.013 |
|
||||
| Размер индекса, bytes | 720,896 | 5,914,624 |
|
||||
| Медиана INSERT 5000 + COMMIT, с | 0.06902 | 0.03764 |
|
||||
| Медиана прироста WAL для 5000 записей, bytes | 1,408,792 | 1,776,184 |
|
||||
|
||||
На выбранной глубокой странице составной индекс сокращает SQL-время примерно
|
||||
в 247.3 раза, ценой большего индекса
|
||||
и WAL в этой серии. Это сравнение прогретого SQL, а не HTTP API.
|
||||
Более короткое время вставки в трёх опытах не доказывает общего ускорения записи:
|
||||
кэш, checkpoint, порядок измерений и короткая длительность влияют на результат.
|
||||
|
||||
Backup `pg_dump -Fc`: 3,003,381 bytes, 0.248 с.
|
||||
Restore `pg_restore` в новую БД: 0.401 с.
|
||||
Совпали количества всех пяти таблиц, 20 выбранных полных сообщений и checksum
|
||||
всех 100 000 сообщений. Обе созданные исследовательские БД удалены.
|
||||
|
||||
Backup — снимок; изменения после него не входят в восстановление. Без WAL-архивации
|
||||
и PITR нельзя обещать нулевую потерю данных. Время не включает доставку backup,
|
||||
замену сервера и переключение клиентов. Подробная [методика](../research/README.md).
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="610" viewBox="0 0 900 610">
|
||||
<rect width="900" height="610" fill="white"/>
|
||||
<g font-family="sans-serif" font-size="15" fill="#172033">
|
||||
<text x="30" y="30" font-size="21">100 000 messages: warm PostgreSQL comparison</text>
|
||||
<text x="30" y="65">SQL median, ms</text>
|
||||
<text x="30" y="99">chat_only</text>
|
||||
<rect x="140" y="80" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="98">3.215</text>
|
||||
<text x="30" y="132">composite</text>
|
||||
<rect x="140" y="113" width="2.14" height="24" fill="#346dc4"/>
|
||||
<text x="152.14" y="131">0.013</text>
|
||||
<text x="30" y="195">INSERT 5000 + COMMIT, s</text>
|
||||
<text x="30" y="229">chat_only</text>
|
||||
<rect x="140" y="210" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="228">0.0690227</text>
|
||||
<text x="30" y="262">composite</text>
|
||||
<rect x="140" y="243" width="289.04" height="24" fill="#346dc4"/>
|
||||
<text x="439.04" y="261">0.0376425</text>
|
||||
<text x="30" y="325">Index size, bytes</text>
|
||||
<text x="30" y="359">chat_only</text>
|
||||
<rect x="140" y="340" width="64.60" height="24" fill="#d68439"/>
|
||||
<text x="214.60" y="358">720896</text>
|
||||
<text x="30" y="392">composite</text>
|
||||
<rect x="140" y="373" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="391">5.91462e+06</text>
|
||||
<text x="30" y="455">WAL for INSERT 5000, bytes</text>
|
||||
<text x="30" y="489">chat_only</text>
|
||||
<rect x="140" y="470" width="420.37" height="24" fill="#d68439"/>
|
||||
<text x="570.37" y="488">1.40879e+06</text>
|
||||
<text x="30" y="522">composite</text>
|
||||
<rect x="140" y="503" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="521">1.77618e+06</text>
|
||||
<text x="30" y="595">3 phases/index; 7 reads/phase; same data and limits. SQL time is not HTTP time.</text>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="610" viewBox="0 0 900 610">
|
||||
<rect width="900" height="610" fill="white"/>
|
||||
<g font-family="sans-serif" font-size="15" fill="#172033">
|
||||
<text x="30" y="30" font-size="21">100 000 messages: warm PostgreSQL comparison</text>
|
||||
<text x="30" y="65">SQL median, ms</text>
|
||||
<text x="30" y="99">chat_only</text>
|
||||
<rect x="140" y="80" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="98">3.433</text>
|
||||
<text x="30" y="132">composite</text>
|
||||
<rect x="140" y="113" width="2.01" height="24" fill="#346dc4"/>
|
||||
<text x="152.01" y="131">0.013</text>
|
||||
<text x="30" y="195">INSERT 5000 + COMMIT, s</text>
|
||||
<text x="30" y="229">chat_only</text>
|
||||
<rect x="140" y="210" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="228">0.0497117</text>
|
||||
<text x="30" y="262">composite</text>
|
||||
<rect x="140" y="243" width="420.51" height="24" fill="#346dc4"/>
|
||||
<text x="570.51" y="261">0.0394425</text>
|
||||
<text x="30" y="325">Index size, bytes</text>
|
||||
<text x="30" y="359">chat_only</text>
|
||||
<rect x="140" y="340" width="64.60" height="24" fill="#d68439"/>
|
||||
<text x="214.60" y="358">720896</text>
|
||||
<text x="30" y="392">composite</text>
|
||||
<rect x="140" y="373" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="391">5.91462e+06</text>
|
||||
<text x="30" y="455">WAL for INSERT 5000, bytes</text>
|
||||
<text x="30" y="489">chat_only</text>
|
||||
<rect x="140" y="470" width="420.37" height="24" fill="#d68439"/>
|
||||
<text x="570.37" y="488">1.40879e+06</text>
|
||||
<text x="30" y="522">composite</text>
|
||||
<rect x="140" y="503" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="521">1.77618e+06</text>
|
||||
<text x="30" y="595">3 phases/index; 7 reads/phase; same data and limits. SQL time is not HTTP time.</text>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:8082"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:8082"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,3 @@
|
||||
BASE_URL=http://127.0.0.1:8082 uv run --locked pytest -q
|
||||
............................................................. [100%]
|
||||
61 passed in 17.63s
|
||||
@@ -0,0 +1,2 @@
|
||||
............................... [100%]
|
||||
31 passed in 11.80s
|
||||
@@ -0,0 +1,35 @@
|
||||
CREATE TABLE users (
|
||||
id uuid PRIMARY KEY,
|
||||
username text NOT NULL UNIQUE CHECK (username ~ '^[a-z0-9_]{3,32}$'),
|
||||
display_name text NOT NULL CHECK (char_length(display_name) BETWEEN 1 AND 100),
|
||||
password_hash text NOT NULL,
|
||||
created_at timestamptz NOT NULL
|
||||
);
|
||||
CREATE TABLE chats (
|
||||
id uuid PRIMARY KEY,
|
||||
title text NOT NULL CHECK (char_length(title) BETWEEN 1 AND 100),
|
||||
created_at timestamptz NOT NULL
|
||||
);
|
||||
CREATE TABLE members (
|
||||
chat_id uuid NOT NULL REFERENCES chats(id),
|
||||
user_id uuid NOT NULL REFERENCES users(id),
|
||||
position integer NOT NULL CHECK (position >= 0),
|
||||
PRIMARY KEY(chat_id,user_id),
|
||||
UNIQUE(chat_id,position)
|
||||
);
|
||||
CREATE INDEX members_user_idx ON members(user_id,chat_id);
|
||||
CREATE TABLE messages (
|
||||
id uuid PRIMARY KEY,
|
||||
chat_id uuid NOT NULL,
|
||||
sender_id uuid NOT NULL,
|
||||
text text NOT NULL CHECK (char_length(text) BETWEEN 1 AND 4000),
|
||||
created_at timestamptz NOT NULL,
|
||||
FOREIGN KEY(chat_id,sender_id) REFERENCES members(chat_id,user_id)
|
||||
);
|
||||
CREATE INDEX messages_history_idx ON messages(chat_id,created_at,id);
|
||||
CREATE TABLE sessions (
|
||||
token_digest text PRIMARY KEY,
|
||||
user_id uuid NOT NULL REFERENCES users(id),
|
||||
expires_at timestamptz NOT NULL
|
||||
);
|
||||
CREATE INDEX sessions_expiry_idx ON sessions(expires_at);
|
||||
@@ -0,0 +1,21 @@
|
||||
[project]
|
||||
name = "mtusi-messenger"
|
||||
version = "1.0.0"
|
||||
requires-python = ">=3.12,<3.13"
|
||||
dependencies = ["fastapi", "uvicorn", "psycopg[binary,pool]", "redis", "argon2-cffi"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest", "httpx", "ruff", "openapi-spec-validator", "jsonschema"]
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py312"
|
||||
line-length = 100
|
||||
include = ["src/**/*.py", "student-tests/**/*.py", "research/**/*.py"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["student-tests"]
|
||||
pythonpath = ["src", "tests"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E4", "E7", "E9", "F", "I", "UP", "B"]
|
||||
ignore = ["B008"] # FastAPI dependencies are declared in endpoint signatures.
|
||||
@@ -0,0 +1,58 @@
|
||||
# Трек 2: план запроса и восстановление
|
||||
|
||||
## Гипотеза и методика
|
||||
|
||||
При чтении глубокой страницы большого чата индекс только по chat_id вынужден
|
||||
отобрать и отсортировать много сообщений. Индекс (chat_id,created_at,id)
|
||||
должен читать не более нужного диапазона и следующей строки; платой будут
|
||||
больший размер индекса и возможное удорожание вставок.
|
||||
|
||||
Запуск из корня после `make up`:
|
||||
|
||||
```sh
|
||||
uv run --locked python research/run.py --output evidence/query-study-repeat.json
|
||||
uv run --locked python research/analyze.py evidence/query-study-repeat.json
|
||||
```
|
||||
|
||||
Скрипт создаёт отдельную базу `research_<случайный суффикс>` и **не очищает
|
||||
рабочую messenger**. Схема взята из настоящей миграции, поэтому действуют PK,
|
||||
FK, CHECK, тот же тип timestamp и та же структура строки. Один синтетический
|
||||
пользователь, десять чатов и 100 000 сообщений: 80 000, 15 000 и восемь по 625.
|
||||
|
||||
Сравниваются индексы только по chat_id и по (chat_id,created_at,id).
|
||||
Запрос одинаков: следующий 51 элемент после границы на позиции 60 000
|
||||
в чате из 80 000 сообщений. OFFSET используется только один раз для
|
||||
подготовки фиксированной границы, а не в измеряемом запросе.
|
||||
|
||||
Для каждого индекса выполнены три фазы с порядком A/B, B/A, A/B. Перед
|
||||
каждой фазой индекс создаётся заново, выполняются VACUUM ANALYZE и пять
|
||||
прогревочных запросов. Затем сохраняются семь полных EXPLAIN
|
||||
(ANALYZE, BUFFERS, FORMAT JSON), размер индекса, время одной подтверждённой
|
||||
вставки 5000 сообщений и прирост общего WAL. После вставки удаляются
|
||||
**только эти исследовательские строки**; основной dataset остаётся 100 000.
|
||||
Замеры времени вставки включают round trip внутри сети Docker и COMMIT.
|
||||
|
||||
В финале возвращается составной индекс. `pg_dump -Fc` создаёт логическую
|
||||
копию исследовательской базы в памяти запускающего процесса; `pg_restore`
|
||||
восстанавливает её в **новую** базу `restored_<суффикс>`. Сверяются количества
|
||||
строк всех пяти таблиц, 20 полных сообщений и checksum всех 100 000 сообщений
|
||||
в детерминированном порядке. SHA-256 дампа, размеры и времена backup/restore
|
||||
сохраняются в JSON. Дамп не содержит реальных пользователей и не сохраняется
|
||||
на диск. Обе созданные базы удаляются в finally; список уборки записывается.
|
||||
|
||||
## Интерпретация и ограничения
|
||||
|
||||
Это прогретая SQL latency одного узла, а не HTTP latency и не SLA API.
|
||||
Одновременно исследуется одна конфигурация индекса; лимиты PostgreSQL
|
||||
сохраняются в evidence вместе с версией и настройками durability.
|
||||
Для коротких серий приводится медиана повторов; три записи недостаточны
|
||||
для сильного статистического вывода о небольшой разнице стоимости вставки.
|
||||
WAL общий для кластера и зависит от checkpoint/full-page writes; его нельзя
|
||||
считать чистой ценой одного индекса без оговорки. Сброс кэша ОС не выполняется.
|
||||
Прочие контейнеры должны быть без интенсивной нагрузки во время эксперимента.
|
||||
|
||||
Успешное восстановление доказывает пригодность конкретной логической копии.
|
||||
Данные после снимка pg_dump в неё не входят: без WAL-архива/PITR возможная
|
||||
потеря равна интервалу после последней копии. Замер восстановления на том же
|
||||
ноутбуке не включает доставку backup, замену оборудования и переключение
|
||||
клиентов. Один host и единственный PostgreSQL остаются точками отказа.
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Render a small static comparison from the saved raw experiment."""
|
||||
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main():
|
||||
source = Path(sys.argv[1])
|
||||
data = json.loads(source.read_text())
|
||||
summary = data["summary"]
|
||||
metrics = [
|
||||
("sql_execution_median_ms", "SQL median, ms"),
|
||||
("insert_5000_median_seconds", "INSERT 5000 + COMMIT, s"),
|
||||
("index_bytes", "Index size, bytes"),
|
||||
("insert_wal_median_bytes", "WAL for INSERT 5000, bytes"),
|
||||
]
|
||||
parts = [
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="900" height="610" viewBox="0 0 900 610">',
|
||||
'<rect width="900" height="610" fill="white"/>',
|
||||
'<g font-family="sans-serif" font-size="15" fill="#172033">',
|
||||
'<text x="30" y="30" font-size="21">100 000 messages: warm PostgreSQL comparison</text>',
|
||||
]
|
||||
for i, (key, title) in enumerate(metrics):
|
||||
y = 65 + i * 130
|
||||
maximum = max(summary[v][key] for v in summary) or 1
|
||||
parts.append(f'<text x="30" y="{y}">{title}</text>')
|
||||
for j, (variant, color) in enumerate((("chat_only", "#d68439"), ("composite", "#346dc4"))):
|
||||
value = summary[variant][key]
|
||||
width = 530 * value / maximum
|
||||
yy = y + 15 + j * 33
|
||||
parts.extend(
|
||||
[
|
||||
f'<text x="30" y="{yy + 19}">{variant}</text>',
|
||||
f'<rect x="140" y="{yy}" width="{width:.2f}" height="24" fill="{color}"/>',
|
||||
f'<text x="{150 + width:.2f}" y="{yy + 18}">{value:.6g}</text>',
|
||||
]
|
||||
)
|
||||
parts.extend(
|
||||
[
|
||||
'<text x="30" y="595">3 phases/index; 7 reads/phase; same data and limits. SQL time is not HTTP time.</text>',
|
||||
"</g></svg>",
|
||||
]
|
||||
)
|
||||
source.with_suffix(".svg").write_text("\n".join(parts))
|
||||
print("Saved", source.with_suffix(".svg"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Isolated SQL index study and real pg_dump/pg_restore round trip."""
|
||||
|
||||
import argparse
|
||||
import datetime as dt
|
||||
import hashlib
|
||||
import json
|
||||
import statistics
|
||||
import subprocess
|
||||
import time
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def command(args, *, data=None, timeout=180):
|
||||
result = subprocess.run(args, input=data, capture_output=True, cwd=ROOT, timeout=timeout)
|
||||
if result.returncode:
|
||||
# Never echo connection strings or arbitrary container stderr into evidence.
|
||||
raise RuntimeError("Research subprocess failed: " + args[0])
|
||||
return result.stdout
|
||||
|
||||
|
||||
def worker(mode, original, restored):
|
||||
code = (ROOT / "research/worker.py").read_bytes()
|
||||
raw = command(
|
||||
["docker", "compose", "exec", "-T", "api", "python", "-", mode, original, restored],
|
||||
data=code,
|
||||
)
|
||||
return json.loads(raw)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--output", default="evidence/query-study.json")
|
||||
args = parser.parse_args()
|
||||
output = ROOT / args.output
|
||||
if output.exists():
|
||||
raise SystemExit("Choose a new evidence output; existing results are immutable")
|
||||
suffix = uuid.uuid4().hex[:12]
|
||||
original, restored = "research_" + suffix, "restored_" + suffix
|
||||
result = {
|
||||
"started_utc": dt.datetime.now(dt.UTC).isoformat(),
|
||||
"databases": {"original": original, "restored": restored},
|
||||
"command": "uv run --locked python research/run.py --output " + args.output,
|
||||
"method": "Single PostgreSQL container, warmed SQL reads; not HTTP latency",
|
||||
"repeats_per_index": 3,
|
||||
"read_trials_per_phase": 7,
|
||||
"warmup_queries_per_phase": 5,
|
||||
}
|
||||
try:
|
||||
result["source_commit"] = command(["git", "rev-parse", "HEAD"]).decode().strip()
|
||||
result["source_worktree_dirty"] = bool(command(["git", "status", "--porcelain"]))
|
||||
cid = command(["docker", "compose", "ps", "-q", "postgres"]).decode().strip()
|
||||
inspect = json.loads(command(["docker", "inspect", cid]))[0]
|
||||
result["postgres_container"] = {
|
||||
"id": cid,
|
||||
"image_id": inspect["Image"],
|
||||
"nano_cpus": inspect["HostConfig"]["NanoCpus"],
|
||||
"memory_limit_bytes": inspect["HostConfig"]["Memory"],
|
||||
}
|
||||
result["study"] = worker("measure", original, restored)
|
||||
print("Measured both indexes on 100000 messages; preparing logical backup.", flush=True)
|
||||
start = time.perf_counter()
|
||||
dump = command(
|
||||
[
|
||||
"docker",
|
||||
"compose",
|
||||
"exec",
|
||||
"-T",
|
||||
"postgres",
|
||||
"pg_dump",
|
||||
"-U",
|
||||
"messenger",
|
||||
"-d",
|
||||
original,
|
||||
"-Fc",
|
||||
"--no-owner",
|
||||
"--no-acl",
|
||||
]
|
||||
)
|
||||
result["backup"] = {
|
||||
"seconds": time.perf_counter() - start,
|
||||
"bytes": len(dump),
|
||||
"sha256": hashlib.sha256(dump).hexdigest(),
|
||||
}
|
||||
worker("create_restore", original, restored)
|
||||
start = time.perf_counter()
|
||||
command(
|
||||
[
|
||||
"docker",
|
||||
"compose",
|
||||
"exec",
|
||||
"-T",
|
||||
"postgres",
|
||||
"pg_restore",
|
||||
"-U",
|
||||
"messenger",
|
||||
"-d",
|
||||
restored,
|
||||
"--no-owner",
|
||||
"--no-acl",
|
||||
"--exit-on-error",
|
||||
],
|
||||
data=dump,
|
||||
)
|
||||
result["restore"] = {"seconds": time.perf_counter() - start}
|
||||
result["verification"] = worker("verify", original, restored)
|
||||
summary = {}
|
||||
for variant in ("chat_only", "composite"):
|
||||
phases = [p for p in result["study"]["phases"] if p["variant"] == variant]
|
||||
summary[variant] = {
|
||||
"sql_execution_median_ms": statistics.median(
|
||||
plan["Execution Time"] for phase in phases for plan in phase["plans"]
|
||||
),
|
||||
"insert_5000_median_seconds": statistics.median(
|
||||
p["insert_commit_seconds"] for p in phases
|
||||
),
|
||||
"index_bytes": statistics.median(p["index_bytes_before_write"] for p in phases),
|
||||
"insert_wal_median_bytes": statistics.median(p["insert_wal_bytes"] for p in phases),
|
||||
}
|
||||
result["summary"] = summary
|
||||
result["status"] = "PASS"
|
||||
finally:
|
||||
result["cleanup"] = worker("cleanup", original, restored)
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
output.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n")
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"status": result["status"],
|
||||
"summary": result["summary"],
|
||||
"backup": result["backup"],
|
||||
"restore": result["restore"],
|
||||
},
|
||||
ensure_ascii=False,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,183 @@
|
||||
"""Execute inside the API container, where psycopg and scoped DB credentials exist."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import psycopg
|
||||
from psycopg import sql
|
||||
from psycopg.conninfo import make_conninfo
|
||||
from psycopg.rows import dict_row
|
||||
|
||||
MODE, DATABASE, RESTORED = sys.argv[1:]
|
||||
if not DATABASE.startswith("research_") or not RESTORED.startswith("restored_"):
|
||||
raise SystemExit("Only isolated research databases are supported")
|
||||
DSN = Path(os.environ["DATABASE_URL_FILE"]).read_text().strip()
|
||||
|
||||
|
||||
def connect(database="postgres"):
|
||||
return psycopg.connect(
|
||||
make_conninfo(DSN, dbname=database), autocommit=True, row_factory=dict_row
|
||||
)
|
||||
|
||||
|
||||
def fingerprint(conn):
|
||||
counts = {
|
||||
table: conn.execute(
|
||||
sql.SQL("SELECT count(*) AS n FROM {}").format(sql.Identifier(table))
|
||||
).fetchone()["n"]
|
||||
for table in ("users", "chats", "members", "messages", "sessions")
|
||||
}
|
||||
selected = conn.execute(
|
||||
"SELECT id::text,chat_id::text,sender_id::text,text,"
|
||||
"to_char(created_at AT TIME ZONE 'UTC',"
|
||||
'\'YYYY-MM-DD"T"HH24:MI:SS.US"Z"\') AS created_at '
|
||||
"FROM messages ORDER BY id LIMIT 20"
|
||||
).fetchall()
|
||||
digest = conn.execute(
|
||||
"SELECT md5(string_agg(id::text || ':' || chat_id::text || ':' || "
|
||||
"sender_id::text || ':' || text || ':' || "
|
||||
"extract(epoch FROM created_at)::text, '|' ORDER BY id)) AS checksum "
|
||||
"FROM messages"
|
||||
).fetchone()["checksum"]
|
||||
return {"counts": counts, "selected_messages": selected, "all_messages_md5": digest}
|
||||
|
||||
|
||||
def measure():
|
||||
with connect() as admin:
|
||||
admin.execute(sql.SQL("CREATE DATABASE {}").format(sql.Identifier(DATABASE)))
|
||||
with connect(DATABASE) as conn:
|
||||
schema = Path("migrations/001_initial.sql").read_text()
|
||||
conn.execute(schema)
|
||||
conn.execute(
|
||||
"INSERT INTO users VALUES (md5('research-user')::uuid,'research_user',"
|
||||
"'Синтетический исследователь','not-a-login-hash','2026-01-01T00:00:00Z')"
|
||||
)
|
||||
conn.execute(
|
||||
"INSERT INTO chats SELECT md5('chat-'||g)::uuid,'research chat '||g,"
|
||||
"'2026-01-01T00:00:00Z'::timestamptz FROM generate_series(1,10) g"
|
||||
)
|
||||
conn.execute("INSERT INTO members SELECT id,md5('research-user')::uuid,0 FROM chats")
|
||||
seed_start = time.perf_counter()
|
||||
conn.execute(
|
||||
"INSERT INTO messages SELECT md5('message-'||g)::uuid,"
|
||||
"md5('chat-' || CASE WHEN g<=80000 THEN 1 WHEN g<=95000 THEN 2 "
|
||||
"ELSE 3+(g%8) END)::uuid,md5('research-user')::uuid,"
|
||||
"'synthetic message '||g,'2026-01-01T00:00:00Z'::timestamptz + g*interval '1 microsecond' "
|
||||
"FROM generate_series(1,100000) g"
|
||||
)
|
||||
seed_seconds = time.perf_counter() - seed_start
|
||||
conn.execute("VACUUM ANALYZE messages")
|
||||
cursor = conn.execute(
|
||||
"SELECT created_at,id FROM messages "
|
||||
"WHERE chat_id=md5('chat-1')::uuid "
|
||||
"ORDER BY created_at,id OFFSET 60000 LIMIT 1"
|
||||
).fetchone()
|
||||
query = (
|
||||
"SELECT id,chat_id,sender_id,text,created_at FROM messages "
|
||||
"WHERE chat_id=md5('chat-1')::uuid AND (created_at,id)>(%s,%s) "
|
||||
"ORDER BY created_at,id LIMIT 51"
|
||||
)
|
||||
params = (cursor["created_at"], cursor["id"])
|
||||
phases = []
|
||||
for repeat, order in enumerate(
|
||||
(("chat_only", "composite"), ("composite", "chat_only"), ("chat_only", "composite")),
|
||||
start=1,
|
||||
):
|
||||
for variant in order:
|
||||
conn.execute("DROP INDEX IF EXISTS messages_history_idx")
|
||||
conn.execute("DROP INDEX IF EXISTS research_history_idx")
|
||||
columns = "chat_id" if variant == "chat_only" else "chat_id,created_at,id"
|
||||
conn.execute("CREATE INDEX research_history_idx ON messages (" + columns + ")")
|
||||
conn.execute("VACUUM ANALYZE messages")
|
||||
for _ in range(5):
|
||||
conn.execute(query, params).fetchall()
|
||||
trials = []
|
||||
for _ in range(7):
|
||||
plan = conn.execute(
|
||||
"EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) " + query, params
|
||||
).fetchone()["QUERY PLAN"][0]
|
||||
trials.append(plan)
|
||||
size = conn.execute("SELECT pg_relation_size('research_history_idx') AS bytes")
|
||||
index_bytes = size.fetchone()["bytes"]
|
||||
before = conn.execute("SELECT pg_current_wal_insert_lsn() AS lsn").fetchone()["lsn"]
|
||||
write_start = time.perf_counter()
|
||||
conn.execute(
|
||||
"INSERT INTO messages SELECT md5('write-'||g)::uuid,"
|
||||
"md5('chat-1')::uuid,md5('research-user')::uuid,"
|
||||
"'synthetic write '||g,'2026-01-02T00:00:00Z'::timestamptz + g*interval '1 microsecond' "
|
||||
"FROM generate_series(1,5000) g"
|
||||
)
|
||||
write_seconds = time.perf_counter() - write_start
|
||||
wal_bytes = conn.execute(
|
||||
"SELECT pg_wal_lsn_diff(pg_current_wal_insert_lsn(),%s) AS n", (before,)
|
||||
).fetchone()["n"]
|
||||
conn.execute(
|
||||
"DELETE FROM messages WHERE created_at>='2026-01-02T00:00:00Z'::timestamptz"
|
||||
)
|
||||
phases.append(
|
||||
{
|
||||
"repeat": repeat,
|
||||
"variant": variant,
|
||||
"plans": trials,
|
||||
"index_bytes_before_write": index_bytes,
|
||||
"insert_rows": 5000,
|
||||
"insert_commit_seconds": write_seconds,
|
||||
"insert_wal_bytes": int(wal_bytes),
|
||||
}
|
||||
)
|
||||
conn.execute("DROP INDEX research_history_idx")
|
||||
conn.execute("CREATE INDEX messages_history_idx ON messages(chat_id,created_at,id)")
|
||||
conn.execute("VACUUM ANALYZE messages")
|
||||
distribution = conn.execute(
|
||||
"SELECT c.title,count(*) AS messages FROM messages m "
|
||||
"JOIN chats c ON c.id=m.chat_id GROUP BY c.title ORDER BY messages DESC"
|
||||
).fetchall()
|
||||
settings = conn.execute(
|
||||
"SELECT name,setting FROM pg_settings WHERE name IN "
|
||||
"('server_version','shared_buffers','fsync','synchronous_commit',"
|
||||
"'full_page_writes','max_connections','work_mem') ORDER BY name"
|
||||
).fetchall()
|
||||
return {
|
||||
"seed_seconds": seed_seconds,
|
||||
"rows": 100000,
|
||||
"schema_sha256": hashlib.sha256(schema.encode()).hexdigest(),
|
||||
"distribution": distribution,
|
||||
"query": query,
|
||||
"cursor_position": 60000,
|
||||
"settings": settings,
|
||||
"phases": phases,
|
||||
"source": fingerprint(conn),
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
if MODE == "measure":
|
||||
result = measure()
|
||||
elif MODE == "create_restore":
|
||||
with connect() as admin:
|
||||
admin.execute(sql.SQL("CREATE DATABASE {}").format(sql.Identifier(RESTORED)))
|
||||
result = {"created": RESTORED}
|
||||
elif MODE == "verify":
|
||||
with connect(DATABASE) as original, connect(RESTORED) as restored:
|
||||
a, b = fingerprint(original), fingerprint(restored)
|
||||
if a != b:
|
||||
raise RuntimeError("Restored data mismatch")
|
||||
result = {"equal": True, "restored": b}
|
||||
elif MODE == "cleanup":
|
||||
with connect() as admin:
|
||||
for name in (DATABASE, RESTORED):
|
||||
admin.execute(
|
||||
sql.SQL("DROP DATABASE IF EXISTS {} WITH (FORCE)").format(sql.Identifier(name))
|
||||
)
|
||||
result = {"removed_only": [DATABASE, RESTORED]}
|
||||
else:
|
||||
raise ValueError("Unknown research operation")
|
||||
print(json.dumps(result, ensure_ascii=False, default=str))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create a private local secret directory once; never rotate existing volumes implicitly."""
|
||||
|
||||
import os
|
||||
import secrets
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
private = root / "secrets"
|
||||
private.mkdir(mode=0o700, exist_ok=True)
|
||||
os.chmod(private, 0o700)
|
||||
password_file = private / "postgres_password"
|
||||
if not password_file.exists():
|
||||
password_file.write_text(secrets.token_urlsafe(32))
|
||||
password = password_file.read_text().strip()
|
||||
values = {
|
||||
"database_url": "postgresql://messenger:" + password + "@postgres:5432/messenger",
|
||||
"cache_url": "redis://cache:6379/0",
|
||||
}
|
||||
for name, value in values.items():
|
||||
path = private / name
|
||||
if not path.exists():
|
||||
path.write_text(value)
|
||||
# The parent directory is private on the host; files must be readable by non-root API
|
||||
# through Compose's file-backed secret mount (uid/mode mapping is not portable).
|
||||
for path in private.iterdir():
|
||||
os.chmod(path, 0o644)
|
||||
if not (root / ".env").exists():
|
||||
(root / ".env").write_text("PUBLIC_PORT=8082\nSESSION_TTL_SECONDS=3600\n")
|
||||
print("Local configuration ready; existing secret values preserved.")
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
docker compose restart postgres cache api
|
||||
@@ -0,0 +1,204 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Real PostgreSQL/cache faults, unchanged sessions, expiry, rollback and bounded SQL."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
from client import Client, Failure # noqa: E402
|
||||
|
||||
|
||||
def compose(*args, timeout=60):
|
||||
result = subprocess.run(
|
||||
["docker", "compose", *args], cwd=ROOT, capture_output=True, text=True, timeout=timeout
|
||||
)
|
||||
if result.returncode:
|
||||
raise RuntimeError("Compose action failed: " + args[0])
|
||||
return result.stdout.strip()
|
||||
|
||||
|
||||
def states():
|
||||
ids = compose("ps", "-q", "api", "postgres", "cache").split()
|
||||
data = json.loads(subprocess.check_output(["docker", "inspect", *ids], text=True))
|
||||
return {
|
||||
d["Config"]["Labels"]["com.docker.compose.service"]: {
|
||||
"cid": d["Id"],
|
||||
"pid": d["State"]["Pid"],
|
||||
"started_at": d["State"]["StartedAt"],
|
||||
}
|
||||
for d in data
|
||||
}
|
||||
|
||||
|
||||
def wait(client):
|
||||
deadline = time.monotonic() + 40
|
||||
while True:
|
||||
try:
|
||||
client.call("GET", "/health/ready", schema="Health")
|
||||
return
|
||||
except Failure:
|
||||
if time.monotonic() > deadline:
|
||||
raise
|
||||
time.sleep(0.3)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--base-url", default="http://127.0.0.1:8082")
|
||||
parser.add_argument("--short-url", default="http://127.0.0.1:18082")
|
||||
parser.add_argument("--output", default="evidence/lifecycle.json")
|
||||
args = parser.parse_args()
|
||||
output = ROOT / args.output
|
||||
if output.exists():
|
||||
raise SystemExit("Use a new evidence filename")
|
||||
c = Client(args.base_url)
|
||||
alice, bob, _, chat = c.bootstrap()
|
||||
message = c.message(alice, chat, "Пережить реальный перезапуск")["json"]
|
||||
result = {"date_utc": datetime.now(UTC).isoformat(), "passed": False}
|
||||
before = states()
|
||||
public = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"tests/resilience.py",
|
||||
"--mode",
|
||||
"persistence",
|
||||
"--action-script",
|
||||
"scripts/restart.sh",
|
||||
"--base-url",
|
||||
c.base,
|
||||
],
|
||||
cwd=ROOT,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=180,
|
||||
)
|
||||
assert public.returncode == 0, "Public persistence failed"
|
||||
result["public_persistence"] = public.stdout.strip()
|
||||
after = states()
|
||||
assert before.keys() == after.keys() == {"api", "postgres", "cache"}
|
||||
for service in before:
|
||||
assert before[service]["started_at"] != after[service]["started_at"]
|
||||
assert before[service]["pid"] != after[service]["pid"]
|
||||
result.update(before=before, after=after)
|
||||
assert c.call("GET", "/api/v1/users/me", actor=alice, schema="User")["json"] == alice["user"]
|
||||
data = c.call("GET", f"/api/v1/chats/{chat['id']}/messages", actor=bob, schema="MessagePage")[
|
||||
"json"
|
||||
]
|
||||
assert data["items"] == [message]
|
||||
result["same_token_and_message_after_restart"] = True
|
||||
|
||||
# A real key must exist: cache role is verified, not just configured.
|
||||
keys = int(compose("exec", "-T", "cache", "valkey-cli", "DBSIZE"))
|
||||
assert keys > 0
|
||||
compose("exec", "-T", "cache", "valkey-cli", "FLUSHDB")
|
||||
c.call("GET", "/api/v1/users/me", actor=alice, schema="User")
|
||||
assert int(compose("exec", "-T", "cache", "valkey-cli", "DBSIZE")) > 0
|
||||
result["cache_flush_repopulates"] = True
|
||||
try:
|
||||
compose("stop", "cache")
|
||||
started = time.monotonic()
|
||||
c.call("GET", "/api/v1/users/me", actor=alice, schema="User")
|
||||
elapsed = time.monotonic() - started
|
||||
assert elapsed < 3
|
||||
c.call("GET", "/api/v1/users/me", 401)
|
||||
result["cache_failure"] = {
|
||||
"authenticated_status": 200,
|
||||
"anonymous_status": 401,
|
||||
"seconds": round(elapsed, 4),
|
||||
}
|
||||
finally:
|
||||
compose("start", "cache")
|
||||
try:
|
||||
# This token was valid and its public user card is already cached.
|
||||
c.call("GET", "/api/v1/users/me", actor=alice, schema="User")
|
||||
compose("stop", "postgres")
|
||||
started = time.monotonic()
|
||||
c.call("GET", "/api/v1/users/me", 503, actor=alice)
|
||||
elapsed = time.monotonic() - started
|
||||
assert elapsed < 5
|
||||
c.call("GET", "/health/ready", 503)
|
||||
c.call("GET", "/health/live", schema="Health")
|
||||
c.call("GET", "/api/v1/users/me", 401)
|
||||
result["database_failure"] = {
|
||||
"cached_actor_status": 503,
|
||||
"ready_status": 503,
|
||||
"live_status": 200,
|
||||
"seconds": round(elapsed, 4),
|
||||
}
|
||||
finally:
|
||||
compose("start", "postgres")
|
||||
wait(c)
|
||||
c.call("GET", "/api/v1/users/me", actor=alice, schema="User")
|
||||
result["session_after_database_recovery"] = True
|
||||
|
||||
# Ensure a failure after the chat INSERT rolls back that INSERT as well as memberships.
|
||||
title = "rollback_" + uuid.uuid4().hex
|
||||
c.call(
|
||||
"POST",
|
||||
"/api/v1/chats",
|
||||
400,
|
||||
actor=alice,
|
||||
body={"title": title, "member_ids": [alice["id"], str(uuid.uuid4())]},
|
||||
)
|
||||
count = compose(
|
||||
"exec",
|
||||
"-T",
|
||||
"postgres",
|
||||
"psql",
|
||||
"-U",
|
||||
"messenger",
|
||||
"-d",
|
||||
"messenger",
|
||||
"-Atc",
|
||||
"SELECT count(*) FROM chats WHERE title='" + title + "'",
|
||||
)
|
||||
assert count == "0"
|
||||
result["failed_chat_transaction_left_rows"] = 0
|
||||
|
||||
compose("run", "--rm", "migrate")
|
||||
compose("run", "--rm", "migrate")
|
||||
result["migrations_reapplied_twice"] = True
|
||||
short = Client(args.short_url)
|
||||
short_actor = short.user("expiry")
|
||||
start = time.monotonic()
|
||||
short.call("GET", "/api/v1/users/me", actor=short_actor, schema="User")
|
||||
time.sleep(1.0)
|
||||
compose("-f", "compose.yaml", "-f", "compose.test.yaml", "restart", "api-short")
|
||||
wait(short)
|
||||
remaining = 2.2 - (time.monotonic() - start)
|
||||
if remaining > 0:
|
||||
time.sleep(remaining)
|
||||
short.call("GET", "/api/v1/users/me", 401, actor=short_actor)
|
||||
result["expiry"] = {
|
||||
"configured_ttl_seconds": 2,
|
||||
"observed_after_seconds": round(time.monotonic() - start, 4),
|
||||
"expired_status": 401,
|
||||
"short_api_restarted_before_check": True,
|
||||
}
|
||||
c.call("DELETE", "/api/v1/auth/sessions/current", 204, actor=alice)
|
||||
c.call("GET", "/api/v1/users/me", 401, actor=alice)
|
||||
result["logout_with_cached_user"] = 401
|
||||
|
||||
# Tokens and passwords remain in this process; scan their actual values without saving them.
|
||||
ids = compose("ps", "-q", "api").split()
|
||||
logs = subprocess.run(["docker", "logs", ids[0]], capture_output=True, text=True, check=True)
|
||||
text = logs.stdout + logs.stderr
|
||||
for person in [alice, bob, short_actor]:
|
||||
assert person["token"] not in text
|
||||
assert person["registration"]["password"] not in text
|
||||
result["credentials_absent_from_api_logs"] = True
|
||||
result["passed"] = True
|
||||
output.parent.mkdir(exist_ok=True, parents=True)
|
||||
output.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n")
|
||||
print("PASS: real restart, same token, cache/DB faults, rollback, expiry and logout")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Probe the real bounded pool in an isolated process against the teaching database."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PROBE = """
|
||||
import json, threading, time
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from messenger.postgres import PostgresStore
|
||||
from messenger.domain import Failure
|
||||
store=PostgresStore()
|
||||
barrier=threading.Barrier(50)
|
||||
def work(i):
|
||||
barrier.wait()
|
||||
start=time.monotonic()
|
||||
try:
|
||||
with store.connection() as conn:
|
||||
conn.execute("SELECT pg_sleep(2.2)")
|
||||
return {"status":200,"seconds":time.monotonic()-start}
|
||||
except Failure as e:
|
||||
return {"status":e.status,"seconds":time.monotonic()-start}
|
||||
with ThreadPoolExecutor(max_workers=50) as executor:
|
||||
rows=list(executor.map(work,range(50)))
|
||||
store.close()
|
||||
assert any(r["status"]==200 for r in rows)
|
||||
assert any(r["status"]==503 for r in rows)
|
||||
assert max(r["seconds"] for r in rows)<5
|
||||
print(json.dumps({"passed":True,"clients":50,"max_pool_size":8,"max_waiting":32,
|
||||
"admitted":sum(r["status"]==200 for r in rows),"rejected_503":sum(r["status"]==503 for r in rows),
|
||||
"max_seconds":max(r["seconds"] for r in rows),"rows":rows}))
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--output", default="evidence/pool.json")
|
||||
args = parser.parse_args()
|
||||
path = ROOT / args.output
|
||||
if path.exists():
|
||||
raise SystemExit("Choose a new evidence filename")
|
||||
process = subprocess.run(
|
||||
["docker", "compose", "run", "--rm", "--no-deps", "-T", "api", "python", "-c", PROBE],
|
||||
cwd=ROOT,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=25,
|
||||
)
|
||||
if process.returncode:
|
||||
raise SystemExit("Pool probe failed; inspect source and dependency readiness")
|
||||
result = json.loads(process.stdout)
|
||||
result["date_utc"] = datetime.now(UTC).isoformat()
|
||||
path.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n")
|
||||
print("PASS: real bounded connection pool overload returns 503")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1 @@
|
||||
"""Учебный REST-мессенджер."""
|
||||
@@ -0,0 +1,12 @@
|
||||
import os
|
||||
|
||||
import uvicorn
|
||||
|
||||
uvicorn.run(
|
||||
"messenger.app:app",
|
||||
host=os.getenv("APP_HOST", "0.0.0.0"),
|
||||
port=int(os.getenv("APP_PORT", "8080")),
|
||||
workers=1,
|
||||
access_log=False,
|
||||
timeout_graceful_shutdown=5,
|
||||
)
|
||||
@@ -0,0 +1,211 @@
|
||||
import base64
|
||||
import binascii
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from contextlib import asynccontextmanager
|
||||
from uuid import uuid4
|
||||
|
||||
from fastapi import Depends, FastAPI, Request, Response
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import JSONResponse
|
||||
from starlette.exceptions import HTTPException
|
||||
|
||||
from .domain import Failure, boundary, identifier, page
|
||||
from .models import CreateChat, CreateMessage, CreateUser
|
||||
from .postgres import PostgresStore
|
||||
|
||||
logger = logging.getLogger("messenger")
|
||||
logging.basicConfig(level=os.getenv("LOG_LEVEL", "INFO"), format="%(message)s")
|
||||
CODES = {
|
||||
400: "invalid_request",
|
||||
401: "unauthorized",
|
||||
404: "not_found",
|
||||
409: "conflict",
|
||||
413: "payload_too_large",
|
||||
415: "unsupported_media_type",
|
||||
429: "rate_limited",
|
||||
503: "unavailable",
|
||||
500: "internal_error",
|
||||
}
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app):
|
||||
app.state.store = PostgresStore()
|
||||
logger.info(json.dumps({"event": "started", "storage": "postgres"}))
|
||||
yield
|
||||
app.state.store.close()
|
||||
logger.info(json.dumps({"event": "stopped"}))
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=None)
|
||||
|
||||
|
||||
def error(request, status, message, headers=None):
|
||||
return JSONResponse(
|
||||
{
|
||||
"error": {
|
||||
"code": CODES.get(status, "invalid_request"),
|
||||
"message": message,
|
||||
"request_id": request.state.request_id,
|
||||
}
|
||||
},
|
||||
status_code=status,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
|
||||
@app.middleware("http")
|
||||
async def request_log(request: Request, call_next):
|
||||
request.state.request_id = str(uuid4())
|
||||
start = time.perf_counter()
|
||||
try:
|
||||
response = await call_next(request)
|
||||
except Exception:
|
||||
logger.error(
|
||||
json.dumps({"event": "unexpected_error", "request_id": request.state.request_id})
|
||||
)
|
||||
response = error(request, 500, "Внутренняя ошибка")
|
||||
response.headers["X-Request-Id"] = request.state.request_id
|
||||
route = request.scope.get("route")
|
||||
logger.info(
|
||||
json.dumps(
|
||||
{
|
||||
"event": "request",
|
||||
"request_id": request.state.request_id,
|
||||
"method": request.method,
|
||||
"route": getattr(route, "path", "unknown"),
|
||||
"status": response.status_code,
|
||||
"duration_ms": round((time.perf_counter() - start) * 1000, 3),
|
||||
}
|
||||
)
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
@app.exception_handler(Failure)
|
||||
async def domain_error(request, exc):
|
||||
return error(request, exc.status, exc.message, exc.headers)
|
||||
|
||||
|
||||
@app.exception_handler(RequestValidationError)
|
||||
async def validation_error(request, exc):
|
||||
return error(request, 400, "Неверный JSON или поля запроса")
|
||||
|
||||
|
||||
@app.exception_handler(HTTPException)
|
||||
async def http_error(request, exc):
|
||||
return error(request, exc.status_code, "Неверный запрос", exc.headers)
|
||||
|
||||
|
||||
def bearer_failure():
|
||||
return Failure(
|
||||
401, "Требуется действующая сессия", {"WWW-Authenticate": 'Bearer realm="messenger"'}
|
||||
)
|
||||
|
||||
|
||||
def bearer(request):
|
||||
parts = request.headers.get("Authorization", "").split()
|
||||
if len(parts) != 2 or parts[0].lower() != "bearer":
|
||||
raise bearer_failure()
|
||||
return parts[1]
|
||||
|
||||
|
||||
def actor(request: Request):
|
||||
user = request.app.state.store.authenticate(bearer(request))
|
||||
if user is None:
|
||||
raise bearer_failure()
|
||||
return user
|
||||
|
||||
|
||||
@app.post("/api/v1/auth/sessions", status_code=201)
|
||||
def login(request: Request):
|
||||
headers = {"WWW-Authenticate": 'Basic realm="messenger", charset="UTF-8"'}
|
||||
parts = request.headers.get("Authorization", "").split()
|
||||
try:
|
||||
if len(parts) != 2 or parts[0].lower() != "basic" or len(parts[1]) > 2048:
|
||||
raise ValueError
|
||||
decoded = base64.b64decode(parts[1], validate=True).decode("utf-8")
|
||||
username, password = decoded.split(":", 1)
|
||||
if not re.fullmatch(r"[a-z0-9_]{3,32}", username) or not 12 <= len(password) <= 128:
|
||||
raise ValueError
|
||||
except (ValueError, UnicodeError, binascii.Error):
|
||||
raise Failure(401, "Неверные учётные данные", headers) from None
|
||||
session = request.app.state.store.login(username, password)
|
||||
if session is None:
|
||||
raise Failure(401, "Неверные учётные данные", headers)
|
||||
return session
|
||||
|
||||
|
||||
@app.delete("/api/v1/auth/sessions/current", status_code=204)
|
||||
def logout(request: Request, user=Depends(actor)):
|
||||
if not request.app.state.store.logout(bearer(request)):
|
||||
raise bearer_failure()
|
||||
return Response(status_code=204)
|
||||
|
||||
|
||||
def pagination(request, scope):
|
||||
allowed = {"limit", "cursor"}
|
||||
if any(k not in allowed for k in request.query_params):
|
||||
raise Failure(400, "Неизвестный параметр запроса")
|
||||
if any(len(request.query_params.getlist(k)) > 1 for k in allowed):
|
||||
raise Failure(400, "Повторный параметр запроса")
|
||||
value = request.query_params.get("limit", "50")
|
||||
if len(value) > 3 or not re.fullmatch(r"[0-9]+", value) or not 1 <= int(value) <= 100:
|
||||
raise Failure(400, "limit должен быть целым от 1 до 100")
|
||||
return int(value), boundary(scope, request.query_params.get("cursor"))
|
||||
|
||||
|
||||
@app.get("/health/live")
|
||||
def live():
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@app.get("/health/ready")
|
||||
def ready(request: Request):
|
||||
if not request.app.state.store.ready():
|
||||
raise Failure(503, "Хранилище недоступно")
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@app.post("/api/v1/users", status_code=201)
|
||||
def register(data: CreateUser, request: Request):
|
||||
return request.app.state.store.register(data.model_dump(mode="json"))
|
||||
|
||||
|
||||
@app.get("/api/v1/users/me")
|
||||
def me(user=Depends(actor)):
|
||||
return user
|
||||
|
||||
|
||||
@app.post("/api/v1/chats", status_code=201)
|
||||
def create_chat(data: CreateChat, request: Request, user=Depends(actor)):
|
||||
return request.app.state.store.create_chat(user["id"], data.model_dump(mode="json"))
|
||||
|
||||
|
||||
@app.get("/api/v1/chats")
|
||||
def chats(request: Request, user=Depends(actor)):
|
||||
scope = "chats:" + user["id"]
|
||||
limit, after = pagination(request, scope)
|
||||
return page(request.app.state.store.list_chats(user["id"], after, limit), limit, scope)
|
||||
|
||||
|
||||
@app.get("/api/v1/chats/{chat_id}")
|
||||
def chat(chat_id: str, request: Request, user=Depends(actor)):
|
||||
return request.app.state.store.chat(user["id"], identifier(chat_id))
|
||||
|
||||
|
||||
@app.post("/api/v1/chats/{chat_id}/messages", status_code=201)
|
||||
def send(chat_id: str, data: CreateMessage, request: Request, user=Depends(actor)):
|
||||
return request.app.state.store.send(user["id"], identifier(chat_id), data.text)
|
||||
|
||||
|
||||
@app.get("/api/v1/chats/{chat_id}/messages")
|
||||
def history(chat_id: str, request: Request, user=Depends(actor)):
|
||||
cid = identifier(chat_id)
|
||||
scope = "messages:" + cid
|
||||
limit, after = pagination(request, scope)
|
||||
return page(request.app.state.store.history(user["id"], cid, after, limit), limit, scope)
|
||||
@@ -0,0 +1,10 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def secret(name: str) -> str:
|
||||
filename = os.environ.get(name + "_FILE")
|
||||
value = Path(filename).read_text().strip() if filename else os.environ.get(name, "")
|
||||
if not value:
|
||||
raise RuntimeError("Отсутствует настройка " + name)
|
||||
return value
|
||||
@@ -0,0 +1,54 @@
|
||||
import base64
|
||||
import json
|
||||
import re
|
||||
from datetime import UTC, datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
class Failure(Exception):
|
||||
def __init__(self, status: int, message: str, headers: dict | None = None):
|
||||
self.status = status
|
||||
self.message = message
|
||||
self.headers = headers or {}
|
||||
|
||||
|
||||
def timestamp() -> str:
|
||||
return datetime.now(UTC).isoformat(timespec="microseconds").replace("+00:00", "Z")
|
||||
|
||||
|
||||
def identifier(value: str) -> str:
|
||||
try:
|
||||
return str(UUID(value))
|
||||
except (ValueError, TypeError, AttributeError):
|
||||
raise Failure(400, "Некорректный UUID") from None
|
||||
|
||||
|
||||
def boundary(scope: str, cursor: str | None) -> tuple[str, str] | None:
|
||||
if cursor is None:
|
||||
return None
|
||||
try:
|
||||
if not cursor or len(cursor) > 1024 or not re.fullmatch(r"[A-Za-z0-9_-]+", cursor):
|
||||
raise ValueError
|
||||
data = json.loads(base64.urlsafe_b64decode(cursor + "=" * (-len(cursor) % 4)))
|
||||
if not isinstance(data, list) or len(data) != 4 or data[:2] != [1, scope]:
|
||||
raise ValueError
|
||||
date, uid = data[2:]
|
||||
if not isinstance(date, str) or not date.endswith("Z"):
|
||||
raise ValueError
|
||||
datetime.fromisoformat(date.replace("Z", "+00:00"))
|
||||
if not isinstance(uid, str) or str(UUID(uid)) != uid:
|
||||
raise ValueError
|
||||
return date, uid
|
||||
except (ValueError, TypeError, KeyError, UnicodeError):
|
||||
raise Failure(400, "Некорректный cursor или область запроса") from None
|
||||
|
||||
|
||||
def page(items: list[dict], limit: int, scope: str) -> dict:
|
||||
more = len(items) > limit
|
||||
selected = items[:limit]
|
||||
cursor = None
|
||||
if more:
|
||||
last = selected[-1]
|
||||
payload = json.dumps([1, scope, last["created_at"], last["id"]], separators=(",", ":"))
|
||||
cursor = base64.urlsafe_b64encode(payload.encode()).decode().rstrip("=")
|
||||
return {"items": selected, "next_cursor": cursor}
|
||||
@@ -0,0 +1,32 @@
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
|
||||
import psycopg
|
||||
|
||||
from .config import secret
|
||||
|
||||
|
||||
def migrate():
|
||||
with psycopg.connect(secret("DATABASE_URL")) as conn:
|
||||
# Serialize independent migration processes without changing application data.
|
||||
conn.execute("SELECT pg_advisory_xact_lock(2301002)")
|
||||
conn.execute(
|
||||
"CREATE TABLE IF NOT EXISTS schema_migrations "
|
||||
"(name text PRIMARY KEY, checksum text NOT NULL)"
|
||||
)
|
||||
for path in sorted(Path("migrations").glob("*.sql")):
|
||||
checksum = hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
old = conn.execute(
|
||||
"SELECT checksum FROM schema_migrations WHERE name=%s", (path.name,)
|
||||
).fetchone()
|
||||
if old:
|
||||
if old[0] != checksum:
|
||||
raise RuntimeError("Изменена применённая миграция: " + path.name)
|
||||
continue
|
||||
conn.execute(path.read_text())
|
||||
conn.execute("INSERT INTO schema_migrations VALUES (%s,%s)", (path.name, checksum))
|
||||
print("Applied", path.name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
migrate()
|
||||
@@ -0,0 +1,51 @@
|
||||
import re
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
||||
|
||||
|
||||
class RequestModel(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
@field_validator("*", mode="after")
|
||||
@classmethod
|
||||
def nonblank(cls, value):
|
||||
if isinstance(value, str) and not value.strip():
|
||||
raise ValueError("Строка не может состоять из пробелов")
|
||||
return value
|
||||
|
||||
|
||||
class CreateUser(RequestModel):
|
||||
username: StrictStr = Field(pattern=r"^[a-z0-9_]{3,32}$")
|
||||
display_name: StrictStr = Field(min_length=1, max_length=100)
|
||||
password: StrictStr = Field(min_length=12, max_length=128)
|
||||
|
||||
@field_validator("username")
|
||||
@classmethod
|
||||
def full_username(cls, value):
|
||||
if not re.fullmatch(r"[a-z0-9_]{3,32}", value):
|
||||
raise ValueError("Неверное имя пользователя")
|
||||
return value
|
||||
|
||||
|
||||
class CreateChat(RequestModel):
|
||||
title: StrictStr = Field(min_length=1, max_length=100)
|
||||
member_ids: list[UUID] = Field(min_length=1, max_length=100)
|
||||
|
||||
@field_validator("member_ids", mode="before")
|
||||
@classmethod
|
||||
def string_ids(cls, value):
|
||||
if not isinstance(value, list) or any(not isinstance(x, str) for x in value):
|
||||
raise ValueError("Ожидается массив UUID-строк")
|
||||
return value
|
||||
|
||||
@field_validator("member_ids")
|
||||
@classmethod
|
||||
def unique_ids(cls, value):
|
||||
if len(set(value)) != len(value):
|
||||
raise ValueError("Участники не должны повторяться")
|
||||
return value
|
||||
|
||||
|
||||
class CreateMessage(RequestModel):
|
||||
text: StrictStr = Field(min_length=1, max_length=4000)
|
||||
@@ -0,0 +1,246 @@
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import secrets
|
||||
from contextlib import contextmanager
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from threading import BoundedSemaphore
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
import psycopg
|
||||
import redis
|
||||
from argon2 import PasswordHasher
|
||||
from argon2.exceptions import VerificationError
|
||||
from psycopg.rows import dict_row
|
||||
from psycopg_pool import ConnectionPool, PoolTimeout, TooManyRequests
|
||||
|
||||
from .config import secret
|
||||
from .domain import Failure, timestamp
|
||||
|
||||
logger = logging.getLogger("messenger")
|
||||
KDF_SLOTS = BoundedSemaphore(2)
|
||||
KDF = PasswordHasher(time_cost=2, memory_cost=65536, parallelism=1)
|
||||
DUMMY_HASH = KDF.hash("invalid-user-dummy-password")
|
||||
|
||||
|
||||
def public(row):
|
||||
return {
|
||||
k: (
|
||||
str(v)
|
||||
if isinstance(v, UUID)
|
||||
else v.astimezone(UTC).isoformat(timespec="microseconds").replace("+00:00", "Z")
|
||||
if isinstance(v, datetime)
|
||||
else v
|
||||
)
|
||||
for k, v in row.items()
|
||||
if k not in {"password_hash", "token_digest"}
|
||||
}
|
||||
|
||||
|
||||
class PostgresStore:
|
||||
def __init__(self):
|
||||
self.pool = ConnectionPool(
|
||||
secret("DATABASE_URL"),
|
||||
min_size=1,
|
||||
max_size=8,
|
||||
timeout=2,
|
||||
max_waiting=32,
|
||||
kwargs={
|
||||
"autocommit": True,
|
||||
"row_factory": dict_row,
|
||||
"connect_timeout": 2,
|
||||
"options": "-c statement_timeout=2500 -c lock_timeout=1500",
|
||||
},
|
||||
check=ConnectionPool.check_connection,
|
||||
)
|
||||
self.pool.wait(timeout=15)
|
||||
self.cache = redis.Redis.from_url(
|
||||
secret("CACHE_URL"),
|
||||
socket_connect_timeout=0.2,
|
||||
socket_timeout=0.2,
|
||||
decode_responses=True,
|
||||
)
|
||||
self.ttl = int(os.getenv("SESSION_TTL_SECONDS", "3600"))
|
||||
if self.ttl < 1:
|
||||
raise RuntimeError("SESSION_TTL_SECONDS должен быть положительным")
|
||||
|
||||
@contextmanager
|
||||
def connection(self):
|
||||
try:
|
||||
with self.pool.connection() as conn:
|
||||
yield conn
|
||||
except (
|
||||
psycopg.OperationalError,
|
||||
psycopg.InterfaceError,
|
||||
PoolTimeout,
|
||||
TooManyRequests,
|
||||
psycopg.errors.QueryCanceled,
|
||||
psycopg.errors.LockNotAvailable,
|
||||
):
|
||||
raise Failure(503, "Хранилище временно недоступно") from None
|
||||
|
||||
def close(self):
|
||||
self.cache.close()
|
||||
self.pool.close()
|
||||
|
||||
def ready(self):
|
||||
try:
|
||||
with self.connection() as conn:
|
||||
conn.execute("SELECT 1")
|
||||
return True
|
||||
except Failure:
|
||||
return False
|
||||
|
||||
def _cached_user(self, uid):
|
||||
key = "user:v1:" + uid
|
||||
try:
|
||||
value = self.cache.get(key)
|
||||
if value:
|
||||
cached = json.loads(value)
|
||||
if (
|
||||
isinstance(cached, dict)
|
||||
and cached.get("id") == uid
|
||||
and set(cached) == {"id", "username", "display_name", "created_at"}
|
||||
):
|
||||
return cached
|
||||
except (redis.RedisError, ValueError, TypeError):
|
||||
logger.warning(json.dumps({"event": "cache_bypass"}))
|
||||
user = self.user(uid)
|
||||
if user:
|
||||
try:
|
||||
self.cache.setex(key, 60, json.dumps(user))
|
||||
except redis.RedisError:
|
||||
logger.warning(json.dumps({"event": "cache_bypass"}))
|
||||
return user
|
||||
|
||||
def user(self, uid):
|
||||
with self.connection() as conn:
|
||||
row = conn.execute(
|
||||
"SELECT id,username,display_name,created_at FROM users WHERE id=%s", (uid,)
|
||||
).fetchone()
|
||||
return public(row) if row else None
|
||||
|
||||
def register(self, data):
|
||||
with KDF_SLOTS:
|
||||
hashed = KDF.hash(data.pop("password"))
|
||||
uid = str(uuid4())
|
||||
try:
|
||||
with self.connection() as conn:
|
||||
row = conn.execute(
|
||||
"INSERT INTO users VALUES (%s,%s,%s,%s,%s) "
|
||||
"RETURNING id,username,display_name,created_at",
|
||||
(uid, data["username"], data["display_name"], hashed, timestamp()),
|
||||
).fetchone()
|
||||
return public(row)
|
||||
except psycopg.errors.UniqueViolation:
|
||||
raise Failure(409, "Имя пользователя занято") from None
|
||||
|
||||
def login(self, username, password):
|
||||
with self.connection() as conn:
|
||||
row = conn.execute("SELECT * FROM users WHERE username=%s", (username,)).fetchone()
|
||||
try:
|
||||
with KDF_SLOTS:
|
||||
KDF.verify(row["password_hash"] if row else DUMMY_HASH, password)
|
||||
except VerificationError:
|
||||
return None
|
||||
if row is None:
|
||||
return None
|
||||
token = secrets.token_urlsafe(32)
|
||||
digest = hashlib.sha256(token.encode()).hexdigest()
|
||||
expires = datetime.now(UTC) + timedelta(seconds=self.ttl)
|
||||
with self.connection() as conn:
|
||||
conn.execute("INSERT INTO sessions VALUES (%s,%s,%s)", (digest, row["id"], expires))
|
||||
return {
|
||||
"token": token,
|
||||
"token_type": "Bearer",
|
||||
"expires_at": public({"v": expires})["v"],
|
||||
"user": public(row),
|
||||
}
|
||||
|
||||
def authenticate(self, token):
|
||||
if not token or len(token) > 512:
|
||||
return None
|
||||
digest = hashlib.sha256(token.encode()).hexdigest()
|
||||
# Session validity always comes from PostgreSQL, including on a cache hit.
|
||||
with self.connection() as conn:
|
||||
row = conn.execute(
|
||||
"SELECT s.user_id FROM sessions s WHERE s.token_digest=%s AND s.expires_at>now()",
|
||||
(digest,),
|
||||
).fetchone()
|
||||
return self._cached_user(str(row["user_id"])) if row else None
|
||||
|
||||
def logout(self, token):
|
||||
with self.connection() as conn:
|
||||
row = conn.execute(
|
||||
"DELETE FROM sessions WHERE token_digest=%s AND expires_at>now() RETURNING user_id",
|
||||
(hashlib.sha256(token.encode()).hexdigest(),),
|
||||
).fetchone()
|
||||
return row is not None
|
||||
|
||||
def create_chat(self, actor, data):
|
||||
if actor not in data["member_ids"]:
|
||||
raise Failure(400, "Вызывающий должен входить в чат")
|
||||
cid = str(uuid4())
|
||||
try:
|
||||
with self.connection() as conn, conn.transaction():
|
||||
row = conn.execute(
|
||||
"INSERT INTO chats VALUES (%s,%s,%s) RETURNING *",
|
||||
(cid, data["title"], timestamp()),
|
||||
).fetchone()
|
||||
for index, uid in enumerate(data["member_ids"]):
|
||||
conn.execute("INSERT INTO members VALUES (%s,%s,%s)", (cid, uid, index))
|
||||
return {**public(row), "member_ids": data["member_ids"]}
|
||||
except psycopg.errors.ForeignKeyViolation:
|
||||
raise Failure(400, "Неизвестный участник") from None
|
||||
|
||||
@staticmethod
|
||||
def _chat(conn, actor, cid):
|
||||
row = conn.execute(
|
||||
"SELECT c.* FROM chats c JOIN members m ON m.chat_id=c.id "
|
||||
"WHERE c.id=%s AND m.user_id=%s",
|
||||
(cid, actor),
|
||||
).fetchone()
|
||||
if row is None:
|
||||
raise Failure(404, "Объект не найден")
|
||||
members = conn.execute(
|
||||
"SELECT user_id FROM members WHERE chat_id=%s ORDER BY position", (cid,)
|
||||
).fetchall()
|
||||
return {**public(row), "member_ids": [str(m["user_id"]) for m in members]}
|
||||
|
||||
def chat(self, actor, cid):
|
||||
with self.connection() as conn:
|
||||
return self._chat(conn, actor, cid)
|
||||
|
||||
def list_chats(self, actor, after, limit):
|
||||
with self.connection() as conn:
|
||||
sql = "SELECT c.* FROM chats c JOIN members m ON m.chat_id=c.id WHERE m.user_id=%s"
|
||||
params = [actor]
|
||||
if after:
|
||||
sql += " AND (c.created_at,c.id)>(%s,%s)"
|
||||
params.extend(after)
|
||||
sql += " ORDER BY c.created_at,c.id LIMIT %s"
|
||||
params.append(limit + 1)
|
||||
rows = conn.execute(sql, params).fetchall()
|
||||
return [self._chat(conn, actor, str(row["id"])) for row in rows]
|
||||
|
||||
def send(self, actor, cid, text):
|
||||
with self.connection() as conn, conn.transaction():
|
||||
self._chat(conn, actor, cid)
|
||||
row = conn.execute(
|
||||
"INSERT INTO messages VALUES (%s,%s,%s,%s,%s) RETURNING *",
|
||||
(str(uuid4()), cid, actor, text, timestamp()),
|
||||
).fetchone()
|
||||
return public(row)
|
||||
|
||||
def history(self, actor, cid, after, limit):
|
||||
with self.connection() as conn:
|
||||
self._chat(conn, actor, cid)
|
||||
sql = "SELECT * FROM messages WHERE chat_id=%s"
|
||||
params = [cid]
|
||||
if after:
|
||||
sql += " AND (created_at,id)>(%s,%s)"
|
||||
params.extend(after)
|
||||
sql += " ORDER BY created_at,id LIMIT %s"
|
||||
params.append(limit + 1)
|
||||
return [public(row) for row in conn.execute(sql, params).fetchall()]
|
||||
@@ -0,0 +1,187 @@
|
||||
import base64
|
||||
import os
|
||||
import threading
|
||||
import uuid
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from urllib.parse import quote
|
||||
|
||||
import pytest
|
||||
from client import LAB, Client
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def scenario():
|
||||
c = Client(os.environ.get("BASE_URL", "http://127.0.0.1:8081"))
|
||||
return c, *c.bootstrap()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"body",
|
||||
[
|
||||
{"text": ""},
|
||||
{"text": " \n\t"},
|
||||
{"text": 1},
|
||||
{"text": True},
|
||||
{"text": None},
|
||||
{"text": "x", "sender_id": str(uuid.uuid4())},
|
||||
{"text": "x", "unknown": 1},
|
||||
{"text": "x" * 4001},
|
||||
{},
|
||||
[],
|
||||
],
|
||||
)
|
||||
def test_invalid_message(scenario, body):
|
||||
c, alice, _, _, chat = scenario
|
||||
c.call("POST", f"/api/v1/chats/{chat['id']}/messages", 400, actor=alice, body=body)
|
||||
|
||||
|
||||
def test_malformed_json(scenario):
|
||||
c, alice, _, _, chat = scenario
|
||||
c.call(
|
||||
"POST",
|
||||
f"/api/v1/chats/{chat['id']}/messages",
|
||||
400,
|
||||
actor=alice,
|
||||
raw=b'{"text":',
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
|
||||
|
||||
def test_acl_and_unknown_chat(scenario):
|
||||
c, alice, _, eve, chat = scenario
|
||||
for cid in [chat["id"], str(uuid.uuid4())]:
|
||||
for suffix in ["", "/messages"]:
|
||||
c.call("GET", f"/api/v1/chats/{cid}{suffix}", 404, actor=eve)
|
||||
c.call("POST", f"/api/v1/chats/{cid}/messages", 404, actor=eve, body={"text": "x"})
|
||||
c.call("GET", "/api/v1/chats/not-a-uuid", 400, actor=alice)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["ab", "UPPER", "a-b", "a" * 33, "имя", "abc\n"])
|
||||
def test_username_validation(scenario, name):
|
||||
c, alice, *_ = scenario
|
||||
body = {**alice["registration"], "username": name}
|
||||
c.call("POST", "/api/v1/users", 400, body=body)
|
||||
|
||||
|
||||
def test_unicode_and_limits(scenario):
|
||||
c, alice, _, _, chat = scenario
|
||||
text = "Ё👩💻漢字" * 500
|
||||
assert c.message(alice, chat, text)["json"]["text"] == text
|
||||
c.call(
|
||||
"POST",
|
||||
"/api/v1/users",
|
||||
400,
|
||||
body={
|
||||
**alice["registration"],
|
||||
"username": "u_" + uuid.uuid4().hex[:12],
|
||||
"display_name": " ",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["0", "101", "1.5", "true", "-1", "", "1&limit=2"])
|
||||
def test_invalid_limit(scenario, value):
|
||||
c, alice, _, _, chat = scenario
|
||||
c.call("GET", f"/api/v1/chats/{chat['id']}/messages?limit={value}", 400, actor=alice)
|
||||
|
||||
|
||||
def test_pagination_and_cursor_scope(scenario):
|
||||
c, alice, bob, _, chat = scenario
|
||||
expected = [c.message(alice, chat, str(i))["json"] for i in range(13)]
|
||||
path = f"/api/v1/chats/{chat['id']}/messages"
|
||||
result, cursor, first = [], None, None
|
||||
for i in range(20):
|
||||
url = path + f"?limit={2 if i == 0 else 3}"
|
||||
if cursor:
|
||||
url += "&cursor=" + quote(cursor, safe="")
|
||||
data = c.call("GET", url, actor=bob, schema="MessagePage")["json"]
|
||||
result += data["items"]
|
||||
cursor = data["next_cursor"]
|
||||
first = first or cursor
|
||||
if cursor is None:
|
||||
break
|
||||
assert result == sorted(expected, key=lambda m: (m["created_at"], m["id"]))
|
||||
other = c.call(
|
||||
"POST",
|
||||
"/api/v1/chats",
|
||||
201,
|
||||
actor=alice,
|
||||
body={"title": "другой", "member_ids": [alice["id"]]},
|
||||
schema="Chat",
|
||||
)["json"]
|
||||
c.call("GET", f"/api/v1/chats/{other['id']}/messages?cursor={first}", 400, actor=alice)
|
||||
c.call("GET", path + "?cursor=broken", 400, actor=alice)
|
||||
|
||||
|
||||
def test_chat_validation_and_atomicity(scenario):
|
||||
c, alice, bob, _, _ = scenario
|
||||
before = c.call("GET", "/api/v1/chats?limit=100", actor=alice, schema="ChatPage")["json"]
|
||||
for members in [
|
||||
[bob["id"]],
|
||||
[alice["id"], alice["id"]],
|
||||
[alice["id"], str(uuid.uuid4())],
|
||||
[],
|
||||
[123],
|
||||
]:
|
||||
c.call(
|
||||
"POST",
|
||||
"/api/v1/chats",
|
||||
400,
|
||||
actor=alice,
|
||||
body={"title": "не должен появиться", "member_ids": members},
|
||||
)
|
||||
after = c.call("GET", "/api/v1/chats?limit=100", actor=alice, schema="ChatPage")["json"]
|
||||
assert before == after
|
||||
|
||||
|
||||
def test_concurrent_messages(scenario):
|
||||
c, alice, bob, _, chat = scenario
|
||||
barrier = threading.Barrier(10)
|
||||
|
||||
def sender(i):
|
||||
local = Client(c.base)
|
||||
barrier.wait()
|
||||
return [local.message(alice, chat, f"{i}:{j}")["json"] for j in range(10)]
|
||||
|
||||
with ThreadPoolExecutor(max_workers=10) as pool:
|
||||
sent = [m for batch in pool.map(sender, range(10)) for m in batch]
|
||||
data = c.call(
|
||||
"GET", f"/api/v1/chats/{chat['id']}/messages?limit=100", actor=bob, schema="MessagePage"
|
||||
)["json"]
|
||||
assert len(sent) == len({m["id"] for m in sent}) == len(data["items"]) == 100
|
||||
assert {m["id"] for m in sent} == {m["id"] for m in data["items"]}
|
||||
assert data["next_cursor"] is None
|
||||
|
||||
|
||||
def test_registration_race(scenario):
|
||||
c, alice, *_ = scenario
|
||||
body = {**alice["registration"], "username": "race_" + uuid.uuid4().hex[:12]}
|
||||
barrier = threading.Barrier(10)
|
||||
|
||||
def register(_):
|
||||
local = Client(c.base)
|
||||
barrier.wait()
|
||||
return local.call("POST", "/api/v1/users", [201, 409], body=body)["status"]
|
||||
|
||||
with ThreadPoolExecutor(max_workers=10) as pool:
|
||||
statuses = list(pool.map(register, range(10)))
|
||||
assert statuses.count(201) == 1
|
||||
assert statuses.count(409) == 9
|
||||
|
||||
|
||||
@pytest.mark.skipif(LAB < 2, reason="Сессии появляются в ЛР2")
|
||||
def test_sessions(scenario):
|
||||
c, alice, _, eve, _ = scenario
|
||||
credential = base64.b64encode(
|
||||
(alice["registration"]["username"] + ":wrong-password").encode()
|
||||
).decode()
|
||||
c.call("POST", "/api/v1/auth/sessions", 401, headers={"Authorization": "Basic " + credential})
|
||||
c.call("GET", "/api/v1/users/me", 401, headers={"X-User-Id": alice["id"]})
|
||||
assert (
|
||||
c.call(
|
||||
"GET", "/api/v1/users/me", actor=alice, headers={"X-User-Id": eve["id"]}, schema="User"
|
||||
)["json"]
|
||||
== alice["user"]
|
||||
)
|
||||
c.call("DELETE", "/api/v1/auth/sessions/current", 204, actor=alice)
|
||||
c.call("GET", "/api/v1/users/me", 401, actor=alice)
|
||||
@@ -0,0 +1,99 @@
|
||||
import base64
|
||||
import json
|
||||
import os
|
||||
import uuid
|
||||
from urllib.parse import quote
|
||||
|
||||
import pytest
|
||||
from client import LAB, Client
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def edge_scenario():
|
||||
client = Client(os.environ.get("BASE_URL", "http://127.0.0.1:8081"))
|
||||
return client, *client.bootstrap()
|
||||
|
||||
|
||||
def encoded_cursor(value):
|
||||
return base64.urlsafe_b64encode(json.dumps(value).encode()).decode().rstrip("=")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("identity", ["missing", "malformed", "unknown"])
|
||||
def test_invalid_identity(edge_scenario, identity):
|
||||
client, _, _, _, chat = edge_scenario
|
||||
headers = {}
|
||||
if identity == "malformed":
|
||||
headers["X-User-Id"] = "not-a-uuid"
|
||||
elif identity == "unknown":
|
||||
headers["X-User-Id"] = str(uuid.uuid4())
|
||||
for path in ["/api/v1/users/me", "/api/v1/chats", f"/api/v1/chats/{chat['id']}/messages"]:
|
||||
client.call("GET", path, 401, headers=headers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("uid", [None, [], {}, 123, True, "not-a-uuid"])
|
||||
def test_cursor_rejects_non_uuid_boundary(edge_scenario, uid):
|
||||
client, alice, _, _, chat = edge_scenario
|
||||
payload = [1, "messages:" + chat["id"], "2026-10-30T12:00:00.000000Z", uid]
|
||||
cursor = quote(encoded_cursor(payload), safe="")
|
||||
client.call("GET", f"/api/v1/chats/{chat['id']}/messages?cursor={cursor}", 400, actor=alice)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"payload", [None, {}, [], [1], [1, "wrong-scope", "2026-10-30T12:00:00Z", str(uuid.uuid4())]]
|
||||
)
|
||||
def test_cursor_rejects_wrong_shape(edge_scenario, payload):
|
||||
client, alice, _, _, chat = edge_scenario
|
||||
cursor = quote(encoded_cursor(payload), safe="")
|
||||
client.call("GET", f"/api/v1/chats/{chat['id']}/messages?cursor={cursor}", 400, actor=alice)
|
||||
|
||||
|
||||
def test_request_id_is_present_and_not_reused(edge_scenario):
|
||||
client, alice, _, _, _ = edge_scenario
|
||||
first = client.call("GET", "/health/live", schema="Health")
|
||||
second = client.call("GET", "/health/ready", schema="Health")
|
||||
error = client.call("GET", "/api/v1/chats/malformed", 400, actor=alice)
|
||||
values = [r["headers"]["X-Request-Id"] for r in [first, second, error]]
|
||||
assert len(set(values)) == 3
|
||||
assert error["json"]["error"]["request_id"] == values[-1]
|
||||
|
||||
|
||||
def test_unicode_codepoint_boundaries(edge_scenario):
|
||||
client, alice, _, _, chat = edge_scenario
|
||||
username = "unicode_" + uuid.uuid4().hex[:12]
|
||||
registration = {"username": username, "display_name": "😀" * 100}
|
||||
if LAB >= 2:
|
||||
registration["password"] = "unicode-test-" + uuid.uuid4().hex
|
||||
user = client.call(
|
||||
"POST",
|
||||
"/api/v1/users",
|
||||
201,
|
||||
body=registration,
|
||||
schema="User",
|
||||
)["json"]
|
||||
assert user["display_name"] == "😀" * 100
|
||||
client.call(
|
||||
"POST", "/api/v1/users", 400, body={"username": username + "x", "display_name": "😀" * 101}
|
||||
)
|
||||
message = client.message(alice, chat, "😀" * 4000)["json"]
|
||||
assert message["text"] == "😀" * 4000
|
||||
client.call(
|
||||
"POST", f"/api/v1/chats/{chat['id']}/messages", 400, actor=alice, body={"text": "😀" * 4001}
|
||||
)
|
||||
|
||||
|
||||
def test_empty_history_and_cursor_exhaustion(edge_scenario):
|
||||
client, alice, _, _, chat = edge_scenario
|
||||
path = f"/api/v1/chats/{chat['id']}/messages"
|
||||
empty = client.call("GET", path, actor=alice, schema="MessagePage")["json"]
|
||||
assert empty == {"items": [], "next_cursor": None}
|
||||
message = client.message(alice, chat, "одна запись")["json"]
|
||||
data = client.call("GET", path + "?limit=1", actor=alice, schema="MessagePage")["json"]
|
||||
assert data == {"items": [message], "next_cursor": None}
|
||||
|
||||
|
||||
def test_missing_chat_is_hidden_like_foreign_chat(edge_scenario):
|
||||
client, _, _, eve, chat = edge_scenario
|
||||
foreign = client.call("GET", f"/api/v1/chats/{chat['id']}", 404, actor=eve)["json"]
|
||||
missing = client.call("GET", f"/api/v1/chats/{uuid.uuid4()}", 404, actor=eve)["json"]
|
||||
assert foreign["error"]["code"] == missing["error"]["code"] == "not_found"
|
||||
assert foreign["error"]["message"] == missing["error"]["message"]
|
||||
@@ -0,0 +1,63 @@
|
||||
import base64
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from client import Client
|
||||
|
||||
|
||||
@pytest.mark.parametrize("password", ["x" * 11, "x" * 129, "😀" * 129, 123, None, True])
|
||||
def test_password_contract(password):
|
||||
import os
|
||||
|
||||
c = Client(os.environ["BASE_URL"])
|
||||
c.call(
|
||||
"POST",
|
||||
"/api/v1/users",
|
||||
400,
|
||||
body={
|
||||
"username": "pwd_" + uuid.uuid4().hex[:12],
|
||||
"display_name": "Тест",
|
||||
"password": password,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def test_full_unicode_password_and_colon():
|
||||
import os
|
||||
|
||||
c = Client(os.environ["BASE_URL"])
|
||||
username = "pwd_" + uuid.uuid4().hex[:12]
|
||||
password = "😀" * 126 + ":Я"
|
||||
user = c.call(
|
||||
"POST",
|
||||
"/api/v1/users",
|
||||
201,
|
||||
body={"username": username, "display_name": "Пароль128", "password": password},
|
||||
schema="User",
|
||||
)["json"]
|
||||
good = base64.b64encode((username + ":" + password).encode()).decode()
|
||||
session = c.call(
|
||||
"POST",
|
||||
"/api/v1/auth/sessions",
|
||||
201,
|
||||
headers={"Authorization": "bAsIc " + good},
|
||||
raw=b"this body must be ignored",
|
||||
schema="Session",
|
||||
)["json"]
|
||||
actor = {"id": user["id"], "token": session["token"]}
|
||||
assert session["user"] == user
|
||||
bad = base64.b64encode((username + ":" + password[:-1] + "Б").encode()).decode()
|
||||
c.call("POST", "/api/v1/auth/sessions", 401, headers={"Authorization": "Basic " + bad})
|
||||
c.call("GET", "/api/v1/users/me", 401, headers={"Authorization": "Basic " + good})
|
||||
c.call("GET", "/api/v1/users/me", actor=actor, schema="User")
|
||||
c.call("DELETE", "/api/v1/auth/sessions/current", 204, actor=actor)
|
||||
c.call("GET", "/api/v1/users/me", 401, actor=actor)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("credential", ["Basic !invalid", "Basic", "Bearer abc", "", "Basic YTpi"])
|
||||
def test_invalid_basic(credential):
|
||||
import os
|
||||
|
||||
Client(os.environ["BASE_URL"]).call(
|
||||
"POST", "/api/v1/auth/sessions", 401, headers={"Authorization": credential}
|
||||
)
|
||||
@@ -0,0 +1,701 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = "==3.12.*"
|
||||
|
||||
[[package]]
|
||||
name = "annotated-doc"
|
||||
version = "0.0.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
version = "0.8.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyio"
|
||||
version = "4.15.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "idna" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "argon2-cffi"
|
||||
version = "25.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "argon2-cffi-bindings" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0e/89/ce5af8a7d472a67cc819d5d998aa8c82c5d860608c4db9f46f1162d7dab9/argon2_cffi-25.1.0.tar.gz", hash = "sha256:694ae5cc8a42f4c4e2bf2ca0e64e51e23a040c6a517a85074683d3959e1346c1", size = 45706, upload-time = "2025-06-03T06:55:32.073Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/4f/d3/a8b22fa575b297cd6e3e3b0155c7e25db170edf1c74783d6a31a2490b8d9/argon2_cffi-25.1.0-py3-none-any.whl", hash = "sha256:fdc8b074db390fccb6eb4a3604ae7231f219aa669a2652e0f20e16ba513d5741", size = 14657, upload-time = "2025-06-03T06:55:30.804Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "argon2-cffi-bindings"
|
||||
version = "26.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cffi" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0b/43/bb8b6e8708d49a5ab36781333af092d9f483b198a2710d01281204640055/argon2_cffi_bindings-26.1.0.tar.gz", hash = "sha256:63505c71542a44b68b1e38060450fb006404170da375feb31af153e7f9c6205d", size = 1790807, upload-time = "2026-08-20T07:44:22.492Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e7/d2/0ae991f1b2181e5be49007c574710a800ad36c2978683addb3e67c474e55/argon2_cffi_bindings-26.1.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:21ca0396fe5ec995dd54431c32698189666f9224810acfa752e50d2bd94d9df2", size = 25521, upload-time = "2026-08-20T07:32:43.019Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/e4/ad91d8297638aa2258aad4501c306aca99480dfe76ccd638173fa3702db9/argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:78de2d65e0b9ea7ce9d1b1c3e87297b2d7305a02c266ee2a2d6910daddd7ee69", size = 27177, upload-time = "2026-08-20T07:32:44.158Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/86/5363df11b86d02cf3662208e7406496327649cc90eb365bf6f4e8a54a41f/argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:27f1821903e2ceadcb88ec2b45ef190897b7682449c772f4d9b53e42c520cf29", size = 26597, upload-time = "2026-08-20T07:32:45.172Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/b5/a14dcc592652347dad23ee93b278a4da5d2a25c9ed3ebd10d68eea823a4f/argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d88e5f7e60f28ae0b0cc6b2f16c43e87cd642a196a86f85e0d8bb6fe016fc16d", size = 27403, upload-time = "2026-08-20T07:32:46.13Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/81/b4a20d4902af7f796390bf9245ff83c5217dfa7367efa1d14986956c482b/argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:34b7d9c24a4165a2c61cc8ae11d44d48c9ce2830fb536cb7914e11fdd9962728", size = 27132, upload-time = "2026-08-20T07:32:47.13Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/1b/c8de358af07b1c490e0fcb863ef98e46ddb486e45567aca5a60bd68d9daa/argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:224865cbbcb7a2bd1356741dff12b0134df726b6d44bb7b500df8e303cbd9e81", size = 27588, upload-time = "2026-08-20T07:32:48.087Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/2f/7ee62a6e79f9309f9d9982d301b22a00010adb580c05c8109b94d7b33de0/argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ffff613aaa9ce6236766e2fc6dc560bb5abde7a2e2416e3db1f9ae395a2b4dd4", size = 26785, upload-time = "2026-08-20T07:32:48.977Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/10/960d0ee93d4897741bcaf4799c697dae2d81499f66fd1ed042a7dd54c1f4/argon2_cffi_bindings-26.1.0-cp310-abi3-win32.whl", hash = "sha256:a86c069c91a747a2c4e5c51473590aeb48172fff9b2130d23729a42d98665ecb", size = 23898, upload-time = "2026-08-20T07:32:50.114Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/3a/0cc14a05810e6add9bce5e87693334baa2222de5f647fa31781885b6573f/argon2_cffi_bindings-26.1.0-cp310-abi3-win_amd64.whl", hash = "sha256:2c36ff87b5dfaa477d0bd51e9d7f6abdae7c8955d2983c97419085d842154b3e", size = 25730, upload-time = "2026-08-20T07:32:51.091Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/db/d83cf2af140547f0b9cdaece05b2dc2dcbf991be4667331d073eff771435/argon2_cffi_bindings-26.1.0-cp310-abi3-win_arm64.whl", hash = "sha256:f9c4420a7a864fe1b86ce35befc95b8e39fb852493b81cf798671ddc265de638", size = 24478, upload-time = "2026-08-20T07:32:52.111Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "26.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2026.10.23"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd", size = 136225, upload-time = "2026-10-23T11:36:16.478Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1", size = 135082, upload-time = "2026-10-23T11:36:14.763Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "2.1.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pycparser", marker = "implementation_name != 'PyPy'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c7/0e/7fa0ef50764b67090eca4114772a2abf8b6148198475e54c660b97caeee6/click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34", size = 382235, upload-time = "2026-08-26T13:33:14.56Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastapi"
|
||||
version = "0.162.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-doc" },
|
||||
{ name = "opentelemetry-api" },
|
||||
{ name = "pydantic" },
|
||||
{ name = "starlette" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e9/eb/2cf8c80abf09b2800aef0a83b41066fbfda8ee5495b7a08b9d1af40f7046/fastapi-0.162.0.tar.gz", hash = "sha256:6a22c1e2e6e32e0633ee7e170f00009a29b8228b16feb219ee42f32fd8d88a8f", size = 527867, upload-time = "2026-10-23T18:47:33.264Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/4f/3f2c25c9b43970b5e9a08beb5e04776247edea684ddc0930f4f02f0bb6cb/fastapi-0.162.0-py3-none-any.whl", hash = "sha256:3785963de305dd09912426cb81f2d230fce98ab3521cdfe97265c8d14983128c", size = 148912, upload-time = "2026-10-23T18:47:31.734Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h11"
|
||||
version = "0.16.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httpcore"
|
||||
version = "1.0.9"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "certifi" },
|
||||
{ name = "h11" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httpx"
|
||||
version = "0.28.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "certifi" },
|
||||
{ name = "httpcore" },
|
||||
{ name = "idna" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.20"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema"
|
||||
version = "4.26.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "jsonschema-specifications" },
|
||||
{ name = "referencing" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema-path"
|
||||
version = "0.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "pathable" },
|
||||
{ name = "pyyaml" },
|
||||
{ name = "referencing" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/39/79/cd02a4df6d9270efdc7d3feefe6edd730b0820c39eeaa107a2faee8322d5/jsonschema_path-0.5.0.tar.gz", hash = "sha256:493b156ba895c97602655b620a8456caa2ce08c1aa389f5a7addec065e6e855c", size = 19597, upload-time = "2026-05-19T20:45:00.971Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/04/2c/9e69d73c4297508be9e3b64a970ea3971b3eb8db64ffc5802d40bd25981f/jsonschema_path-0.5.0-py3-none-any.whl", hash = "sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2", size = 24077, upload-time = "2026-05-19T20:44:59.225Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema-specifications"
|
||||
version = "2025.9.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "referencing" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy-object-proxy"
|
||||
version = "1.13.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d4/8e/f26b09778fcb26261fdeb4cc2b011975292316529bff9b541a5a02acb976/lazy_object_proxy-1.13.0.tar.gz", hash = "sha256:ce34046cb021d69c72d05ddb83821ecfd4d2d0a5d43a93c5cd01c9e34779cf14", size = 45649, upload-time = "2026-10-17T16:38:01.975Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/a5/98c03827458988def73622e075486fe1ebbb85ae53ac3f21479fbfd9988c/lazy_object_proxy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:087eba19ea5ce02ea9eb1749d8fdcfb229eeeaf13abaebecf00d579d306d1fd9", size = 26808, upload-time = "2026-10-17T16:37:42.616Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c3/88/30aa37866ff9122c7b00341396781d30e27ae9d863c2698d1f42bb25a8ab/lazy_object_proxy-1.13.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3df6b7db013fbbd00001a43af6b188b545442b4d125b5fddda79366108e02286", size = 71403, upload-time = "2026-10-20T01:05:33.169Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/fa/099b2931430f87231fa31cc39893d047a1971a57fc7f90df70b9c82961a6/lazy_object_proxy-1.13.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1bdc617c7b6f58aa5e59f514c7d619d7f60b52b343b77c9149d2fbfefc412f3a", size = 70989, upload-time = "2026-10-20T01:05:34.591Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/17/87891d3fee9c03764691239745ee3f6b793062b88cf5d029bf515aa0836a/lazy_object_proxy-1.13.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:47d26b4c5a5ea2d3a1993a1c9509110beb030a2739ca69ebbe516fb04b6842b7", size = 65742, upload-time = "2026-10-20T01:05:36.015Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/9a/02acae69e1d0930f9f430d6e4ea77235c72a735672cd8d91164909815fb6/lazy_object_proxy-1.13.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e6261a9c38f629c3566ab5caec3909f5c6f3333a711c7e39f6883715aa38c566", size = 69280, upload-time = "2026-10-20T01:05:37.217Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/0e/e697f92c1a5410bddf0571077f38684b16fcf3925bb9ba5430355028e0ba/lazy_object_proxy-1.13.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:337b25ac5b0f5103c72343f74eea438ad3216b0a3cc77a3f6e4ec54c80d0256b", size = 65028, upload-time = "2026-10-20T01:05:38.378Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/4f/ec5c7f4907305086a55e9372d3deccec369b30e731b92c14d34df455cf4c/lazy_object_proxy-1.13.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:faa395d97edfafd3cd0cbd8855473c4673c7e3080fccf31f97a9bcfa7218d7ec", size = 70619, upload-time = "2026-10-20T01:05:39.551Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/23/67edce3954b280049b87dfe914fa16400c3ce2f3fa236388cf64a1bba600/lazy_object_proxy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:81437ad7883fe637620bc63a3df3e9974c9a63562e76d7e8a444fe724adccb5c", size = 25815, upload-time = "2026-10-17T16:37:43.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/21/d70d4ca285bb6ed3629ac432ea0910b8f923e50580888e37990b31f3fac9/lazy_object_proxy-1.13.0-cp312-cp312-win_arm64.whl", hash = "sha256:da66d53e0c350e6e6876f2dc060b240dc06cc159ca7f279d59fe4ed48aec2ece", size = 24467, upload-time = "2026-10-17T16:37:44.82Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mtusi-messenger"
|
||||
version = "1.0.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "argon2-cffi" },
|
||||
{ name = "fastapi" },
|
||||
{ name = "psycopg", extra = ["binary", "pool"] },
|
||||
{ name = "redis" },
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "httpx" },
|
||||
{ name = "jsonschema" },
|
||||
{ name = "openapi-spec-validator" },
|
||||
{ name = "pytest" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "argon2-cffi" },
|
||||
{ name = "fastapi" },
|
||||
{ name = "psycopg", extras = ["binary", "pool"] },
|
||||
{ name = "redis" },
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "httpx" },
|
||||
{ name = "jsonschema" },
|
||||
{ name = "openapi-spec-validator" },
|
||||
{ name = "pytest" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openapi-schema-validator"
|
||||
version = "0.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "jsonschema" },
|
||||
{ name = "jsonschema-specifications" },
|
||||
{ name = "pydantic" },
|
||||
{ name = "pydantic-settings" },
|
||||
{ name = "referencing" },
|
||||
{ name = "rfc3339-validator" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/98/e8/ab3f27dbca54ec645f7fab714b640907d5d36c2ebb07e87eebd30bd5c81b/openapi_schema_validator-0.9.0.tar.gz", hash = "sha256:b72db64315b89d21834cd3ffef37e3e6893bc876327be2d366e8424b1029afd3", size = 24686, upload-time = "2026-04-27T17:31:27.606Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/90/c0/5467967d95378b2cfce312e09cbd0c9ab64354a0922379b734f793edd04f/openapi_schema_validator-0.9.0-py3-none-any.whl", hash = "sha256:faa3bbe7c3aa8ca2087ad83f709dc3b7d920283153a570c03e24ea182558aa25", size = 19980, upload-time = "2026-04-27T17:31:25.965Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openapi-spec-validator"
|
||||
version = "0.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "jsonschema" },
|
||||
{ name = "jsonschema-path" },
|
||||
{ name = "lazy-object-proxy" },
|
||||
{ name = "openapi-schema-validator" },
|
||||
{ name = "pydantic" },
|
||||
{ name = "pydantic-settings" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/8f/d2/640b5149cd5688bc0ad1fdbb4df6a2f7b84a093c8d787c27d566132f8b8b/openapi_spec_validator-0.9.0.tar.gz", hash = "sha256:6d648cff6490ebb799dcfe273792f2941c050158854c721f086599d845da78b8", size = 1756839, upload-time = "2026-05-20T09:23:18.871Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/95/d8/321ff889330acca2e3097f3d4f80a40bcc41b6d34d302978ab32c449520b/openapi_spec_validator-0.9.0-py3-none-any.whl", hash = "sha256:222fecffc7714f6d0a6ad62c0e4b66cc2b7dbfafb7b93acfc6c308abbdb51af8", size = 50328, upload-time = "2026-05-20T09:23:17.017Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-api"
|
||||
version = "1.45.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/19/14/cf3a6b6448849656e1e5f4e2101f3988dc6789724050096aba1bc5ccf592/opentelemetry_api-1.45.2.tar.gz", hash = "sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4", size = 73277, upload-time = "2026-10-29T17:29:37.888Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/2d/610db864d7513158cebb8f36cc88e67e73bd6c7aa1905ef18d89e1281c81/opentelemetry_api-1.45.2-py3-none-any.whl", hash = "sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34", size = 60335, upload-time = "2026-10-29T17:29:06.955Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "26.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathable"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/66/f3/5a20387de9bcd0607871bfc2198ee0e15836da7baa4592ccd7f24c27c986/pathable-0.6.0.tar.gz", hash = "sha256:6404b8b82aef5ff0fd478934137128b99b12212ba35afdde5525ca4f8388ea58", size = 18970, upload-time = "2026-05-19T18:15:11.911Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/e8/6d75ffd9784bce2e93d1ae4415649427e39a53bb172d4672b2b59c6f0a7b/pathable-0.6.0-py3-none-any.whl", hash = "sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566", size = 18983, upload-time = "2026-05-19T18:15:10.728Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg"
|
||||
version = "3.3.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "tzdata", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/76/26/3ea4ca5eaea1c0debcdf7ee7c1613fbe721dc27a03c461c0817ffd8a0601/psycopg-3.3.6.tar.gz", hash = "sha256:c081f2250df751a943036e42db6df4571c66cd0aabe8291a7a506512b12007d2", size = 168171, upload-time = "2026-09-18T13:22:55.152Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/de/748bd7609c71cae5d737f0ba9192f19329f70180ecda8fff3cac02c5abe3/psycopg-3.3.6-py3-none-any.whl", hash = "sha256:a1db9f7148b06a28606767efaca51fa6f9398c5c0a3810519be69d7000bdb631", size = 215490, upload-time = "2026-09-18T13:15:29.374Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
binary = [
|
||||
{ name = "psycopg-binary", marker = "implementation_name != 'pypy'" },
|
||||
]
|
||||
pool = [
|
||||
{ name = "psycopg-pool" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-binary"
|
||||
version = "3.3.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/01/2cdd1824e58b4467ee0b9498664cd28c42d8794db6b1e35b6bcb834f0044/psycopg_binary-3.3.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3f84dab25e0385692ee13274c68678377e0b1a70ab9d14e56264cbf61f60c62d", size = 4707086, upload-time = "2026-09-18T13:18:05.138Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/76/de9948ac06895261c84d5b9fbe283d8f3c5bc9f070691b8d9eaa1b51e322/psycopg_binary-3.3.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:612382ac3ed13651c7fa44b5fee9fbf7baaa2ddbc6f500391672682c5f1df9e0", size = 4769607, upload-time = "2026-09-18T13:18:12.83Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/a9/72436c9915ee4905964689e7f0e182ce7767cc0a0390b3ce703be8177625/psycopg_binary-3.3.6-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:366db6e97e66b37211475f20c4c1324a2dc0dd825e46d4e87f9d599304d276f9", size = 5554134, upload-time = "2026-09-18T13:18:21.175Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/42/948bb3d2617795093512613fd96ba380e922992c7908fbc073858147d196/psycopg_binary-3.3.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1679a1cb93fbe5a6d1fd58d82cbddcc6fcb8c61446ba7cae6eb2a7b19bc585de", size = 5235723, upload-time = "2026-09-18T13:18:27.071Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/47/93e823ff1b0088400703410939c9bda3e63ed9c850b3ee088e8769f4c10b/psycopg_binary-3.3.6-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:37d40450659401600e6d043ff586c89a71a69f33cbb8bcdba6cdb2569beecdbe", size = 6833587, upload-time = "2026-09-18T13:18:33.794Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5e/2d/ecc69c847795aa704041a9f5667a6b0938a088cf1853636d762a6938e493/psycopg_binary-3.3.6-cp312-cp312-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a5165300324efd5a772c48a88ab3a928513ab3979fca76553e62ee815f7b2b9c", size = 5070013, upload-time = "2026-09-18T13:18:39.628Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/36/6126f0dac21713dcae91404f2a76da18598a6252339a8c669c46370d43b2/psycopg_binary-3.3.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d636338c8f21b0df2f84657b00bc34f9313f826ef93f1155bc743607e4a0c5eb", size = 4597367, upload-time = "2026-09-18T13:18:45.023Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4d/29/7ecfc04243b46c89ffd49924e9c5634ea904ef96c7d0f37e4073623584c1/psycopg_binary-3.3.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a4ee3bdd5468a725f2a4d9aab8a74b6d0279f768c8b5d3aeb102c5307ff3d59c", size = 4275419, upload-time = "2026-09-18T13:18:49.299Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6e/90/2f46d2e0de79706ac170df0a3637fe63c4498fc04f131f6049520b78b806/psycopg_binary-3.3.6-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:289aadd6a00e151203c081f708348ec89f1e483c9b510ef4ac3981f847f01f79", size = 4007358, upload-time = "2026-09-18T13:18:53.944Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/48/6744e91291b751a8cf12d63d719977974bb94c84ceba913e7ddb2e478e51/psycopg_binary-3.3.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f21d057f3e5f5491067e5b292498073b73847d48799b099803fef100775fcc52", size = 4320156, upload-time = "2026-09-18T13:18:59.258Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/9b/94ff7fce53a64d5b286e2ec454e0a025cf3d6e6b4a9189bef16aa5de98b2/psycopg_binary-3.3.6-cp312-cp312-win_amd64.whl", hash = "sha256:e23a66a763fbe83fcc210bc77c27e5a5ea380ebf091c06f34d8561b695e5a40f", size = 3658864, upload-time = "2026-09-18T13:19:06.503Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-pool"
|
||||
version = "3.3.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/74/5e/c0664b968b102ff68b811d999c728546c48d5c1eec03e3bbaf88c0cb4472/psycopg_pool-3.3.3.tar.gz", hash = "sha256:df87b5d9d0ad7db37f6cdad4fa8ce113d250f5997f6db38e9a99192fb67f9e1d", size = 32006, upload-time = "2026-09-22T15:53:24.947Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/b4/452c6607a0f479465cd8a9b0d9956919fcb150050c1f83f9f11e6b8ee8dc/psycopg_pool-3.3.3-py3-none-any.whl", hash = "sha256:9b9cd6a4fcec47a410f7e82d408540e7f77b478509e91b44c1a5457a13e5ff37", size = 40304, upload-time = "2026-09-22T15:53:23.712Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "3.12"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cb/27/eeb9f307bf07060f3d9f9aa0fb8c15b01bdfded0a941e4b2719c7f94cacd/pycparser-3.12.tar.gz", hash = "sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6", size = 158785, upload-time = "2026-10-22T13:40:03.56Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b6/ae/315bbeee126a769cbde43cf4908acb4b40408d8bf8bbf334dd7368d8dadf/pycparser-3.12-py3-none-any.whl", hash = "sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e", size = 62600, upload-time = "2026-10-22T13:40:02.021Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.14.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-types" },
|
||||
{ name = "pydantic-core" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9f/d5/b4867fa7c7f04c34997d7d8aad744f64d210bb99d67cf18bf3fb1eea1aed/pydantic-2.14.2.tar.gz", hash = "sha256:fb7b2db6cefe8414dd612edeede49c4c433acb0432b0f92b95024e45f66c505d", size = 911596, upload-time = "2026-10-29T16:37:12.476Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/97/01/c71a71258b58659c72504e5fd65b451f6e36e34dc931d0b237ded213c814/pydantic-2.14.2-py3-none-any.whl", hash = "sha256:7efbf7507b937931cd32a5755acb00ea1cf5ccb1d4e8067a5850d5069e382118", size = 490403, upload-time = "2026-10-29T16:37:10.181Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-core"
|
||||
version = "2.50.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/af/8e/23ec1021834e35041fbb2f10946141e6acdfd39379c45cc4d65a4e8a1d98/pydantic_core-2.50.2.tar.gz", hash = "sha256:1b0e8dc3932cf4e9ed5727570325cacc716b9409ffc794a221c0ccc72e8eb775", size = 518711, upload-time = "2026-10-29T16:34:57.465Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/65/6609a66cda909d414c58438f9bd70b1e947fe12c25f6bd40c93121afd7ef/pydantic_core-2.50.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e3d824b6152e1c0fd58dc6266f2de470eb7b2286135294f5f7cd26a0f0693738", size = 2220341, upload-time = "2026-10-29T16:32:10.193Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/0b/92463ae7be78d73885487f72c4599902c2cc190378bccaad5718b7495250/pydantic_core-2.50.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:596921489390a002d6a5e303384a0f1f98384f8bb550fbf38a1aafa6093da0f9", size = 2093701, upload-time = "2026-10-29T16:32:11.502Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/62/d3/24147a1aa22f7eade546172750e1110fd7b2793998057809800d3ebeae4e/pydantic_core-2.50.2-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:36d8b9725684ca3bf658b90a101d335fc8cae405bb22196b7b5ef41344913756", size = 2253622, upload-time = "2026-10-29T16:32:13.051Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/50/2628ca3c83a0d9a6fda3305fe59b1b28e40c0221e8f234cd1ef86fb64745/pydantic_core-2.50.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:43a8fd56f3c681f3cda2d5c842ad28e88241df742dfcbe8fd1dd437a3056e1f6", size = 2114101, upload-time = "2026-10-29T16:32:14.702Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/c8/cc6d7304a93f91f5e06260ccad71cc7d882489663a37dec009532379fc46/pydantic_core-2.50.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:6f5a432c6c1ef18a1a02a04b3616b8d3f2f88b13faa46caae1ac6559ab202234", size = 2199541, upload-time = "2026-10-29T16:32:16.153Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/d9/18f44ac5696b3e2b2384cb89c9fbe6ed69860f528e232b9fb46cc5b45a17/pydantic_core-2.50.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:5d3cd8be71c4da3c9b42cc92f17e5e3036bdca98bf18555a0e072c3fe87abbb4", size = 2368597, upload-time = "2026-10-29T16:32:17.544Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/22/5f2a48ef819a7e1b74fb003a85d27576ad2f9ddf3901b88998ac63ce1e00/pydantic_core-2.50.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6a438cb8a3f87f2c49e82e43fb19511d4d5043f53e0787dc4df937ccb904373a", size = 2451701, upload-time = "2026-10-29T16:32:18.956Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/93/2a6556bbdb8e918175af9d849a5d0b367b5644e41939d040f3a7215b1339/pydantic_core-2.50.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9667637665acba166a7dbbc786f14c50512d3a01f7199e0e1a13b929e92d7c7a", size = 2242782, upload-time = "2026-10-29T16:32:20.381Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/ed/dd9f29a92257f32eb5b99d5120826186ee0632ecc3aaf6c23e2fab89ed6d/pydantic_core-2.50.2-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:b3e681208e2d39fde13fbea449ef2736a85ec1ea2afa41e9193a8c536e71dafe", size = 2253706, upload-time = "2026-10-29T16:32:22.293Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/11/19/1ccf3bf38eb4ed97d8aeefc558458834ae0ad53fdbb1edf61af7228ea500/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6eb6ff07964f39e33c6f57fefe939514e76b8c0d4a694e5663e2e04e80cc1798", size = 2288603, upload-time = "2026-10-29T16:32:23.465Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/cd/bae2320fc89a65bcd87bf66ec83aac51b3b43b970a2edece15feb8af64dd/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:4eb54c25e3463d73e1e4ed439ffc45d1d7e590df40bc7bb06f11a906afd996c3", size = 2476597, upload-time = "2026-10-29T16:32:24.824Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/35/1bdb8d52c8e562e95c5e6ebb5784792af568ac6a81470dd546d95f392b60/pydantic_core-2.50.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:91238117cd296352f54f24117ff5a227bdea428865dba1244aa0cdd1424c0bc2", size = 2478664, upload-time = "2026-10-29T16:32:26.197Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/72/0179b40ac6a6b0899c61826f2e3e80f88063f6d821e0dd9641927de46700/pydantic_core-2.50.2-cp312-cp312-win32.whl", hash = "sha256:98722314e12a8e4fa346e0afd3fff2098b5732875ff45592b450a7b589b43c4f", size = 2108820, upload-time = "2026-10-29T16:32:27.736Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/fb/679144362d7e5162519d9f6631ec982521417de3196351c6c56485f5b29f/pydantic_core-2.50.2-cp312-cp312-win_amd64.whl", hash = "sha256:b381574614245f18fdb2d6d1aa8f149e225869c47b5ee7f81812de8977817314", size = 2252238, upload-time = "2026-10-29T16:32:29.572Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/68/e3ccc885c3e2086ff84d7ca496f45b974a9f0a49ce2da8973aaa3a369a4b/pydantic_core-2.50.2-cp312-cp312-win_arm64.whl", hash = "sha256:f07c965a8aa6d62145f122641f292129984f39a3e3697585b19298a1488287db", size = 2162565, upload-time = "2026-10-29T16:32:30.853Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/4d/23560b11366b547e3e68a3b8f9c02557cee707effa54fd39dbb3c4fff1fa/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:d18d56c1ec63b304f4bb3c7db7e0d311e61cca1b1c944590a4b13ac39b2ca92b", size = 2204868, upload-time = "2026-10-29T16:34:34.745Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/58/b9ddfaad189143d6568627166a730b6624ca90bd9a9a4af4854df88d444b/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:41ed8abeffda6a880207fdc0cd1343a448cec3cc6b38b53f730c0745f745292d", size = 2049162, upload-time = "2026-10-29T16:34:36.186Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/20/99d259bf7835b2f13c6d0b3eb7bcf669fb6349986736fa7a8308a9e620b0/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b7abcfaf66c1dc14c5ed928c349614f223c972a8b021b4be9548dbea6c817371", size = 2112135, upload-time = "2026-10-29T16:34:37.777Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/ca/652c8fe599abacafd852479059d209e608596ad3de82f1bff22e9f0f02fe/pydantic_core-2.50.2-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9e7460abce637f90e37f8c443559fbd687c38884d05cb69ef265e634945f4324", size = 2270339, upload-time = "2026-10-29T16:34:39.039Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-settings"
|
||||
version = "2.16.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pydantic" },
|
||||
{ name = "python-dotenv" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d0/31/21d21e0e38a8f5f7a7f0cde22820117b6d17d6bc36f348129527f915d7f4/pydantic_settings-2.16.2.tar.gz", hash = "sha256:3dc08ffabed2bbd5dc2dd55ead7b78b4e4c5cd776aecd04310db5f1224caaf46", size = 309225, upload-time = "2026-10-28T11:14:28.066Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/39/88/4131c51ff87b7cd7f82a1194d0c0a2b7ca68c72d9da04c3b7e69ab91a79f/pydantic_settings-2.16.2-py3-none-any.whl", hash = "sha256:8d523e5c129b097686bde019bd6109bff53f4c8c3f63f1ddf9933ffa42e5ab4f", size = 81994, upload-time = "2026-10-28T11:14:26.716Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.21.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "9.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "iniconfig" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pluggy" },
|
||||
{ name = "pygments" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-dotenv"
|
||||
version = "1.2.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/74/26/2fbeedb218a787a5eea551c7532cac4e009f83d689dd2faa0d0353473f86/python_dotenv-1.2.4.tar.gz", hash = "sha256:f0d53e69935a851c0dcc78f3ab7aaccd8cabef0b92382b576b824212902873c0", size = 60824, upload-time = "2026-10-01T05:36:10Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/60/d1/38f3a3405989a89ac18390803e70c6ad7c7760da4f9b83cbeca0c44a0c72/python_dotenv-1.2.4-py3-none-any.whl", hash = "sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc", size = 23266, upload-time = "2026-10-01T05:36:08.633Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyyaml"
|
||||
version = "6.0.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redis"
|
||||
version = "8.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a8/99/604f0b666d4c616d891cf77ebb9db6bb21601344c051aebf1b72b9ff915f/redis-8.1.0.tar.gz", hash = "sha256:6e1a19beef9225c83efd689c7e6b7da2d5215b1f42cd13b7fc3714d0a09c7b25", size = 5254356, upload-time = "2026-07-30T08:51:00.269Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/66/9d/c5731f6e3608663d4d3656fd8d3aecee8b509c3082818f5a13eae925baea/redis-8.1.0-py3-none-any.whl", hash = "sha256:a4fe1aac3d3b3cc791d4b3d5931c5a956045dc951ee74d1c913ee3ac4d2ee9fb", size = 560618, upload-time = "2026-07-30T08:50:58.497Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "referencing"
|
||||
version = "0.37.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "rpds-py" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc3339-validator"
|
||||
version = "0.1.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "six" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/28/ea/a9387748e2d111c3c2b275ba970b735e04e15cdb1eb30693b6b5708c4dbd/rfc3339_validator-0.1.4.tar.gz", hash = "sha256:138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b", size = 5513, upload-time = "2021-05-12T16:37:54.178Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/44/4e421b96b67b2daff264473f7465db72fbdf36a07e05494f50300cc7b0c6/rfc3339_validator-0.1.4-py2.py3-none-any.whl", hash = "sha256:24f6ec1eda14ef823da9e36ec7113124b39c04d50a4d3d3a3c2859577e7791fa", size = 3490, upload-time = "2021-05-12T16:37:52.536Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rpds-py"
|
||||
version = "2026.9.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/42/68/3bd46b8a5e01d3c2ebdf9c5e9497912e3fe0cde02bac21a7130ca866e403/rpds_py-2026.9.1.tar.gz", hash = "sha256:4793ef7f78268b124b73fa933440f01d258bbae01de9fa53e9080c9ab0425a12", size = 63948, upload-time = "2026-10-04T16:32:36.469Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/34/a828586ea3329fbb50895b50e9cf98ca3d924a9f41a0b26d443bff1b3794/rpds_py-2026.9.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:50906f5aea24b5a865cbd0a589698288631d9f3a54c3a937c83aefa95a0d14af", size = 346822, upload-time = "2026-10-04T16:29:16.258Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/81/ac6a0d064982251856ce009c9e1dd51a34110b3c055aa7d1aad18b4899a3/rpds_py-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e21c1429e205828ea886a2293a4a2c8e01f4c25d9893ca330e97a6cf73f52e7b", size = 341380, upload-time = "2026-10-04T16:29:17.706Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/ff/bf7d54f362748fd6a49277b9d6531c394074110fedf50ad791ec59133fbb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2693b2728bbcc48d09a981a356954b0c47c53ff25b545856f28a889ea619f69a", size = 373053, upload-time = "2026-10-04T16:29:19.063Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/de/74b0ccdbbd28687b9b5fdb34c1cabed88352182facaced9d6f5486b8b9ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8601470267d938bcb7f3ab1a336100af51a4fd5b6ed030ef52461bb3ef5e7e07", size = 377742, upload-time = "2026-10-04T16:29:20.543Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/6d/b979775a3057b2a5c26d75ecbff60a20a24ef081db6dd76836fca3f20247/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3890a6aa36e6baa53d5258a2a25d3ef8b37ad165a6ab27a892d7c3e3a432cd69", size = 487289, upload-time = "2026-10-04T16:29:21.958Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/5d/7c34734ce3ece943d9d6ee0122a74a21bbc75b47acb5b7053c83f6efb1ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b5b393eda5ea42cca1c1a6665f2a4882b4fd5d1777e41ce0545a107fb008c9d", size = 390710, upload-time = "2026-10-04T16:29:23.378Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/6d/b26eb1e75395925b3a142ed351cbed2ec8212f5c9d937aee3df32c701baa/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab", size = 371261, upload-time = "2026-10-04T16:29:25.1Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/98/b2fdfe10301a9e27af21e634337fbba7baac0bc17fe44619a17c26bba2cb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:d9edf30457d74eebfd76b045535e36f1cd89062566a128a0db2145ca042d787e", size = 376075, upload-time = "2026-10-04T16:29:26.748Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c5/b1/c4b8d954e49c3c69cf8063c0c9e0919c99f3d2cecc46311606a1cbe835dc/rpds_py-2026.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:815d26356930846a40c7bc1366e7b1b0320ab8a063e66c11298a208bed0fd237", size = 399358, upload-time = "2026-10-04T16:29:28.282Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/59/9559a7293c97dff0cbb293efffbd36644103883ecc27741af8ef90c84ca8/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3b5a6f40f0a1486b4b36c888123afc67acdbd9f33235927acf5ff295429a0ba3", size = 550267, upload-time = "2026-10-04T16:29:29.851Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6c/9d/6dc60e49511de4c8b00e74f9c1d43aed4d27f712cdb1ade92f2c199cbf64/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b5b8b0753718d258fd454283fbd57e14545d3b40583fa672e27cb4f987626bcc", size = 614018, upload-time = "2026-10-04T16:29:31.54Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/bc/92a4ecf27301b886232a413360f6b348a81d55ffef654f2ebda5970ebc3d/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:46d80bc76b51a6c24f9944368c28d38b8bcbcea1da4f2f8d3ebc31a67e8c6ec6", size = 578509, upload-time = "2026-10-04T16:29:33.01Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/53/efb97f2e6589b7ab8394385a73870e0b2ab2a195281c117b21fd6d7d4855/rpds_py-2026.9.1-cp312-cp312-win32.whl", hash = "sha256:befc2d6a953e563f8a7bfd87a42c22ebf8a3e980dcb7b6a4d17b70b0e914e8a3", size = 205401, upload-time = "2026-10-04T16:29:34.451Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1c/84/1700cc748d0eaa747486e4e82882d2575224e6e9a3148df583058850c629/rpds_py-2026.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:5ce8943f79c2210f7abcc28e86367b03b28d95027fd01c46d2472373ae70c86f", size = 222923, upload-time = "2026-10-04T16:29:35.709Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c3/89/0302215373c2f8b4408b0fdfee955368cc378a98ff59508d47a7e0dc2dbf/rpds_py-2026.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:501909f2e4a1e2dee528ef766fe3c469060ebc17e54a8383d404ba07a81a6f02", size = 218415, upload-time = "2026-10-04T16:29:37.263Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a3/90/a9ba81408369d34c1aca73319c15adc91ed45c1d21e9e8ee4832ffb7fe0b/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cdc537c8633d7fd92a82e2e0d2ab74320a3f63d5e59fb9cf08711e08fe151c4", size = 381109, upload-time = "2026-10-04T16:32:08.994Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/44/5192a0bed94cec86bd2a5e1cc5a1bb8f7eec3aec907eacd2deb13e87e326/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:10e208f2425d973938afcd56e28a7c4be32e27b6a60b5d381f49fb9d8acf9759", size = 388222, upload-time = "2026-10-04T16:32:11.321Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/cd/5356549711448f18b52f7a11ffbe90f1228774996fbf3c6cd1b18d22abaf/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c0dbbcc19735fe5f8b0a54c07659d154a9e69f47e15d0a6ab7299215daf62cb", size = 500384, upload-time = "2026-10-04T16:32:13.478Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7a/88/ddda9d28adfe33119c75b2e733d4ba7e326f41d7e1b1093951771768ca48/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:684fd492fff4fead00587544e059be2bbcb6f93454f21fa2a91b66fc7508be82", size = 401661, upload-time = "2026-10-04T16:32:15.653Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/32/c3/bb59ba16a6b4a57995d15b8c04c00f28df3b938c4dcdde48fbe0f73edb0c/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1028417bb44037eb3069c1009bd7b7277212876cda22fbe565b0bca9fab6d2c", size = 380748, upload-time = "2026-10-04T16:32:17.727Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f5/b8/0580faa1c5a32ddc160130dd7ae54d2d007272a89a40a6b5db3e50f9f585/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:492e5e428cbe126221611f47e068f01660352feec4ad18bc0f5ea9b2ae88fb14", size = 385731, upload-time = "2026-10-04T16:32:19.855Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/70/f73564642bbe3322c7eeef2c2f258cf040b71c41a430b532e59d04a1b838/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:88b5268892fde430d5531f95bc560b6efbbd67c929662c586afd729a96e7461c", size = 412131, upload-time = "2026-10-04T16:32:22.285Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/5d/17fff2e1f8f68721a2afb5cb48f7e442c751bb6b4883157c5abaf618cd08/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:01445c8d194aa032a08e944f16567672da1c62dbdbefd8b6d0693032e290cf68", size = 558193, upload-time = "2026-10-04T16:32:24.4Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/d0/869ab6fb08531f97aae4a780b4d61b4190d8aef48fe054ee28bcf7114466/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_i686.whl", hash = "sha256:eef6a03b0b6d08d0835ccfa8ec8d1bc70525e3801387567137b50c557695e6da", size = 622448, upload-time = "2026-10-04T16:32:26.844Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/a5/9672e532fe02cd3b92c78cfd8743abca939d96853006c63835009a1ecb6f/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6b9bf3135b4ad5981df9a73d71a35272d650a2985ae9c2746357b24d59de2448", size = 591126, upload-time = "2026-10-04T16:32:29.274Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/ef/3a9f8e4279c7920af561deed4cb7ebebed2794a8f608cf404d5eef14a105/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_10_12_x86_64.whl", hash = "sha256:56c6952a9b15047466d0c2347c446a761d4527f89976156341e68f0ce5cc08b0", size = 357108, upload-time = "2026-10-04T16:32:31.641Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/55/4b2fa381a583760aea5c92841e4e928a358e1c6511b129219e9c2826a226/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:b242c27c8f836305a4a72df9cdd564386ac57b807bd252a063223331c9316b37", size = 346877, upload-time = "2026-10-04T16:32:34.061Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.17.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/59/73/81f140c4edd9cc323de5478e6bbd3bbcfae9a82692df1a258de8cec6a6d2/ruff-0.17.3.tar.gz", hash = "sha256:a57049c8addb3662073859bb55a7ad35aa54f8a7c9ed268911d1333c5aadaaa9", size = 5339444, upload-time = "2026-10-27T00:34:05.914Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/8c/083365310c4e79c842f25bf5a842facbd9b0c0ec336f96dffa5074fe723d/ruff-0.17.3-py3-none-linux_armv6l.whl", hash = "sha256:ab86b84cd9d05e56d329742c0cabdcbe2d1d56c98f4a04aab9b5b66196febfb4", size = 10216522, upload-time = "2026-10-27T00:33:29.822Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/26/4b2edf31cfebe9605d8f6ed8f1d6f376d3a53d4c9a123e62661c64c440f0/ruff-0.17.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e407b4a6852853a9a2cdce96963e94ad9775578bb44e7561a0f2829f3cc04b11", size = 10217786, upload-time = "2026-10-27T00:33:33.949Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/7e/537aba4b7f54397a374d2f6a6fc93e9c8015e18553f31a4a7b7dbced48b5/ruff-0.17.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b75cc113b3aca388933d8296b667b1ac401a80317ea3074c9b0a66541199da29", size = 9440362, upload-time = "2026-10-27T00:33:35.784Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/66/283e39734f66c8a5ebaa93c22eb7b7515779a0b1d5a5c0ad20e05c0edb41/ruff-0.17.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab5fa7ed5ce18554ea69d850ad162cbaa0c85fc47c08d83a569f806681c9a6ad", size = 10094281, upload-time = "2026-10-27T00:33:38.216Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/4c/1ffc768497bd025a32c72152771e40c0b99bddc5cc6e4f50c7949a395346/ruff-0.17.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c673c170e27834d1262e3a9c1e97bdc9b9c3b180c63d89173ce69747232474c1", size = 10022543, upload-time = "2026-10-27T00:33:40.181Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/c3/f90db547301080fcb82c92abf914c8bd57b89911d9b65a6c4cc6b52d0635/ruff-0.17.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a754c0341bc9ca151b7b335988b3263921c08859f84ca219b70cee825571b6f", size = 10683921, upload-time = "2026-10-27T00:33:42.182Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e5/98/92d4a8a26c6c96cf1a5b34dd59036d8a71e52d650aab065c58867e964e63/ruff-0.17.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4590b9d86c0b1543ebb09094254e191cd43fe8edaf330baa035aab03da251532", size = 11373408, upload-time = "2026-10-27T00:33:44.19Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/02/1f24d2e3064c9753926deeb901afa57777b37ee46799b09ddd7aee6e5145/ruff-0.17.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bbde18beccd98c29a227c63c99022e3443b99258e08326df6425dfe0443705ef", size = 10977469, upload-time = "2026-10-27T00:33:46.179Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/20/fecedea2209f574ab92033b344e01a7f0c2dc76c6d6d19a14c9f8141173f/ruff-0.17.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fa4b0f931cdbcb8a52044f370a3eb429fb42eb88807b0e800fcaa98dd42b24e", size = 10577491, upload-time = "2026-10-27T00:33:48.233Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/33/36/b93fdf0bc6f84f0cd487aadfb0354deb40013669ea35ac3d26855de1e959/ruff-0.17.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:39405f341deec934b4289634324ad695f72df2970f9121582872eaf5b722f0f5", size = 10608748, upload-time = "2026-10-27T00:33:50.284Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/b7/7d3f5f14145daead1efb0b9a8289ed1daa100f419d60774375951723ce00/ruff-0.17.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:68074094f55ca3d29ab19491f640282f7a84061c4c7977aa5094b968ca457e9a", size = 10075057, upload-time = "2026-10-27T00:33:52.074Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b0/ed/93ff7a5909ee56e2bd4b982deae9e0efb2724417874a90c9e41ad66c6dd7/ruff-0.17.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:27bb571ac78fef178fe5118d2827df95c2aae74a48fff2b15f6acd03af5ff5bb", size = 10022431, upload-time = "2026-10-27T00:33:54.061Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/07/a83b9eeec8c1c3c0e4eda15f06c3a91001bfd2687ea2f07b750719bf9712/ruff-0.17.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:029c37cbd3de48ca37aa12117bead2d065f15da17d66bf84e0d4274013705db2", size = 10394903, upload-time = "2026-10-27T00:33:56.158Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/af/b2/05c39857c2526fcbebe46ad93a8dc97424656dfef14d3ef933abe1ffd331/ruff-0.17.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:692fdb46d0fd9c71e380947dc5fc72f2c3f881073bc1f739e4579376231affbe", size = 10799780, upload-time = "2026-10-27T00:33:58.204Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ec/d9/47171a16739eb7a353936b31c20cf54340531e68c9af7d72fd7a784e235d/ruff-0.17.3-py3-none-win32.whl", hash = "sha256:46539cb031b01fd29ae0a02142483c46640b233ee12bb1c1b690bffa1555d5ca", size = 9908481, upload-time = "2026-10-27T00:34:00.087Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/a0/f08c1631bfd81faa6a90eaf70c37c786c11bed2046302b56bb506c25e1a0/ruff-0.17.3-py3-none-win_amd64.whl", hash = "sha256:56b8ffb3f3b3cbccb8b76b71b38261b7ed982ef5d20f5b447b1b61a7f4949b24", size = 10341333, upload-time = "2026-10-27T00:34:02.099Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/d5/4ad4ed31413c301430918e70d3d38ae6f097af0766cb9ab8c9d502b2a4d6/ruff-0.17.3-py3-none-win_arm64.whl", hash = "sha256:81fce74bcd6be0e9da7c67c7553fd0f1f12964a2052cd728ef917b937a5ca1d9", size = 9854332, upload-time = "2026-10-27T00:34:03.847Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.17.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "starlette"
|
||||
version = "1.10.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/48/bb/3d8757f21e9a53d9035c9eb039a777047139a16bfdbedfc7a58241c3d914/starlette-1.10.0.tar.gz", hash = "sha256:b8399098d4c1e3522734f7235dc79b1fc967f96cf139c81e0fa30479e0685f9b", size = 2734356, upload-time = "2026-10-24T15:04:12.342Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/88/2e/947cfe02def9371c07cd5bf5b6b61c829e9aecb9904db02a66cfafbc1eec/starlette-1.10.0-py3-none-any.whl", hash = "sha256:478c0ab3b4ced6e82719849c118fa406f0278a3499c1a898cd15cd31bdc38ce4", size = 80571, upload-time = "2026-10-24T15:04:10.371Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.16.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-inspection"
|
||||
version = "0.4.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tzdata"
|
||||
version = "2026.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7a/29/6a1391d31cd00ff9e927215a224a880e1e84e826b64ba80a499e51c074d8/tzdata-2026.6.tar.gz", hash = "sha256:85d2cd9c09f81f0bb29db27759fc83af4f1e620efb814f8c5bf8b4cc4feece6d", size = 201017, upload-time = "2026-10-28T09:57:09.137Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/66/9a06c2227fedfd4919f0eaaa8b94377d9730882a7e4f95823c9a331ab5e1/tzdata-2026.6-py2.py3-none-any.whl", hash = "sha256:0a10eec6e13ef16b627fabed9a5f2ba61a62b1c67f327305f4e7e412a70b4aec", size = 348210, upload-time = "2026-10-28T09:57:07.276Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uvicorn"
|
||||
version = "0.54.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
{ name = "h11" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/da/34/30e9280707135d2cfc589dfff3cb796bd07a3aeb1a3e415ba09dd89d7bb4/uvicorn-0.54.0.tar.gz", hash = "sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620", size = 112283, upload-time = "2026-09-25T06:52:37.601Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/38/0c/b54a4fdd7f90a3af8b02ebc9ce6712c2c208b7926a2f7bad95c33ebbe943/uvicorn-0.54.0-py3-none-any.whl", hash = "sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf", size = 87427, upload-time = "2026-09-25T06:52:35.829Z" },
|
||||
]
|
||||
Reference in New Issue
Block a user