Carry over the lab 3 fixes made after 61c0c28
Bring the system changes of lab 3 from 61c0c28..72a1e57 onto the lab 4 code, resolving each conflict by meaning and keeping everything lab 4 added: - a message is posted with one SQL statement under the chat row lock, and the attachment links go into the same statement; a foreign key violation on the attachment link still answers 404 and leaves nothing behind. Text and the attachment list are checked before the write, an outsider gets 404 for both, as before the carry over; - the request pipeline counts the body bytes actually received against the limit of the route, so a chunked body over 1 MiB gets 413 and the upload route keeps its MAX_UPLOAD_BYTES limit; - a request cancelled at shutdown gets 503 unavailable in the contract format, the worker waits a second less than the rest of the shutdown budget, SHUTDOWN_TIMEOUT_SECONDS becomes 6 s and the stop hooks 7 s; - readiness sits behind a Readiness port with the draining flag in shared infrastructure, and the drain window is logged through Logger; - logout revokes through SessionRevocations and withdraws the mark when PostgreSQL rejects the delete; an empty cursor is 400; - EventBus.project is gone, the sweep test subscribes and waits on a queue; domain tests check attachment_list instead of Chat.post; - make up waits for every replica in the balancer, BASE_URL follows the lb port, the image is tagged by the compose project, retry-check and faults-evidence are added, detection runs three times, failover-each and rolling-update record the stand usage, CI checks numeric uids. down also takes the tools and reconcile profiles of lab 4. Track 1 tooling of lab 3 (scaling.py, its samplers, tools/ and the CPU pinning of api, lb, valkey and k6) stays out; stand-usage.sh queries the database size itself instead of the track 1 sampler. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7ac1a4a11b
commit
e927afdb09
@@ -48,6 +48,9 @@ jobs:
|
||||
- name: Несколько реплик на одном токене и гонка одного ключа
|
||||
run: make lb-check
|
||||
|
||||
- name: Повтор неподтверждённой записи после потерянного ответа и убитой реплики
|
||||
run: make retry-check
|
||||
|
||||
- name: Остановка реплики под запросами, затем возврат
|
||||
run: |
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
@@ -72,7 +75,9 @@ jobs:
|
||||
|
||||
- name: Процессы работают не от root
|
||||
run: |
|
||||
docker compose top | awk 'NR>1 && $3=="0" {print; bad=1} END {exit bad}'
|
||||
for id in $(docker compose ps -q); do
|
||||
docker top "$id" -eo pid,uid,comm | awk 'NR>1 && $2==0 {print; bad=1} END {exit bad}' || exit 1
|
||||
done
|
||||
|
||||
- name: Корректная остановка реплик API по SIGTERM
|
||||
run: |
|
||||
|
||||
@@ -8,23 +8,26 @@ Skeleton лабораторной 4 курса «Мессенджер под н
|
||||
|
||||
```sh
|
||||
make check # offline: структура skeleton, JSON, локальные $ref, синтаксис Python, версия 1.4.0
|
||||
make validate PYTHON=.venv/bin/python # полная валидация OpenAPI 3.1 (venv с requirements-dev.txt)
|
||||
make validate # полная валидация OpenAPI 3.1: openapi-spec-validator из .venv (make install); PYTHON= — свой интерпретатор
|
||||
make install # uv sync --group dev
|
||||
make lint # ruff check + ruff format --check + ty check; обязательно перед commit
|
||||
make student-test # собственные тесты (поднимают одноразовые PostgreSQL, Valkey и RustFS в Docker)
|
||||
make student-test PYTEST_ARGS='-v -k drain' # выборка тестов с именами
|
||||
|
||||
make secrets # локальные secrets/* (включая root и API-ключи S3) и .env из .env.example
|
||||
make up # docker compose up -d --build --wait: postgres, valkey, s3 → migrate, s3-init → api ×2 → lb
|
||||
make test # публичный smoke через LB (BASE_URL, по умолчанию http://localhost:8080)
|
||||
make up # docker compose up -d --build --wait: postgres, valkey, s3 → migrate, s3-init → api ×2 → lb; затем ждёт все реплики UP в LB
|
||||
make test # публичный smoke через LB (BASE_URL по умолчанию — docker compose port lb 8080, без стенда http://localhost:8080)
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh # рестарт lb, api, postgres, valkey, s3 с сохранением volumes
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh # остановка реплики TARGET_INSTANCE_ID под запросами
|
||||
make test-faults # тесты стенда через LB (make faults-evidence → evidence/faults.txt)
|
||||
make restore # вернуть остановленные реплики и дождаться их в ротации LB
|
||||
make retry-check # потерянный ответ (запись ждёт блокировку чата) на живой и на убитой реплике, повтор тем же ключом
|
||||
make scenario SCENARIO=failover-upload # upload → стоп обслужившей реплики → download через другую, SHA-256
|
||||
make scenario SCENARIO=s3-outage # S3 остановлен: upload/download 503, тексты работают
|
||||
make s3-check # приватный bucket вне API, ограниченные ключи API, консоль, повторный bootstrap
|
||||
make upload-faults # «4»: негативный suite через LB, компенсация, уборка после grace, обрыв и зависание тела
|
||||
make upload-memory # «4»: пик памяти реплик и LB при 10/20/40 одновременных загрузках 1 и 10 MiB
|
||||
make down # остановка без удаления данных; make reset-data — намеренное удаление volumes
|
||||
make down # остановка без удаления данных (с профилями bench, tools, reconcile); make reset-data — удаление volumes
|
||||
```
|
||||
|
||||
`tests/*.py` и `scripts/*.py` — только stdlib, синтаксис Python 3.9 (`make check` разбирает их системным `python3`). Проверки сами не поднимают стенд. Хуки `scripts/stop-one.sh` и `scripts/restart.sh` запускаются тестом без shell, поэтому исполняемые и с shebang. Данные не удаляются автоматически: каждый прогон smoke создаёт новых синтетических пользователей и вложения.
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ ENV PYTHONUNBUFFERED=1 \
|
||||
WEB_CONCURRENCY=2 \
|
||||
REQUEST_TIMEOUT_SECONDS=8 \
|
||||
DRAIN_SECONDS=2 \
|
||||
SHUTDOWN_TIMEOUT_SECONDS=5
|
||||
SHUTDOWN_TIMEOUT_SECONDS=6
|
||||
|
||||
RUN groupadd --system --gid 10001 messenger \
|
||||
&& useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
BASE_URL ?= http://$(shell docker compose port lb 8080 2>/dev/null || echo localhost:8080)
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
@@ -8,17 +8,18 @@ VENV ?= .venv
|
||||
UV ?= uv
|
||||
COMPOSE ?= docker compose
|
||||
RATE ?= 100
|
||||
API_IMAGE ?= mtusi-messenger:lab4
|
||||
FROM_REV ?=
|
||||
SHIFT ?= 0
|
||||
SCRIPTS_PY = scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py \
|
||||
scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
SCENARIO ?= failover-upload
|
||||
PSQL = $(COMPOSE) exec -T postgres psql -U messenger -d messenger -X -q
|
||||
PYTEST_ARGS ?=
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover \
|
||||
install lint format typecheck student-test \
|
||||
secrets up down reset-data migrate ps logs restore lb-check failover-evidence stack-evidence \
|
||||
persistence-evidence storage-evidence cache-evidence test-faults seed explain \
|
||||
persistence-evidence storage-evidence cache-evidence test-faults faults-evidence seed explain retry-check \
|
||||
limits detection failover-each rolling-update level4 \
|
||||
scenario s3-check attachments-evidence upload-faults upload-memory \
|
||||
reconcile reconcile-demo reconcile-cost
|
||||
@@ -28,6 +29,7 @@ help:
|
||||
@echo "install/lint/typecheck/student-test: студенческий тулчейн"
|
||||
@echo "secrets/up/down/migrate/ps/logs: стенд Docker Compose; reset-data: намеренное удаление volumes"
|
||||
@echo "restore: вернуть остановленные реплики; lb-check: реплики на одном токене и 20 гонок одного ключа"
|
||||
@echo "retry-check: потерянный ответ на живой и на убитой реплике, повтор тем же ключом"
|
||||
@echo "level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "scenario SCENARIO=failover-upload|s3-outage → evidence/<сценарий>.json; s3-check; attachments-evidence"
|
||||
@echo "upload-faults: негативный suite, компенсация, уборка, обрыв и зависание загрузки против стенда"
|
||||
@@ -35,10 +37,12 @@ help:
|
||||
@echo "reconcile ARGS='--apply --deep': сверка PostgreSQL ↔ S3 (без ARGS — dry-run); трек 2:"
|
||||
@echo "reconcile-demo: внедрение ошибок, dry-run/apply/повтор, безопасность, нагрузка → evidence/reconcile/"
|
||||
@echo "reconcile-cost: стоимость обхода 1k/10k/30k объектов × 3 прогона на чистом стенде → evidence/reconcile/cost/"
|
||||
@echo "BASE_URL=$(BASE_URL) (порт lb из docker compose); failover-evidence SHIFT=1 — сдвиг round robin на вторую реплику"
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
|
||||
validate: PYTHON := $(if $(wildcard $(VENV)/bin/python),$(VENV)/bin/python,$(PYTHON))
|
||||
validate:
|
||||
$(PYTHON) scripts/validate_openapi.py
|
||||
|
||||
@@ -72,20 +76,21 @@ typecheck:
|
||||
$(VENV)/bin/ty check src student-tests
|
||||
|
||||
student-test:
|
||||
$(VENV)/bin/pytest
|
||||
$(VENV)/bin/pytest $(PYTEST_ARGS)
|
||||
|
||||
secrets:
|
||||
sh scripts/secrets.sh
|
||||
|
||||
up: secrets
|
||||
$(COMPOSE) up -d --build --wait
|
||||
scripts/lb-wait.sh
|
||||
|
||||
down:
|
||||
$(COMPOSE) down
|
||||
$(COMPOSE) --profile bench --profile tools --profile reconcile down
|
||||
|
||||
reset-data:
|
||||
@echo "Удаляются volumes с учебными данными стенда"
|
||||
$(COMPOSE) down -v --remove-orphans
|
||||
$(COMPOSE) --profile bench --profile tools --profile reconcile down -v --remove-orphans
|
||||
|
||||
migrate:
|
||||
$(COMPOSE) run --rm migrate
|
||||
@@ -102,19 +107,23 @@ restore:
|
||||
lb-check:
|
||||
$(PYTHON) scripts/probe.py check --rounds 20 --out evidence/lb-check.json
|
||||
|
||||
retry-check:
|
||||
$(PYTHON) scripts/probe.py retry --out evidence/retry.json
|
||||
|
||||
limits:
|
||||
$(PYTHON) scripts/limits.py --out evidence/limits.txt
|
||||
|
||||
detection:
|
||||
sh scripts/detection.sh evidence/detection
|
||||
rm -rf evidence/detection
|
||||
for run in 1 2 3; do sh scripts/detection.sh evidence/detection/run$$run || exit 1; done
|
||||
|
||||
failover-each:
|
||||
RATE=$(RATE) sh scripts/failover-each.sh evidence/failover-each
|
||||
|
||||
rolling-update:
|
||||
ifneq ($(FROM_REV),)
|
||||
git archive "$(FROM_REV)" | docker build -q -t "$(API_IMAGE)" -
|
||||
$(COMPOSE) up -d --no-deps --force-recreate --wait api
|
||||
git archive "$(FROM_REV)" | docker build -q -t "mtusi-messenger:$(FROM_REV)" -
|
||||
API_IMAGE="mtusi-messenger:$(FROM_REV)" $(COMPOSE) up -d --no-deps --force-recreate --wait api
|
||||
scripts/lb-wait.sh
|
||||
endif
|
||||
$(COMPOSE) build -q api
|
||||
@@ -153,7 +162,7 @@ reconcile-cost:
|
||||
$(PYTHON) scripts/reconcile_track.py cost $(ARGS)
|
||||
|
||||
failover-evidence:
|
||||
sh scripts/failover-evidence.sh "$(BASE_URL)"
|
||||
sh scripts/failover-evidence.sh "$(BASE_URL)" "$(SHIFT)"
|
||||
|
||||
stack-evidence:
|
||||
sh scripts/evidence-stack.sh
|
||||
@@ -172,6 +181,12 @@ cache-evidence:
|
||||
test-faults:
|
||||
BASE_URL="$(BASE_URL)" $(VENV)/bin/pytest -m stack -v -s student-tests/stack
|
||||
|
||||
faults-evidence:
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD)"; echo "\$$ make test-faults"; \
|
||||
$(MAKE) --no-print-directory test-faults 2>&1; } | sed 's#$(CURDIR)#<repo>#g' > evidence/faults.txt
|
||||
cat evidence/faults.txt
|
||||
grep -qE '^=+ [0-9]+ passed in' evidence/faults.txt
|
||||
|
||||
seed:
|
||||
$(PSQL) -f - < scripts/sql/seed-history.sql
|
||||
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
x-app: &app
|
||||
image: ${API_IMAGE:-mtusi-messenger:lab4}
|
||||
image: ${API_IMAGE:-mtusi-messenger:${COMPOSE_PROJECT_NAME}}
|
||||
networks: [backend]
|
||||
|
||||
x-s3-env: &s3-env
|
||||
@@ -81,7 +81,7 @@ services:
|
||||
DB_ACQUIRE_TIMEOUT_SECONDS: ${DB_ACQUIRE_TIMEOUT_SECONDS:-1}
|
||||
DB_COMMAND_TIMEOUT_SECONDS: ${DB_COMMAND_TIMEOUT_SECONDS:-2}
|
||||
DRAIN_SECONDS: ${DRAIN_SECONDS:-2}
|
||||
SHUTDOWN_TIMEOUT_SECONDS: ${SHUTDOWN_TIMEOUT_SECONDS:-5}
|
||||
SHUTDOWN_TIMEOUT_SECONDS: ${SHUTDOWN_TIMEOUT_SECONDS:-6}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
MALLOC_MMAP_THRESHOLD_: ${MALLOC_MMAP_THRESHOLD_:-131072}
|
||||
secrets: [database_url, cache_url, cursor_secret, s3_access_key_id, s3_secret_access_key]
|
||||
@@ -91,7 +91,7 @@ services:
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
start_interval: 1s
|
||||
start_interval: 200ms
|
||||
stop_grace_period: 8s
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
@@ -160,6 +160,7 @@ services:
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 10s
|
||||
start_interval: 200ms
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks: [backend]
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
## 1. Код
|
||||
|
||||
- [ ] 1.1 Платформа: предел тела по принятым байтам маршрута, отмена при остановке → `503`, порт `Readiness`, `service.draining` через `Logger`, `EventBus` без проекций, без `shutdown_timeout_seconds`
|
||||
- [ ] 1.2 Identity: порт `SessionRevocations`, `revoke`/`restore`, `NoRevocations`
|
||||
- [ ] 1.3 Messaging: `PostgresMessageLog` одной командой со ссылками на вложения, порядок проверок текста и вложений, пустой `cursor` → `400`
|
||||
- [ ] 1.4 Процесс: `SHUTDOWN_TIMEOUT_SECONDS` 6 с, `STOP_TIMEOUT` 7 с, `timeout_graceful_shutdown` на 1 с меньше остатка
|
||||
- [ ] 1.5 Проверка группы: `make lint`, `make check`, `make validate`
|
||||
- [x] 1.1 Платформа: предел тела по принятым байтам маршрута, отмена при остановке → `503`, порт `Readiness`, `service.draining` через `Logger`, `EventBus` без проекций, без `shutdown_timeout_seconds`
|
||||
- [x] 1.2 Identity: порт `SessionRevocations`, `revoke`/`restore`, `NoRevocations`
|
||||
- [x] 1.3 Messaging: `PostgresMessageLog` одной командой со ссылками на вложения, порядок проверок текста и вложений, пустой `cursor` → `400`
|
||||
- [x] 1.4 Процесс: `SHUTDOWN_TIMEOUT_SECONDS` 6 с, `STOP_TIMEOUT` 7 с, `timeout_graceful_shutdown` на 1 с меньше остатка
|
||||
- [x] 1.5 Проверка группы: `make lint`, `make check`, `make validate`
|
||||
|
||||
## 2. Тесты
|
||||
|
||||
- [ ] 2.1 Тесты лабы 3: `chunked`, посторонний и блокировка, порядок проверок, сбой БД при выходе, запись без кэша, пустой курсор, часы истории, зависший запрос при `SIGTERM`, состав ядра `shared`
|
||||
- [ ] 2.2 Тесты лабы 4: проверки `attachment_list` вместо `Chat.post`, уборка через `subscribe`
|
||||
- [ ] 2.3 Стенд: полный рестарт с выходом, срок сессии после рестарта
|
||||
- [ ] 2.4 Проверка группы: `make student-test`
|
||||
- [x] 2.1 Тесты лабы 3: `chunked`, посторонний и блокировка, порядок проверок, сбой БД при выходе, запись без кэша, пустой курсор, часы истории, зависший запрос при `SIGTERM`, состав ядра `shared`
|
||||
- [x] 2.2 Тесты лабы 4: проверки `attachment_list` вместо `Chat.post`, уборка через `subscribe`
|
||||
- [x] 2.3 Стенд: полный рестарт с выходом, срок сессии после рестарта
|
||||
- [x] 2.4 Проверка группы: `make student-test`
|
||||
|
||||
## 3. Обвязка
|
||||
|
||||
- [ ] 3.1 `Makefile`: `BASE_URL` по порту `lb`, `validate` из `.venv`, `PYTEST_ARGS`, `up` ждёт LB, `down` с профилями, `retry-check`, `faults-evidence`, `detection` трижды, `rolling-update` по тегу ревизии, `SHIFT`
|
||||
- [ ] 3.2 `compose.yaml`, `Dockerfile`, `pyproject.toml`/`uv.lock`, CI
|
||||
- [ ] 3.3 `scripts/`: `probe.py retry`, `stand-usage.sh`, `stop-one`, `detection`, `rolling-update`, `failover-each`, `failover-evidence`, `evidence-cache`, `evidence-storage`, `limits.py`
|
||||
- [ ] 3.4 `AGENTS.md`, `openspec/config.yaml`
|
||||
- [ ] 3.5 Проверка группы: стенд из чистого состояния, `make test`, `make test-failover`, `make test-persistence`, `make test-faults`, `probe.py retry`, `detection`, `scenario failover-upload` (вывод — во временный каталог)
|
||||
- [x] 3.1 `Makefile`: `BASE_URL` по порту `lb`, `validate` из `.venv`, `PYTEST_ARGS`, `up` ждёт LB, `down` с профилями, `retry-check`, `faults-evidence`, `detection` трижды, `rolling-update` по тегу ревизии, `SHIFT`
|
||||
- [x] 3.2 `compose.yaml`, `Dockerfile`, `pyproject.toml`/`uv.lock`, CI
|
||||
- [x] 3.3 `scripts/`: `probe.py retry`, `stand-usage.sh`, `stop-one`, `detection`, `rolling-update`, `failover-each`, `failover-evidence`, `evidence-cache`, `evidence-storage`, `limits.py`
|
||||
- [x] 3.4 `AGENTS.md`, `openspec/config.yaml`
|
||||
- [x] 3.5 Проверка группы: стенд из чистого состояния, `make test`, `make test-failover`, `make test-persistence`, `make test-faults`, `probe.py retry`, `detection`, `scenario failover-upload` (вывод — во временный каталог)
|
||||
|
||||
@@ -56,12 +56,14 @@ context: |
|
||||
|
||||
main.py сборка приложения: собирает вклады зон в один процесс, связывает зоны портами
|
||||
migrate.py одноразовая точка входа: применяет SQL-миграции под advisory lock
|
||||
gunicorn_conf.py конфигурация процесса: воркеры, окно вывода из ротации по SIGTERM
|
||||
(флаг вывода — shared/infrastructure/readiness)
|
||||
identity/ пользователи, пароли и сессии
|
||||
messaging/ чаты, история и идемпотентная отправка, ссылки сообщения на вложения
|
||||
attachments/ вложения: метаданные, проверка изображения, порт объектного хранилища и его
|
||||
адаптер S3, свой HTTP-слой upload, метаданных и скачивания
|
||||
shared/ только платформа: часы, id, журнал, пул PostgreSQL, UoW-база, конвейер, health,
|
||||
ошибки, настройки, идентификатор реплики
|
||||
shared/ только платформа: часы, id, журнал, пул PostgreSQL, UoW-база, готовность за
|
||||
портом Readiness, конвейер, health, ошибки, настройки, идентификатор реплики
|
||||
|
||||
Стрелки указывают внутрь: `domain/` не импортирует инфраструктуру, `application/` зависит только
|
||||
от портов, адаптеры подключаются в `ioc.py` зоны. Ядро `shared/` не импортирует веб-фреймворк.
|
||||
@@ -70,6 +72,10 @@ context: |
|
||||
зоны к другой (членство в чате) — порт зоны-потребителя, адаптер которого собирает `main.py`.
|
||||
Реплика не держит состояния, от которого зависит корректность: PostgreSQL — источник истины для
|
||||
всего, включая метаданные вложений; S3 — источник истины только для байтов; Valkey — кэш сессий.
|
||||
Отправка сообщения — одна команда SQL адаптера `PostgresMessageLog` за портом `MessageLog`:
|
||||
блокировка строки чата, членство, отметка времени, квитанция ключа, сообщение и ссылки на
|
||||
вложения фиксируются вместе; агрегат `Chat` в записи не участвует, эти правила держат SQL и
|
||||
интеграционные тесты.
|
||||
|
||||
## Источники норм
|
||||
- `contracts/README.md` — нормативная семантика API, включая «Вложения (с lab4)».
|
||||
@@ -134,7 +140,7 @@ operations:
|
||||
- "Роутер, провайдер DI, журнал, отображение ошибок и настройки зоны лежат в её `entrypoints/` и `config.py`."
|
||||
- "Ядро `shared/` (domain, application, infrastructure) не импортирует веб-фреймворк: транспорт живёт только в `shared/entrypoints/` и в `entrypoints/` зон."
|
||||
- "Отдельного каталога точек входа на верхнем уровне не заводи: общее кладётся в `shared/`, доменное — в зону, сборка и связывание зон портами — в `main.py`."
|
||||
- "Зоны не импортируют модули друг друга, кроме объявления события, — это проверяется тестом; в БД связь зон — только внешний ключ, SQL зоны читает лишь свои таблицы."
|
||||
- "Зоны не импортируют модули друг друга, включая объявления событий, — это проверяется тестом; в БД связь зон — только внешний ключ, SQL зоны читает лишь свои таблицы."
|
||||
- "Пиши под Python 3.14 с ленивыми аннотациями: без `TYPE_CHECKING` и без `from __future__ import annotations`."
|
||||
- "Логирование — только через порт `Logger`; второй логгер в приложении не заводится. Object key, ключи S3 и содержимое файлов в журнал не пишутся."
|
||||
- "Код приложения — в `src/`, конфигурация LB, нагрузки и S3 — в `infra/`, собственные тесты — в `student-tests/`, обезличенные доказательства — в `evidence/`."
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ dev = [
|
||||
"httpx>=0.28.0",
|
||||
"ruff>=0.14.0",
|
||||
"ty>=0.0.1a21",
|
||||
"openapi-spec-validator==0.7.2",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
@@ -111,7 +112,7 @@ possibly-missing-attribute = "warn"
|
||||
testpaths = ["student-tests"]
|
||||
asyncio_mode = "auto"
|
||||
asyncio_default_fixture_loop_scope = "function"
|
||||
addopts = "-q --strict-markers -m 'not stack'"
|
||||
addopts = "--strict-markers -m 'not stack'"
|
||||
markers = [
|
||||
"stack: black-box проверки против поднятого compose-стенда (make test-faults)",
|
||||
]
|
||||
|
||||
@@ -8,7 +8,7 @@ replica() { docker compose ps -q "${API_SERVICE:-api}" | head -1; }
|
||||
detect() { python3 scripts/probe.py detect "$@"; }
|
||||
failed=0
|
||||
detect --max 1.5 --within-action --restore scripts/restore.sh --out "$out/sigterm.json" \
|
||||
-- docker stop -t "${STOP_TIMEOUT:-6}" "$(replica)" || failed=1
|
||||
-- docker stop -t "${STOP_TIMEOUT:-7}" "$(replica)" || failed=1
|
||||
detect --max 1.5 --restore scripts/restore.sh --out "$out/kill.json" \
|
||||
-- docker kill "$(replica)" || failed=1
|
||||
hung=$(replica)
|
||||
|
||||
@@ -11,14 +11,25 @@ cli "info persistence" | grep -E '^aof_enabled|^aof_last_write_status'
|
||||
echo "\$ valkey-cli dbsize; info stats | grep keyspace"
|
||||
cli dbsize
|
||||
cli "info stats" | grep -E '^keyspace_(hits|misses)'
|
||||
key=$(cli "--scan --pattern session:* --count 1000" | head -1)
|
||||
hash=${key#session:}
|
||||
echo "\$ сравнение срока ключа кэша и срока сессии для одного ключа (значение и токен не печатаются)"
|
||||
echo "valkey pexpiretime, ms: $(cli "pexpiretime $key")"
|
||||
echo "postgres expires_at, ms: $(psql "SELECT (extract(epoch FROM expires_at) * 1000)::bigint FROM sessions WHERE token_hash = decode('$hash', 'hex')")"
|
||||
echo "\$ количество отметок отзыва и закэшированных сессий"
|
||||
revoked=0; cached=0
|
||||
echo "\$ valkey-cli --scan --pattern 'session:*' и вид значения (хеш сокращён, значения не печатаются)"
|
||||
revoked=0; cached=0; key=""; stored=""
|
||||
for k in $(cli "--scan --pattern session:* --count 1000"); do
|
||||
if [ "$(cli "get $k")" = "-" ]; then revoked=$((revoked + 1)); else cached=$((cached + 1)); fi
|
||||
if [ "$(cli "get $k")" = "-" ]; then
|
||||
revoked=$((revoked + 1)); printf '%.16s… отметка отзыва "-"\n' "$k"; continue
|
||||
fi
|
||||
cached=$((cached + 1)); printf '%.16s… сессия\n' "$k"
|
||||
if [ -z "$key" ]; then
|
||||
stored=$(psql "SELECT (extract(epoch FROM expires_at) * 1000)::bigint FROM sessions WHERE token_hash = decode('${k#session:}', 'hex')")
|
||||
if [ -n "$stored" ]; then key=$k; fi
|
||||
fi
|
||||
done
|
||||
echo "tombstones: $revoked, cached sessions: $cached"
|
||||
if [ "$revoked" -eq 0 ] || [ -z "$key" ]; then
|
||||
echo "нужны закэшированная сессия из БД и отметка отзыва: сначала make test" >&2
|
||||
exit 1
|
||||
fi
|
||||
expires=$(cli "pexpiretime $key")
|
||||
echo "\$ срок ключа кэша против срока сессии для $(printf '%.16s' "$key")…"
|
||||
echo "valkey pexpiretime, ms: $expires"
|
||||
echo "postgres expires_at, ms: $stored"
|
||||
if [ "$expires" -le "$stored" ]; then echo "ключ не переживает сессию: да"; else echo "ключ не переживает сессию: НЕТ"; exit 1; fi
|
||||
|
||||
@@ -4,7 +4,7 @@ cd "$(dirname "$0")/.."
|
||||
psql() { docker compose exec -T postgres psql -U messenger -d messenger -c "$1"; }
|
||||
header() { echo "date: $(date -u +%FT%TZ) commit: $(git rev-parse --short HEAD)"; }
|
||||
counts="SELECT (SELECT count(*) FROM users) users, (SELECT count(*) FROM sessions) sessions, (SELECT count(*) FROM chats) chats, (SELECT count(*) FROM chat_members) members, (SELECT count(*) FROM messages) messages, (SELECT count(*) FROM idempotency_keys) keys, (SELECT count(*) FROM attachments) attachments, (SELECT count(*) FROM message_attachments) links, (SELECT count(*) FROM schema_migrations) versions"
|
||||
kdf="SELECT substring(password_hash from '^[$]argon2id[$]v=[0-9]+[$]m=[0-9]+,t=[0-9]+,p=[0-9]+[$]') AS kdf_prefix, count(*) AS users, min(length(password_hash)) AS hash_length FROM users GROUP BY 1"
|
||||
kdf="SELECT substring(password_hash from '^[$]argon2id[$]v=[0-9]+[$]m=[0-9]+,t=[0-9]+,p=[0-9]+[$]') AS kdf_prefix, username = 'seed_author' AS seed_stub, count(*) AS users, min(length(password_hash)) AS min_length, max(length(password_hash)) AS max_length FROM users GROUP BY 1, 2 ORDER BY 2"
|
||||
tokens="SELECT octet_length(token_hash) AS stored_bytes, count(*) AS sessions FROM sessions GROUP BY 1"
|
||||
{
|
||||
header
|
||||
@@ -38,7 +38,8 @@ tokens="SELECT octet_length(token_hash) AS stored_bytes, count(*) AS sessions FR
|
||||
echo "(пусто: секретов, .env, дампов и volumes в Git нет)"
|
||||
echo "\$ git check-ignore -v secrets/database_url secrets/postgres_password secrets/s3_root_password secrets/s3_secret_access_key .env backups/"
|
||||
git check-ignore -v secrets/database_url secrets/postgres_password secrets/s3_root_password secrets/s3_secret_access_key .env backups/
|
||||
echo "\$ docker volume ls --filter name=mtusi2026lab4"
|
||||
docker volume ls --filter name=mtusi2026lab4
|
||||
project=$(docker compose config --format json | python3 -c 'import json,sys; print(json.load(sys.stdin)["name"])')
|
||||
echo "\$ docker volume ls --filter label=com.docker.compose.project=$project"
|
||||
docker volume ls --filter "label=com.docker.compose.project=$project"
|
||||
} > evidence/secrets.txt
|
||||
echo "evidence/{schema,migrations,kdf,secrets}.txt обновлены"
|
||||
|
||||
@@ -10,7 +10,7 @@ failed=0
|
||||
set --
|
||||
for host in $hosts; do
|
||||
TARGET_INSTANCE_ID=$host python3 scripts/probe.py load --expect dip --out "$out/$host" \
|
||||
-- sh -c "scripts/stop-one.sh && sleep ${HOLD:-10} && scripts/restore.sh" || failed=1
|
||||
-- sh -c "scripts/stop-one.sh && docker compose ps -a --format '{{.ID}} {{.Service}} {{.Status}}' ${API_SERVICE:-api} && { scripts/stand-usage.sh & sleep ${HOLD:-10}; wait; } && scripts/restore.sh" || failed=1
|
||||
scripts/restore.sh
|
||||
set -- "$@" "$out/$host/result.json"
|
||||
done
|
||||
|
||||
@@ -4,6 +4,9 @@ cd "$(dirname "$0")/.."
|
||||
replicas() {
|
||||
docker inspect -f '{{.Config.Hostname}} {{.State.Status}} started={{.State.StartedAt}} finished={{.State.FinishedAt}}' $(docker compose ps -aq "${API_SERVICE:-api}")
|
||||
}
|
||||
url=${1:-http://localhost:8080}
|
||||
shift=0
|
||||
while [ "$shift" -lt "${2:-0}" ]; do curl -fsS -o /dev/null "$url/health/live"; shift=$((shift + 1)); done
|
||||
tmp=evidence/failover.tmp
|
||||
since=$(date -u +%FT%TZ)
|
||||
{
|
||||
@@ -11,14 +14,14 @@ since=$(date -u +%FT%TZ)
|
||||
echo "== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt"
|
||||
replicas
|
||||
echo "\$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh"
|
||||
make --no-print-directory test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL="${1:-http://localhost:8080}"
|
||||
make --no-print-directory test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL="$url"
|
||||
echo "== after: api replicas"
|
||||
replicas
|
||||
} > "$tmp" 2>&1
|
||||
stopped=$(replicas | awk '$2 == "exited" {print $1}')
|
||||
{
|
||||
echo "== stopped replica: $stopped; shutdown: signal, drain window with readiness 503, close, exit"
|
||||
docker logs --since "$since" "$stopped" 2>&1 | grep -E 'Handling signal|Draining|"status":503|Shutting down|Waiting for conn|Finished server|service.stopped|SIGTERM' | tail -16
|
||||
docker logs --since "$since" "$stopped" 2>&1 | grep -E 'Handling signal|service.draining|"status":503|Shutting down|Waiting for conn|Finished server|service.stopped|SIGTERM' | tail -16
|
||||
echo "\$ scripts/restore.sh"
|
||||
scripts/restore.sh
|
||||
echo "== after restore"
|
||||
|
||||
+2
-1
@@ -140,7 +140,8 @@ def main():
|
||||
if not any(row[0] == "api" for row in containers):
|
||||
problems.append("no running api replicas to inspect")
|
||||
lines = [
|
||||
f"date: {time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())}",
|
||||
f"date: {time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())} "
|
||||
f"commit: {run('git', 'rev-parse', '--short', 'HEAD')[1]}",
|
||||
"$ docker compose --profile bench --profile tools --profile reconcile config --format json"
|
||||
" (declared)",
|
||||
*table(["service", "cpus/mem", "ports", "secrets", "volumes", "networks", "ro"], services),
|
||||
|
||||
@@ -12,10 +12,13 @@ import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
COUNTERS = ("wretr", "wredis", "econ", "eresp", "hrsp_5xx")
|
||||
PSQL = ["docker", "compose", "exec", "-T", "postgres", "psql", "-U", "messenger", "-d", "messenger"]
|
||||
PSQL += ["-X", "-q", "-At"]
|
||||
|
||||
|
||||
@functools.cache
|
||||
@@ -207,6 +210,101 @@ def check(args):
|
||||
return 0 if passed else 1
|
||||
|
||||
|
||||
def output(*command):
|
||||
done = subprocess.run(command, cwd=str(ROOT), capture_output=True, text=True, check=False)
|
||||
return done.stdout + done.stderr
|
||||
|
||||
|
||||
def replicas():
|
||||
ids = output("docker", "compose", "ps", "-q", os.environ.get("API_SERVICE", "api")).split()
|
||||
form = "{{.Id}} {{.Config.Hostname}} {{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}"
|
||||
return [line.split() for line in output("docker", "inspect", "-f", form, *ids).splitlines()]
|
||||
|
||||
|
||||
def answered(container, request_id):
|
||||
for line in output("docker", "logs", container).splitlines():
|
||||
if request_id in line and "request.handled" in line:
|
||||
return json.loads(line).get("status")
|
||||
return None
|
||||
|
||||
|
||||
def lost(alice, bob, chat, kill, args):
|
||||
key, text = uuid.uuid4().hex, "lost " + uuid.uuid4().hex
|
||||
request_id = "lost-" + key[:12]
|
||||
lock = subprocess.Popen(
|
||||
PSQL, cwd=str(ROOT), stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True
|
||||
)
|
||||
lock.stdin.write(
|
||||
f"BEGIN;\nSELECT 'locked' FROM chats WHERE id = '{uuid.UUID(chat)}' FOR UPDATE;\n"
|
||||
f"SELECT pg_sleep({args.hold});\nCOMMIT;\n"
|
||||
)
|
||||
lock.stdin.flush()
|
||||
lock.stdout.readline()
|
||||
sent = time.time()
|
||||
headers = dict(alice["auth"], **{"Idempotency-Key": key, "X-Request-Id": request_id})
|
||||
path = f"/api/v1/chats/{chat}/messages"
|
||||
first = call("POST", path, {"text": text}, headers, args.timeout)[0]
|
||||
sql = "SELECT host(client_addr) FROM pg_stat_activity WHERE wait_event_type = 'Lock'"
|
||||
waiting = set(output(*PSQL, "-c", sql).split())
|
||||
holder = next((r for r in replicas() if waiting & set(r[2:])), [None, None])
|
||||
if kill and holder[0]:
|
||||
subprocess.call(["docker", "kill", holder[0]], stdout=subprocess.DEVNULL)
|
||||
lock.stdin.close()
|
||||
lock.wait()
|
||||
retried = time.time()
|
||||
attempts, (status, instance, body) = 1, send(alice, chat, text, key)
|
||||
while status != 201 and attempts < 20:
|
||||
time.sleep(0.2)
|
||||
attempts, (status, instance, body) = attempts + 1, send(alice, chat, text, key)
|
||||
page = call("GET", path + "?limit=100", headers=bob["auth"])[2] or {"items": []}
|
||||
copies = [m for m in page["items"] if m["text"] == text]
|
||||
stamp = copies[0]["created_at"].replace("Z", "+00:00") if copies else None
|
||||
report = {
|
||||
"variant": "kill" if kill else "timeout",
|
||||
"lost_attempt": {
|
||||
"status": first,
|
||||
"client_timeout_s": args.timeout,
|
||||
"chat_lock_held_s": args.hold,
|
||||
"replica": holder[1],
|
||||
"replica_killed": bool(kill and holder[0]),
|
||||
"replica_answered": answered(holder[0], request_id) if holder[0] else None,
|
||||
},
|
||||
"retry": {
|
||||
"after_s": round(retried - sent, 3),
|
||||
"status": status,
|
||||
"attempts": attempts,
|
||||
"replica": instance,
|
||||
},
|
||||
"copies_in_history": len(copies),
|
||||
"same_message": bool(copies) and copies[0]["id"] == (body or {}).get("id"),
|
||||
"written_by": None
|
||||
if stamp is None
|
||||
else ("lost attempt" if datetime.fromisoformat(stamp).timestamp() < retried else "retry"),
|
||||
}
|
||||
if kill and holder[0]:
|
||||
subprocess.call(
|
||||
[str(ROOT / "scripts/restore.sh")], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
|
||||
)
|
||||
report["pass"] = (
|
||||
first == 0
|
||||
and holder[0] is not None
|
||||
and status == 201
|
||||
and report["copies_in_history"] == 1
|
||||
and report["same_message"]
|
||||
and (kill or report["lost_attempt"]["replica_answered"] == 201)
|
||||
)
|
||||
return report
|
||||
|
||||
|
||||
def retry(args):
|
||||
alice, bob = actor("alice"), actor("bob")
|
||||
chat = chat_of(alice, bob)
|
||||
variants = [lost(alice, bob, chat, kill, args) for kill in (False, True)]
|
||||
passed = all(v["pass"] for v in variants)
|
||||
emit({"variants": variants, "pass": passed}, args.out)
|
||||
return 0 if passed else 1
|
||||
|
||||
|
||||
def record(stop, alice, chat):
|
||||
probes, trace = [], []
|
||||
|
||||
@@ -413,6 +511,10 @@ def main():
|
||||
under.add_argument("--max-failed-ratio", type=float, default=0.01)
|
||||
under.add_argument("--max-recovery", type=float, default=10.0)
|
||||
under.add_argument("command", nargs=argparse.REMAINDER)
|
||||
again = sub.add_parser("retry", help="retry a write whose answer was lost, same key")
|
||||
again.add_argument("--hold", type=float, default=1.5, help="chat row lock, s (< lock_timeout)")
|
||||
again.add_argument("--timeout", type=float, default=0.5, help="first attempt timeout, s")
|
||||
again.add_argument("--out", help="JSON file, written only after a complete report")
|
||||
watch = sub.add_parser("detect", help="time until the LB takes replicas out of rotation")
|
||||
watch.add_argument("--max", type=float, required=True, help="declared worst detection, s")
|
||||
watch.add_argument("--slack", type=float, default=0.25, help="docker CLI and polling, s")
|
||||
@@ -426,6 +528,8 @@ def main():
|
||||
args = parser.parse_args()
|
||||
if args.mode == "check":
|
||||
return check(args)
|
||||
if args.mode == "retry":
|
||||
return retry(args)
|
||||
args.command = [c for c in args.command if c != "--"]
|
||||
if not args.command:
|
||||
parser.error(f"{args.mode} needs an action command after --")
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
service=${API_SERVICE:-api}
|
||||
show() { docker inspect -f '{{.Config.Hostname}} image={{slice .Image 7 19}}' "$1"; }
|
||||
show() { docker inspect -f '{{.Config.Hostname}} image={{.Config.Image}}@{{slice .Image 7 19}}' "$1"; }
|
||||
scripts/stand-usage.sh &
|
||||
echo "$(date -u +%T) migrate once before the first replacement"
|
||||
docker compose run --rm --no-deps -T migrate 2>&1
|
||||
old=$(docker compose ps -q "$service")
|
||||
@@ -13,8 +14,9 @@ for id in $old; do
|
||||
scripts/lb-wait.sh $((count + 1))
|
||||
new=$(docker compose ps -q "$service" | grep -v -F "$running")
|
||||
echo "$(date -u +%T) replace $(show "$id") -> $(show "$new")"
|
||||
docker stop -t "${STOP_TIMEOUT:-6}" "$id" >/dev/null
|
||||
docker stop -t "${STOP_TIMEOUT:-7}" "$id" >/dev/null
|
||||
docker rm "$id" >/dev/null
|
||||
done
|
||||
scripts/lb-wait.sh "$count"
|
||||
wait
|
||||
echo "$(date -u +%T) done: $count replicas replaced"
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
size="select pg_database_size(current_database()), coalesce((select n_live_tup from pg_stat_user_tables where relname = 'messages'), 0)"
|
||||
echo "$(date -u +%T) database bytes,messages: $(docker compose exec -T postgres psql -X -At -F, -U messenger -d messenger -c "$size")"
|
||||
docker stats --no-stream --format '{{.Name}} cpu={{.CPUPerc}} mem={{.MemUsage}}' $(docker compose ps -q)
|
||||
+1
-1
@@ -6,4 +6,4 @@ ids=$(docker compose ps -q "${API_SERVICE:-api}")
|
||||
[ -n "$ids" ] || { echo "no running ${API_SERVICE:-api} replicas" >&2; exit 3; }
|
||||
target=$(docker inspect -f '{{.Id}} {{.Config.Hostname}}' $ids | awk -v t="$TARGET_INSTANCE_ID" '$2 == t {print $1}')
|
||||
[ -n "$target" ] || { echo "no running ${API_SERVICE:-api} replica answers as $TARGET_INSTANCE_ID" >&2; exit 3; }
|
||||
docker stop -t "${STOP_TIMEOUT:-6}" "$target" >/dev/null
|
||||
docker stop -t "${STOP_TIMEOUT:-7}" "$target" >/dev/null
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from typing import Any
|
||||
@@ -10,12 +9,13 @@ from uvicorn.server import Server
|
||||
from uvicorn_worker import UvicornWorker
|
||||
|
||||
from messenger.main import LOG_FIELDS
|
||||
from messenger.shared.entrypoints.health import DRAINING
|
||||
from messenger.shared.infrastructure.logging import configure
|
||||
from messenger.shared.infrastructure.logging import StructlogLogger, configure
|
||||
from messenger.shared.infrastructure.readiness import DRAINING
|
||||
|
||||
LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO")
|
||||
SHUTDOWN_SECONDS = int(os.environ.get("SHUTDOWN_TIMEOUT_SECONDS", "5"))
|
||||
SHUTDOWN_SECONDS = int(os.environ.get("SHUTDOWN_TIMEOUT_SECONDS", "6"))
|
||||
DRAIN_SECONDS = float(os.environ.get("DRAIN_SECONDS", "2"))
|
||||
LOGGER = StructlogLogger(level=LOG_LEVEL, allowed_fields=LOG_FIELDS)
|
||||
|
||||
|
||||
class StructlogGunicornLogger(GunicornBaseLogger):
|
||||
@@ -31,7 +31,7 @@ class DrainingServer(Server):
|
||||
await super().main_loop()
|
||||
if not self.force_exit:
|
||||
DRAINING.set()
|
||||
logging.getLogger("uvicorn.error").info("Draining for %.1f s", DRAIN_SECONDS)
|
||||
LOGGER.info("service.draining", limit=DRAIN_SECONDS)
|
||||
await asyncio.sleep(DRAIN_SECONDS)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class MessengerWorker(UvicornWorker):
|
||||
"access_log": False,
|
||||
"server_header": False,
|
||||
"date_header": False,
|
||||
"timeout_graceful_shutdown": max(1, int(SHUTDOWN_SECONDS - DRAIN_SECONDS)),
|
||||
"timeout_graceful_shutdown": max(1, int(SHUTDOWN_SECONDS - DRAIN_SECONDS) - 1),
|
||||
}
|
||||
|
||||
async def _serve(self) -> None:
|
||||
|
||||
@@ -4,7 +4,7 @@ from messenger.identity.application.commands import CloseSession, OpenSession, R
|
||||
from messenger.identity.application.ports import (
|
||||
IdentityUnitOfWork,
|
||||
PasswordHasher,
|
||||
SessionDirectory,
|
||||
SessionRevocations,
|
||||
)
|
||||
from messenger.identity.domain.events import SessionClosed, SessionOpened
|
||||
from messenger.identity.domain.models import Session, User
|
||||
@@ -62,15 +62,19 @@ class OpenSessionHandler:
|
||||
|
||||
|
||||
class CloseSessionHandler:
|
||||
__slots__ = ("_sessions", "_uow")
|
||||
__slots__ = ("_revocations", "_uow")
|
||||
|
||||
def __init__(self, uow: IdentityUnitOfWork, sessions: SessionDirectory) -> None:
|
||||
def __init__(self, uow: IdentityUnitOfWork, revocations: SessionRevocations) -> None:
|
||||
self._uow = uow
|
||||
self._sessions = sessions
|
||||
self._revocations = revocations
|
||||
|
||||
async def __call__(self, command: CloseSession) -> None:
|
||||
await self._sessions.invalidate(command.session)
|
||||
async with self._uow.transaction():
|
||||
await self._uow.sessions.remove(command.session.token_hash)
|
||||
self._uow.record(SessionClosed(user_id=command.session.user_id))
|
||||
await self._uow.commit()
|
||||
await self._revocations.revoke(command.session)
|
||||
try:
|
||||
async with self._uow.transaction():
|
||||
await self._uow.sessions.remove(command.session.token_hash)
|
||||
self._uow.record(SessionClosed(user_id=command.session.user_id))
|
||||
await self._uow.commit()
|
||||
except BaseException:
|
||||
await self._revocations.restore(command.session)
|
||||
raise
|
||||
|
||||
@@ -38,7 +38,12 @@ class UserDirectory(Protocol):
|
||||
class SessionDirectory(Protocol):
|
||||
async def find(self, token_hash: bytes, now: datetime) -> Session | None: ...
|
||||
|
||||
async def invalidate(self, session: Session) -> None: ...
|
||||
|
||||
@runtime_checkable
|
||||
class SessionRevocations(Protocol):
|
||||
async def revoke(self, session: Session) -> None: ...
|
||||
|
||||
async def restore(self, session: Session) -> None: ...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
|
||||
@@ -17,6 +17,7 @@ from messenger.identity.application.ports import (
|
||||
IdentityUnitOfWork,
|
||||
PasswordHasher,
|
||||
SessionDirectory,
|
||||
SessionRevocations,
|
||||
UserDirectory,
|
||||
)
|
||||
from messenger.identity.application.queries import Authenticate, GetCurrentUser, VerifyCredentials
|
||||
@@ -27,7 +28,7 @@ from messenger.identity.infrastructure.postgres import (
|
||||
PostgresSessionDirectory,
|
||||
PostgresUserDirectory,
|
||||
)
|
||||
from messenger.identity.infrastructure.valkey import CachedSessionDirectory
|
||||
from messenger.identity.infrastructure.valkey import CachedSessionDirectory, NoRevocations
|
||||
from messenger.shared.application.commands import Command
|
||||
from messenger.shared.application.messagebus import CommandHandler
|
||||
from messenger.shared.application.ports import Clock, EventPublisher, IdGenerator, Logger
|
||||
@@ -76,6 +77,10 @@ class IdentityProvider(Provider):
|
||||
finally:
|
||||
await client.aclose()
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def revocations(self, sessions: SessionDirectory) -> SessionRevocations:
|
||||
return sessions if isinstance(sessions, CachedSessionDirectory) else NoRevocations()
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def verify(self, users: UserDirectory, hasher: PasswordHasher) -> VerifyCredentials:
|
||||
return VerifyCredentials(users, hasher)
|
||||
@@ -100,13 +105,13 @@ class IdentityProvider(Provider):
|
||||
clock: Clock,
|
||||
ids: IdGenerator,
|
||||
hasher: PasswordHasher,
|
||||
sessions: SessionDirectory,
|
||||
revocations: SessionRevocations,
|
||||
settings: IdentitySettings,
|
||||
) -> IdentityCommandBus:
|
||||
ttl = timedelta(seconds=settings.session_ttl_seconds)
|
||||
handlers: dict[type[Command], CommandHandler] = {
|
||||
RegisterUser: RegisterUserHandler(uow, clock, ids, hasher),
|
||||
OpenSession: OpenSessionHandler(uow, clock, ttl),
|
||||
CloseSession: CloseSessionHandler(uow, sessions),
|
||||
CloseSession: CloseSessionHandler(uow, revocations),
|
||||
}
|
||||
return IdentityCommandBus(handlers, uow, publisher)
|
||||
|
||||
@@ -119,6 +119,3 @@ class PostgresSessionDirectory:
|
||||
async with self._database.connection() as connection:
|
||||
row = await connection.fetchrow(ACTIVE_SESSION, token_hash, now)
|
||||
return None if row is None else Session(**dict(row))
|
||||
|
||||
async def invalidate(self, session: Session) -> None:
|
||||
return None
|
||||
|
||||
@@ -37,6 +37,14 @@ def decode(token_hash: bytes, value: str) -> Session:
|
||||
)
|
||||
|
||||
|
||||
class NoRevocations:
|
||||
async def revoke(self, session: Session) -> None:
|
||||
return None
|
||||
|
||||
async def restore(self, session: Session) -> None:
|
||||
return None
|
||||
|
||||
|
||||
class CachedSessionDirectory:
|
||||
__slots__ = ("_client", "_cooldown", "_limit", "_logger", "_origin", "_resume_at")
|
||||
|
||||
@@ -70,7 +78,7 @@ class CachedSessionDirectory:
|
||||
await self._quietly(self._client.set(key, encode(session), pxat=until, nx=True))
|
||||
return session
|
||||
|
||||
async def invalidate(self, session: Session) -> None:
|
||||
async def revoke(self, session: Session) -> None:
|
||||
if not self._closed():
|
||||
raise Unavailable("кэш сессий недоступен")
|
||||
try:
|
||||
@@ -81,6 +89,9 @@ class CachedSessionDirectory:
|
||||
self._trip(error)
|
||||
raise Unavailable("кэш сессий недоступен") from error
|
||||
|
||||
async def restore(self, session: Session) -> None:
|
||||
await self._quietly(self._client.delete(key_of(session.token_hash)))
|
||||
|
||||
async def _read(self, key: str) -> str | None:
|
||||
if not self._closed():
|
||||
return None
|
||||
|
||||
@@ -41,7 +41,7 @@ from messenger.shared.entrypoints.ioc import PlatformProvider
|
||||
from messenger.shared.entrypoints.pipeline import RequestPipeline
|
||||
from messenger.shared.infrastructure.logging import PLATFORM_FIELDS, StructlogLogger
|
||||
|
||||
TRANSPORT_FIELDS = frozenset({"dropped_total", "queue", "instance"})
|
||||
TRANSPORT_FIELDS = frozenset({"dropped_total"})
|
||||
|
||||
LOG_FIELDS = (
|
||||
PLATFORM_FIELDS | TRANSPORT_FIELDS | IDENTITY_FIELDS | MESSAGING_FIELDS | ATTACHMENT_FIELDS
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from datetime import timedelta
|
||||
|
||||
from messenger.messaging.application.commands import CreateChat, PostMessage
|
||||
from messenger.messaging.application.ports import MessagingUnitOfWork
|
||||
from messenger.messaging.domain.errors import ChatNotFound
|
||||
from messenger.messaging.domain.models import Chat, Message, Receipt
|
||||
from messenger.messaging.application.ports import ChatDirectory, MessageLog, MessagingUnitOfWork
|
||||
from messenger.messaging.domain.errors import (
|
||||
ChatNotFound,
|
||||
InvalidAttachmentList,
|
||||
InvalidMessageText,
|
||||
)
|
||||
from messenger.messaging.domain.models import Chat, Message, attachment_list
|
||||
from messenger.messaging.domain.values import MessageText
|
||||
from messenger.shared.application.ports import Clock, IdGenerator
|
||||
|
||||
|
||||
@@ -30,34 +35,41 @@ class CreateChatHandler:
|
||||
|
||||
|
||||
class PostMessageHandler:
|
||||
__slots__ = ("_clock", "_ids", "_ttl", "_uow")
|
||||
__slots__ = ("_chats", "_clock", "_ids", "_log", "_ttl", "_uow")
|
||||
|
||||
def __init__(
|
||||
self, uow: MessagingUnitOfWork, clock: Clock, ids: IdGenerator, ttl: timedelta
|
||||
self,
|
||||
uow: MessagingUnitOfWork,
|
||||
log: MessageLog,
|
||||
chats: ChatDirectory,
|
||||
clock: Clock,
|
||||
ids: IdGenerator,
|
||||
*,
|
||||
ttl: timedelta,
|
||||
) -> None:
|
||||
self._uow = uow
|
||||
self._log = log
|
||||
self._chats = chats
|
||||
self._clock = clock
|
||||
self._ids = ids
|
||||
self._ttl = ttl
|
||||
|
||||
async def __call__(self, command: PostMessage) -> Message:
|
||||
async with self._uow.transaction():
|
||||
chat = await self._uow.chats.get(command.chat_id)
|
||||
if chat is None:
|
||||
raise ChatNotFound("чат не найден")
|
||||
now = self._clock.now()
|
||||
message = chat.post(
|
||||
message_id=self._ids.new_id(),
|
||||
sender_id=command.sender_id,
|
||||
text=command.text,
|
||||
now=now,
|
||||
attachment_ids=command.attachment_ids,
|
||||
)
|
||||
known = await self._uow.chats.receipt(
|
||||
chat.id, command.sender_id, command.key, now - self._ttl
|
||||
)
|
||||
if known is not None:
|
||||
return known.replay(command.fingerprint)
|
||||
await self._uow.chats.append(Receipt(command.key, command.fingerprint, message))
|
||||
await self._uow.commit()
|
||||
try:
|
||||
text = MessageText(command.text)
|
||||
attachments = attachment_list(text, command.attachment_ids)
|
||||
except InvalidMessageText, InvalidAttachmentList:
|
||||
if await self._chats.chat_for_member(command.chat_id, command.sender_id) is None:
|
||||
raise ChatNotFound("чат не найден") from None
|
||||
raise
|
||||
now = self._clock.now()
|
||||
draft = Message(
|
||||
self._ids.new_id(), command.chat_id, command.sender_id, text, now, attachments
|
||||
)
|
||||
receipt = await self._log.post(draft, command.key, command.fingerprint, now - self._ttl)
|
||||
if receipt is None:
|
||||
raise ChatNotFound("чат не найден")
|
||||
message = receipt.replay(command.fingerprint)
|
||||
if message.id == draft.id:
|
||||
self._uow.record(message.posted())
|
||||
return message
|
||||
|
||||
@@ -18,14 +18,13 @@ class CursorCodec(Protocol):
|
||||
class ChatRepository(Protocol):
|
||||
async def add(self, chat: Chat) -> None: ...
|
||||
|
||||
async def get(self, chat_id: UUID) -> Chat | None: ...
|
||||
|
||||
async def receipt(
|
||||
self, chat_id: UUID, sender_id: UUID, key: str, since: datetime
|
||||
@runtime_checkable
|
||||
class MessageLog(Protocol):
|
||||
async def post(
|
||||
self, message: Message, key: str, fingerprint: bytes, since: datetime
|
||||
) -> Receipt | None: ...
|
||||
|
||||
async def append(self, receipt: Receipt) -> None: ...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class MessagingUnitOfWork(UnitOfWork, Protocol):
|
||||
|
||||
@@ -43,7 +43,7 @@ class ListChats:
|
||||
|
||||
async def __call__(self, user_id: UUID, *, limit: int, cursor: str | None) -> Page[Chat]:
|
||||
scope = chats_scope(user_id)
|
||||
after: HistoryKey | None = self._cursors.decode(scope, cursor) if cursor else None
|
||||
after: HistoryKey | None = None if cursor is None else self._cursors.decode(scope, cursor)
|
||||
items, has_more = await self._chats.chats_of(user_id, after=after, limit=limit)
|
||||
next_cursor = self._cursors.encode(scope, items[-1].key) if has_more and items else None
|
||||
return Page(items=items, next_cursor=next_cursor)
|
||||
@@ -67,7 +67,7 @@ class ReadHistory:
|
||||
if await self._chats.chat_for_member(chat_id, user_id) is None:
|
||||
raise ChatNotFound("чат не найден")
|
||||
scope = messages_scope(chat_id)
|
||||
after: HistoryKey | None = self._cursors.decode(scope, cursor) if cursor else None
|
||||
after: HistoryKey | None = None if cursor is None else self._cursors.decode(scope, cursor)
|
||||
items, has_more = await self._chats.history(chat_id, after=after, limit=limit)
|
||||
next_cursor = self._cursors.encode(scope, items[-1].key) if has_more and items else None
|
||||
return Page(items=items, next_cursor=next_cursor)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
from messenger.messaging.domain.errors import (
|
||||
ChatNotFound,
|
||||
IdempotencyConflict,
|
||||
InvalidAttachmentList,
|
||||
InvalidChatData,
|
||||
@@ -20,8 +19,6 @@ from messenger.messaging.domain.values import (
|
||||
)
|
||||
from messenger.shared.domain.events import DomainEvent
|
||||
|
||||
TICK = timedelta(microseconds=1)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class Message:
|
||||
@@ -36,6 +33,15 @@ class Message:
|
||||
def key(self) -> HistoryKey:
|
||||
return (self.created_at, self.id.int)
|
||||
|
||||
def posted(self) -> MessagePosted:
|
||||
return MessagePosted(
|
||||
message_id=self.id,
|
||||
chat_id=self.chat_id,
|
||||
sender_id=self.sender_id,
|
||||
text_length=len(self.text.value),
|
||||
created_at=self.created_at,
|
||||
)
|
||||
|
||||
|
||||
def attachment_list(text: MessageText, attachment_ids: Sequence[UUID]) -> tuple[UUID, ...]:
|
||||
if len(attachment_ids) > MESSAGE_ATTACHMENTS_MAX:
|
||||
@@ -62,15 +68,7 @@ class Receipt:
|
||||
|
||||
|
||||
class Chat:
|
||||
__slots__ = (
|
||||
"_events",
|
||||
"_members",
|
||||
"created_at",
|
||||
"id",
|
||||
"last_message_at",
|
||||
"member_ids",
|
||||
"title",
|
||||
)
|
||||
__slots__ = ("_events", "created_at", "id", "member_ids", "title")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -79,14 +77,11 @@ class Chat:
|
||||
title: ChatTitle,
|
||||
member_ids: Sequence[UUID],
|
||||
created_at: datetime,
|
||||
last_message_at: datetime | None = None,
|
||||
) -> None:
|
||||
self.id = chat_id
|
||||
self.title = title
|
||||
self.member_ids: tuple[UUID, ...] = tuple(member_ids)
|
||||
self.created_at = created_at
|
||||
self.last_message_at = last_message_at
|
||||
self._members: frozenset[UUID] = frozenset(member_ids)
|
||||
self._events: list[DomainEvent] = []
|
||||
|
||||
@classmethod
|
||||
@@ -131,47 +126,6 @@ class Chat:
|
||||
def record(self, event: DomainEvent) -> None:
|
||||
self._events.append(event)
|
||||
|
||||
def is_member(self, user_id: UUID) -> bool:
|
||||
return user_id in self._members
|
||||
|
||||
def require_member(self, user_id: UUID) -> None:
|
||||
if not self.is_member(user_id):
|
||||
raise ChatNotFound("чат не найден")
|
||||
|
||||
def post(
|
||||
self,
|
||||
*,
|
||||
message_id: UUID,
|
||||
sender_id: UUID,
|
||||
text: str,
|
||||
now: datetime,
|
||||
attachment_ids: Sequence[UUID] = (),
|
||||
) -> Message:
|
||||
self.require_member(sender_id)
|
||||
body = MessageText(text)
|
||||
attachments = attachment_list(body, attachment_ids)
|
||||
last = self.last_message_at
|
||||
created_at = now if last is None or now > last else last + TICK
|
||||
message = Message(
|
||||
id=message_id,
|
||||
chat_id=self.id,
|
||||
sender_id=sender_id,
|
||||
text=body,
|
||||
created_at=created_at,
|
||||
attachment_ids=attachments,
|
||||
)
|
||||
self.last_message_at = created_at
|
||||
self.record(
|
||||
MessagePosted(
|
||||
message_id=message.id,
|
||||
chat_id=self.id,
|
||||
sender_id=sender_id,
|
||||
text_length=len(message.text.value),
|
||||
created_at=created_at,
|
||||
)
|
||||
)
|
||||
return message
|
||||
|
||||
def collect_events(self) -> list[DomainEvent]:
|
||||
events, self._events = self._events, []
|
||||
return events
|
||||
|
||||
@@ -5,12 +5,18 @@ from dishka import Provider, Scope, provide
|
||||
from messenger.messaging.application.bus import MessagingCommandBus
|
||||
from messenger.messaging.application.commands import CreateChat, PostMessage
|
||||
from messenger.messaging.application.handlers import CreateChatHandler, PostMessageHandler
|
||||
from messenger.messaging.application.ports import ChatDirectory, CursorCodec, MessagingUnitOfWork
|
||||
from messenger.messaging.application.ports import (
|
||||
ChatDirectory,
|
||||
CursorCodec,
|
||||
MessageLog,
|
||||
MessagingUnitOfWork,
|
||||
)
|
||||
from messenger.messaging.application.queries import GetChat, ListChats, ReadHistory
|
||||
from messenger.messaging.config import MessagingSettings
|
||||
from messenger.messaging.infrastructure.cursor import SignedCursorCodec
|
||||
from messenger.messaging.infrastructure.postgres import (
|
||||
PostgresChatDirectory,
|
||||
PostgresMessageLog,
|
||||
PostgresMessagingUnitOfWork,
|
||||
)
|
||||
from messenger.shared.application.commands import Command
|
||||
@@ -32,6 +38,10 @@ class MessagingProvider(Provider):
|
||||
def directory(self, database: Database) -> ChatDirectory:
|
||||
return PostgresChatDirectory(database)
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def log(self, database: Database) -> MessageLog:
|
||||
return PostgresMessageLog(database)
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def cursors(self, settings: MessagingSettings) -> CursorCodec:
|
||||
return SignedCursorCodec(settings.cursor_secret.get_secret_value().encode())
|
||||
@@ -56,6 +66,8 @@ class MessagingProvider(Provider):
|
||||
def command_bus(
|
||||
self,
|
||||
uow: MessagingUnitOfWork,
|
||||
log: MessageLog,
|
||||
directory: ChatDirectory,
|
||||
publisher: EventPublisher,
|
||||
clock: Clock,
|
||||
ids: IdGenerator,
|
||||
@@ -64,6 +76,6 @@ class MessagingProvider(Provider):
|
||||
ttl = timedelta(seconds=settings.idempotency_ttl_seconds)
|
||||
handlers: dict[type[Command], CommandHandler] = {
|
||||
CreateChat: CreateChatHandler(uow, clock, ids),
|
||||
PostMessage: PostMessageHandler(uow, clock, ids, ttl),
|
||||
PostMessage: PostMessageHandler(uow, log, directory, clock, ids, ttl=ttl),
|
||||
}
|
||||
return MessagingCommandBus(handlers, uow, publisher)
|
||||
|
||||
@@ -37,7 +37,7 @@ class CreateMessageRequest(BaseModel):
|
||||
|
||||
class PageQuery(BaseModel):
|
||||
limit: int = Field(default=50, ge=1, le=100)
|
||||
cursor: str | None = None
|
||||
cursor: str | None = Field(default=None, min_length=1)
|
||||
|
||||
|
||||
class ChatOut(BaseModel):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import replace
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
@@ -8,6 +9,7 @@ from messenger.messaging.domain.errors import InvalidChatData, UnknownAttachment
|
||||
from messenger.messaging.domain.keys import HistoryKey
|
||||
from messenger.messaging.domain.models import Chat, Message, Receipt
|
||||
from messenger.messaging.domain.values import ChatTitle, MessageText
|
||||
from messenger.shared.application.errors import Unavailable
|
||||
from messenger.shared.infrastructure.postgres import (
|
||||
Connection,
|
||||
Database,
|
||||
@@ -21,12 +23,33 @@ INSERT INTO chat_members (chat_id, user_id, position, chat_created_at)
|
||||
SELECT $1, member.user_id, member.position, $3
|
||||
FROM unnest($2::uuid[]) WITH ORDINALITY AS member (user_id, position)
|
||||
"""
|
||||
LOCK_CHAT = """
|
||||
SELECT c.id, c.title, c.created_at, c.last_message_at,
|
||||
ARRAY(SELECT user_id FROM chat_members WHERE chat_id = c.id ORDER BY position) AS member_ids
|
||||
FROM chats c
|
||||
WHERE c.id = $1
|
||||
FOR UPDATE
|
||||
POST_MESSAGE = """
|
||||
WITH chat AS (
|
||||
SELECT c.id, GREATEST($5::timestamptz, c.last_message_at + interval '1 microsecond') AS stamp
|
||||
FROM chats c JOIN chat_members m ON m.chat_id = c.id AND m.user_id = $3
|
||||
WHERE c.id = $2
|
||||
FOR UPDATE OF c
|
||||
), receipt AS (
|
||||
INSERT INTO idempotency_keys (chat_id, user_id, key, fingerprint, message_id, created_at)
|
||||
SELECT id, $3, $6, $7, $1, stamp FROM chat
|
||||
ON CONFLICT (chat_id, user_id, key) DO UPDATE
|
||||
SET fingerprint = EXCLUDED.fingerprint,
|
||||
message_id = EXCLUDED.message_id,
|
||||
created_at = EXCLUDED.created_at
|
||||
WHERE idempotency_keys.created_at <= $8
|
||||
RETURNING created_at
|
||||
), message AS (
|
||||
INSERT INTO messages (id, chat_id, sender_id, text, created_at)
|
||||
SELECT $1, $2, $3, $4, created_at FROM receipt
|
||||
RETURNING created_at
|
||||
), links AS (
|
||||
INSERT INTO message_attachments (message_id, position, chat_id, attachment_id)
|
||||
SELECT $1, link.position - 1, $2, link.attachment_id
|
||||
FROM message, unnest($9::uuid[]) WITH ORDINALITY AS link (attachment_id, position)
|
||||
), touched AS (
|
||||
UPDATE chats SET last_message_at = message.created_at FROM message WHERE chats.id = $2
|
||||
)
|
||||
SELECT EXISTS (SELECT FROM chat) AS member, (SELECT created_at FROM message) AS created_at
|
||||
"""
|
||||
ATTACHMENT_FKEY = "message_attachments_attachment_fkey"
|
||||
RECEIPT = """
|
||||
@@ -36,27 +59,6 @@ SELECT k.fingerprint, m.id, m.chat_id, m.sender_id, m.text, m.created_at,
|
||||
FROM idempotency_keys k JOIN messages m ON m.id = k.message_id
|
||||
WHERE k.chat_id = $1 AND k.user_id = $2 AND k.key = $3 AND k.created_at > $4
|
||||
"""
|
||||
APPEND_MESSAGE = """
|
||||
WITH message AS (
|
||||
INSERT INTO messages (id, chat_id, sender_id, text, created_at)
|
||||
VALUES ($1, $2, $3, $4, $5)
|
||||
RETURNING id, chat_id, sender_id, created_at
|
||||
), links AS (
|
||||
INSERT INTO message_attachments (message_id, position, chat_id, attachment_id)
|
||||
SELECT message.id, link.position - 1, message.chat_id, link.attachment_id
|
||||
FROM message, unnest($8::uuid[]) WITH ORDINALITY AS link (attachment_id, position)
|
||||
), receipt AS (
|
||||
INSERT INTO idempotency_keys (chat_id, user_id, key, fingerprint, message_id, created_at)
|
||||
SELECT chat_id, sender_id, $6, $7, id, created_at FROM message
|
||||
ON CONFLICT (chat_id, user_id, key) DO UPDATE
|
||||
SET fingerprint = EXCLUDED.fingerprint,
|
||||
message_id = EXCLUDED.message_id,
|
||||
created_at = EXCLUDED.created_at
|
||||
)
|
||||
UPDATE chats SET last_message_at = message.created_at
|
||||
FROM message
|
||||
WHERE chats.id = message.chat_id
|
||||
"""
|
||||
CHAT_OF_MEMBER = """
|
||||
SELECT c.id, c.title, c.created_at,
|
||||
ARRAY(SELECT user_id FROM chat_members WHERE chat_id = c.id ORDER BY position) AS member_ids
|
||||
@@ -105,7 +107,6 @@ def chat_of(row: Record) -> Chat:
|
||||
title=ChatTitle(row["title"]),
|
||||
member_ids=row["member_ids"],
|
||||
created_at=row["created_at"],
|
||||
last_message_at=row.get("last_message_at"),
|
||||
)
|
||||
|
||||
|
||||
@@ -141,38 +142,43 @@ class PostgresChatRepository:
|
||||
raise InvalidChatData("поле member_ids содержит неизвестного пользователя") from error
|
||||
self._seen.append(chat)
|
||||
|
||||
async def get(self, chat_id: UUID) -> Chat | None:
|
||||
row = await self._connection.fetchrow(LOCK_CHAT, chat_id)
|
||||
if row is None:
|
||||
return None
|
||||
chat = chat_of(row)
|
||||
self._seen.append(chat)
|
||||
return chat
|
||||
|
||||
async def receipt(
|
||||
self, chat_id: UUID, sender_id: UUID, key: str, since: datetime
|
||||
class PostgresMessageLog:
|
||||
__slots__ = ("_database",)
|
||||
|
||||
def __init__(self, database: Database) -> None:
|
||||
self._database = database
|
||||
|
||||
async def post(
|
||||
self, message: Message, key: str, fingerprint: bytes, since: datetime
|
||||
) -> Receipt | None:
|
||||
row = await self._connection.fetchrow(RECEIPT, chat_id, sender_id, key, since)
|
||||
return None if row is None else Receipt(key, row["fingerprint"], message_of(row))
|
||||
|
||||
async def append(self, receipt: Receipt) -> None:
|
||||
message = receipt.message
|
||||
try:
|
||||
await self._connection.execute(
|
||||
APPEND_MESSAGE,
|
||||
message.id,
|
||||
message.chat_id,
|
||||
message.sender_id,
|
||||
message.text.value,
|
||||
message.created_at,
|
||||
receipt.key,
|
||||
receipt.fingerprint,
|
||||
list(message.attachment_ids),
|
||||
)
|
||||
except ForeignKeyViolationError as error:
|
||||
if getattr(error, "constraint_name", None) != ATTACHMENT_FKEY:
|
||||
raise
|
||||
raise UnknownAttachment("вложение не найдено в этом чате") from error
|
||||
chat_id, sender_id = message.chat_id, message.sender_id
|
||||
async with self._database.connection() as connection:
|
||||
try:
|
||||
row = await connection.fetchrow(
|
||||
POST_MESSAGE,
|
||||
message.id,
|
||||
chat_id,
|
||||
sender_id,
|
||||
message.text.value,
|
||||
message.created_at,
|
||||
key,
|
||||
fingerprint,
|
||||
since,
|
||||
list(message.attachment_ids),
|
||||
)
|
||||
except ForeignKeyViolationError as error:
|
||||
if getattr(error, "constraint_name", None) != ATTACHMENT_FKEY:
|
||||
raise
|
||||
raise UnknownAttachment("вложение не найдено в этом чате") from error
|
||||
if row is None or not row["member"]:
|
||||
return None
|
||||
if row["created_at"] is not None:
|
||||
return Receipt(key, fingerprint, replace(message, created_at=row["created_at"]))
|
||||
known = await connection.fetchrow(RECEIPT, chat_id, sender_id, key, since)
|
||||
if known is None:
|
||||
raise Unavailable("ключ идемпотентности занят незавершённой записью")
|
||||
return Receipt(key, known["fingerprint"], message_of(known))
|
||||
|
||||
|
||||
class PostgresMessagingUnitOfWork(PostgresUnitOfWork):
|
||||
|
||||
@@ -37,28 +37,21 @@ class CommandBus:
|
||||
|
||||
|
||||
class EventBus:
|
||||
__slots__ = ("_deferred", "_dropped", "_logger", "_projections", "_queue", "_worker")
|
||||
__slots__ = ("_deferred", "_dropped", "_logger", "_queue", "_worker")
|
||||
|
||||
def __init__(self, logger: Logger, *, max_queue: int = 10_000) -> None:
|
||||
self._logger = logger
|
||||
self._queue: asyncio.Queue[DomainEvent] = asyncio.Queue(maxsize=max_queue)
|
||||
self._projections: dict[type[DomainEvent], list[Any]] = {}
|
||||
self._deferred: dict[type[DomainEvent], list[Any]] = {}
|
||||
self._worker: asyncio.Task[None] | None = None
|
||||
self._dropped = 0
|
||||
|
||||
def project[EventT: DomainEvent](
|
||||
self, event_type: type[EventT], handler: EventHandler[EventT]
|
||||
) -> None:
|
||||
self._projections.setdefault(event_type, []).append(handler)
|
||||
|
||||
def subscribe[EventT: DomainEvent](
|
||||
self, event_type: type[EventT], handler: EventHandler[EventT]
|
||||
) -> None:
|
||||
self._deferred.setdefault(event_type, []).append(handler)
|
||||
|
||||
async def emit(self, event: DomainEvent) -> bool:
|
||||
await self._run(self._projections.get(type(event), []), event, "projection")
|
||||
if not self._deferred.get(type(event)):
|
||||
return True
|
||||
try:
|
||||
@@ -96,11 +89,11 @@ class EventBus:
|
||||
while True:
|
||||
event = await self._queue.get()
|
||||
try:
|
||||
await self._run(self._deferred.get(type(event), []), event, "subscriber")
|
||||
await self._run(self._deferred.get(type(event), []), event)
|
||||
finally:
|
||||
self._queue.task_done()
|
||||
|
||||
async def _run(self, handlers: Sequence[Any], event: DomainEvent, kind: str) -> None:
|
||||
async def _run(self, handlers: Sequence[Any], event: DomainEvent) -> None:
|
||||
for handler in handlers:
|
||||
try:
|
||||
await handler(event)
|
||||
@@ -108,7 +101,6 @@ class EventBus:
|
||||
self._logger.error(
|
||||
"event.handler_failed",
|
||||
event_name=event.name,
|
||||
reason=kind,
|
||||
error=type(error).__name__,
|
||||
)
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@ class Logger(Protocol):
|
||||
def error(self, event: str, /, **fields: Any) -> None: ...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class Readiness(Protocol):
|
||||
async def check(self) -> None: ...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class UnitOfWork(Protocol):
|
||||
def transaction(self) -> AbstractAsyncContextManager[None]: ...
|
||||
|
||||
@@ -9,7 +9,7 @@ from messenger.shared.entrypoints.errors import Unauthenticated
|
||||
async def current_actor(request: Request) -> UUID:
|
||||
actor = getattr(request.state, "actor", None)
|
||||
if not isinstance(actor, UUID):
|
||||
raise Unauthenticated("заголовок идентификации обязателен и должен быть действительным")
|
||||
raise Unauthenticated("сессия не подтверждена")
|
||||
return actor
|
||||
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ class TransportSettings(Settings):
|
||||
docs: bool = False
|
||||
max_body_bytes: int = Field(default=1_048_576, ge=4_096)
|
||||
request_timeout_seconds: float = Field(default=8.0, gt=0, le=300)
|
||||
shutdown_timeout_seconds: int = Field(default=5, ge=1, le=10)
|
||||
|
||||
@@ -46,7 +46,7 @@ class Unauthenticated(Exception):
|
||||
|
||||
def classify(error: DomainError, codes: ErrorCodes) -> tuple[str, int]:
|
||||
for kind in type(error).__mro__:
|
||||
known = codes.get(kind) # type: ignore[arg-type]
|
||||
known = codes.get(kind)
|
||||
if known is not None:
|
||||
return known
|
||||
return "internal_error", status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
from threading import Event
|
||||
|
||||
from dishka.integrations.fastapi import FromDishka, inject
|
||||
from fastapi import APIRouter
|
||||
|
||||
from messenger.shared.application.errors import Unavailable
|
||||
from messenger.shared.application.ports import Readiness
|
||||
from messenger.shared.entrypoints.schemas import HealthOut
|
||||
from messenger.shared.infrastructure.postgres import Database
|
||||
|
||||
router = APIRouter(tags=["health"])
|
||||
DRAINING = Event()
|
||||
|
||||
|
||||
@router.get("/health/live")
|
||||
@@ -18,8 +14,6 @@ async def live() -> HealthOut:
|
||||
|
||||
@router.get("/health/ready")
|
||||
@inject
|
||||
async def ready(database: FromDishka[Database]) -> HealthOut:
|
||||
if DRAINING.is_set():
|
||||
raise Unavailable("Реплика выходит из ротации")
|
||||
await database.ping()
|
||||
async def ready(readiness: FromDishka[Readiness]) -> HealthOut:
|
||||
await readiness.check()
|
||||
return HealthOut()
|
||||
|
||||
@@ -3,11 +3,12 @@ from collections.abc import AsyncIterator
|
||||
from dishka import Provider, Scope, provide
|
||||
|
||||
from messenger.shared.application.messagebus import EventBus, InMemoryEventPublisher
|
||||
from messenger.shared.application.ports import Clock, EventPublisher, IdGenerator, Logger
|
||||
from messenger.shared.application.ports import Clock, EventPublisher, IdGenerator, Logger, Readiness
|
||||
from messenger.shared.config import PlatformSettings
|
||||
from messenger.shared.infrastructure.clock import MonotonicUtcClock
|
||||
from messenger.shared.infrastructure.ids import Uuid7Generator
|
||||
from messenger.shared.infrastructure.postgres import Database
|
||||
from messenger.shared.infrastructure.readiness import DatabaseReadiness
|
||||
|
||||
|
||||
class PlatformProvider(Provider):
|
||||
@@ -45,6 +46,10 @@ class PlatformProvider(Provider):
|
||||
yield database
|
||||
await database.close()
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def readiness(self, database: Database) -> Readiness:
|
||||
return DatabaseReadiness(database)
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
def event_bus(self, logger: Logger, settings: PlatformSettings) -> EventBus:
|
||||
return EventBus(logger, max_queue=settings.event_queue_max)
|
||||
|
||||
@@ -5,6 +5,7 @@ from collections.abc import Awaitable, Callable
|
||||
from dataclasses import dataclass
|
||||
from uuid import uuid4
|
||||
|
||||
from starlette.exceptions import HTTPException
|
||||
from starlette.types import ASGIApp, Message, Receive, Scope, Send
|
||||
|
||||
from messenger.shared.application.errors import Unavailable
|
||||
@@ -106,18 +107,22 @@ class RequestPipeline:
|
||||
message = {**message, "headers": headers}
|
||||
await send(message)
|
||||
|
||||
declared = header(scope, b"content-length")
|
||||
if declared.isdigit() and int(declared) > self._limit(scope["path"]):
|
||||
await send_error(wrapped_send, 413, "payload_too_large", request_id)
|
||||
self._log(scope, status_holder[0], request_id, started)
|
||||
return
|
||||
limit = self._limit(scope["path"])
|
||||
received = [0]
|
||||
|
||||
async def limited_receive() -> Message:
|
||||
message = await receive()
|
||||
received[0] += len(message.get("body", b""))
|
||||
if received[0] > limit:
|
||||
raise HTTPException(413)
|
||||
return message
|
||||
|
||||
rejection: Rejection | None = None
|
||||
try:
|
||||
async with asyncio.timeout(self._timeout):
|
||||
rejection = await self._guard(scope)
|
||||
rejection = self._oversized(scope, limit) or await self._guard(scope)
|
||||
if rejection is None:
|
||||
await self._app(scope, receive, wrapped_send)
|
||||
await self._app(scope, limited_receive, wrapped_send)
|
||||
except Unavailable as error:
|
||||
self._logger.warning(
|
||||
"dependency.unavailable",
|
||||
@@ -126,18 +131,21 @@ class RequestPipeline:
|
||||
request_id=request_id,
|
||||
)
|
||||
rejection = Rejection(503, "unavailable")
|
||||
except TimeoutError:
|
||||
except (TimeoutError, asyncio.CancelledError) as error:
|
||||
cancelled = isinstance(error, asyncio.CancelledError)
|
||||
self._logger.warning(
|
||||
"request.timeout",
|
||||
"request.cancelled" if cancelled else "request.timeout",
|
||||
method=scope["method"],
|
||||
route=self._route(scope),
|
||||
request_id=request_id,
|
||||
limit=self._timeout,
|
||||
limit=None if cancelled else self._timeout,
|
||||
duration_ms=round((time.perf_counter() - started) * 1000, 3),
|
||||
)
|
||||
if not answered[0]:
|
||||
await send_error(wrapped_send, 503, "unavailable", request_id)
|
||||
self._log(scope, status_holder[0], request_id, started)
|
||||
if cancelled:
|
||||
raise
|
||||
return
|
||||
except Exception:
|
||||
self._logger.error(
|
||||
@@ -160,6 +168,12 @@ class RequestPipeline:
|
||||
return limit
|
||||
return self._max_bytes
|
||||
|
||||
def _oversized(self, scope: Scope, limit: int) -> Rejection | None:
|
||||
declared = header(scope, b"content-length")
|
||||
if declared.isdigit() and int(declared) > limit:
|
||||
return Rejection(413, "payload_too_large")
|
||||
return None
|
||||
|
||||
def _route(self, scope: Scope) -> str:
|
||||
route = scope.get("route")
|
||||
return getattr(route, "path", scope["path"])
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
from threading import Event
|
||||
|
||||
from messenger.shared.application.errors import Unavailable
|
||||
from messenger.shared.infrastructure.postgres import Database
|
||||
|
||||
DRAINING = Event()
|
||||
|
||||
|
||||
class DatabaseReadiness:
|
||||
__slots__ = ("_database", "_draining")
|
||||
|
||||
def __init__(self, database: Database, draining: Event = DRAINING) -> None:
|
||||
self._database = database
|
||||
self._draining = draining
|
||||
|
||||
async def check(self) -> None:
|
||||
if self._draining.is_set():
|
||||
raise Unavailable("Реплика выходит из ротации")
|
||||
await self._database.ping()
|
||||
@@ -1,8 +1,10 @@
|
||||
import time
|
||||
from uuid import uuid4
|
||||
|
||||
import asyncpg
|
||||
from httpx import AsyncClient
|
||||
|
||||
from conftest import actor, keyed, make_chat, register
|
||||
from conftest import DATABASE, actor, keyed, make_chat, register
|
||||
|
||||
|
||||
async def test_outsider_gets_404_on_chat(client: AsyncClient) -> None:
|
||||
@@ -82,3 +84,38 @@ async def test_403_is_never_used(client: AsyncClient) -> None:
|
||||
]
|
||||
for path in paths:
|
||||
assert (await client.get(path, headers=actor(eve))).status_code != 403
|
||||
|
||||
|
||||
async def test_request_shape_is_checked_before_access(client: AsyncClient) -> None:
|
||||
alice = await register(client, "alice")
|
||||
eve = await register(client, "eve")
|
||||
chat = await make_chat(client, alice)
|
||||
for chat_id in (chat["id"], uuid4()):
|
||||
path = f"/api/v1/chats/{chat_id}/messages"
|
||||
unkeyed = await client.post(path, json={"text": "чужое"}, headers=actor(eve))
|
||||
extra = await client.post(path, json={"text": "x", "a": 1}, headers=keyed(eve))
|
||||
assert unkeyed.status_code == extra.status_code == 400
|
||||
assert unkeyed.json()["error"]["code"] == extra.json()["error"]["code"] == "invalid_request"
|
||||
blank = await client.post(
|
||||
f"/api/v1/chats/{chat['id']}/messages", json={"text": " "}, headers=keyed(eve)
|
||||
)
|
||||
assert blank.status_code == 404
|
||||
|
||||
|
||||
async def test_outsider_does_not_wait_for_members_lock(client: AsyncClient) -> None:
|
||||
alice = await register(client, "alice")
|
||||
eve = await register(client, "eve")
|
||||
chat = await make_chat(client, alice)
|
||||
holder = await asyncpg.connect(DATABASE["url"])
|
||||
try:
|
||||
async with holder.transaction():
|
||||
await holder.execute("SELECT 1 FROM chats WHERE id = $1 FOR UPDATE", chat["id"])
|
||||
started = time.perf_counter()
|
||||
response = await client.post(
|
||||
f"/api/v1/chats/{chat['id']}/messages", json={"text": "чужое"}, headers=keyed(eve)
|
||||
)
|
||||
elapsed = time.perf_counter() - started
|
||||
finally:
|
||||
await holder.close()
|
||||
assert response.status_code == 404
|
||||
assert elapsed < 0.5
|
||||
|
||||
@@ -33,20 +33,6 @@ def test_identity_does_not_know_about_messaging() -> None:
|
||||
assert not {k: v for k, v in offenders.items() if v}
|
||||
|
||||
|
||||
def test_messaging_touches_identity_only_through_events() -> None:
|
||||
allowed = f"{IDENTITY}.domain.events"
|
||||
offenders: dict[str, list[str]] = {}
|
||||
for path in modules_under("messaging"):
|
||||
borrowed = [
|
||||
module
|
||||
for module in imports_of(path)
|
||||
if module.startswith(IDENTITY) and module != allowed
|
||||
]
|
||||
if borrowed:
|
||||
offenders[str(path.relative_to(SOURCE))] = borrowed
|
||||
assert not offenders
|
||||
|
||||
|
||||
def test_attachments_and_other_zones_do_not_import_each_other() -> None:
|
||||
offenders: dict[str, list[str]] = {}
|
||||
for zone, foreign in (
|
||||
@@ -125,6 +111,7 @@ def test_shared_core_holds_only_platform() -> None:
|
||||
"ids.py",
|
||||
"logging.py",
|
||||
"postgres.py",
|
||||
"readiness.py",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,12 +3,15 @@ import time
|
||||
from datetime import datetime
|
||||
from hashlib import sha256
|
||||
|
||||
import pytest
|
||||
from redis.asyncio import Redis
|
||||
|
||||
from conftest import actor, bearer, register, resolve, running_app, scalar
|
||||
from conftest import actor, bearer, keyed, make_chat, register, resolve, running_app, scalar
|
||||
from messenger.identity.application.ports import SessionDirectory
|
||||
from messenger.identity.domain.models import Session
|
||||
from messenger.identity.infrastructure.postgres import PostgresSessionRepository
|
||||
from messenger.identity.infrastructure.valkey import CachedSessionDirectory
|
||||
from messenger.shared.application.errors import Unavailable
|
||||
|
||||
BEARER = 'Bearer realm="messenger"'
|
||||
|
||||
@@ -53,6 +56,29 @@ async def test_logout_writes_tombstone_before_database(valkey: dict[str, str]) -
|
||||
await cache.aclose()
|
||||
|
||||
|
||||
async def test_logout_rejected_by_database_changes_nothing(
|
||||
valkey: dict[str, str], monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
async def broken(self: PostgresSessionRepository, token_hash: bytes) -> None:
|
||||
raise Unavailable("PostgreSQL недоступен")
|
||||
|
||||
cache = Redis.from_url(valkey["url"])
|
||||
logout = "/api/v1/auth/sessions/current"
|
||||
async with running_app(cache_url=valkey["url"]) as http:
|
||||
alice = await register(http, "alice")
|
||||
assert (await http.get("/api/v1/users/me", headers=actor(alice))).status_code == 200
|
||||
with monkeypatch.context() as patch:
|
||||
patch.setattr(PostgresSessionRepository, "remove", broken)
|
||||
failed = await http.delete(logout, headers=actor(alice))
|
||||
assert failed.status_code == 503
|
||||
assert failed.json()["error"]["code"] == "unavailable"
|
||||
assert await cache.get(key_of(token_of(alice))) is None
|
||||
assert (await http.get("/api/v1/users/me", headers=actor(alice))).status_code == 200
|
||||
assert (await http.delete(logout, headers=actor(alice))).status_code == 204
|
||||
assert (await http.get("/api/v1/users/me", headers=actor(alice))).status_code == 401
|
||||
await cache.aclose()
|
||||
|
||||
|
||||
async def test_fill_racing_with_logout_does_not_revive_token(valkey: dict[str, str]) -> None:
|
||||
async with running_app(cache_url=valkey["url"]) as http:
|
||||
alice = await register(http, "alice")
|
||||
@@ -69,9 +95,6 @@ async def test_fill_racing_with_logout_does_not_revive_token(valkey: dict[str, s
|
||||
await released.wait()
|
||||
return stale[-1]
|
||||
|
||||
async def invalidate(self, session: Session) -> None:
|
||||
await origin.invalidate(session)
|
||||
|
||||
directory._origin = SlowOrigin()
|
||||
reader = asyncio.create_task(http.get("/api/v1/users/me", headers=actor(alice)))
|
||||
await entered.wait()
|
||||
@@ -106,6 +129,10 @@ async def test_unreachable_cache_is_bypassed_without_anonymous_access() -> None:
|
||||
stranger = await http.get("/api/v1/users/me", headers=bearer("x" * 43))
|
||||
elapsed = time.perf_counter() - started
|
||||
ready = await http.get("/health/ready")
|
||||
chat = await make_chat(http, alice)
|
||||
posted = await http.post(
|
||||
f"/api/v1/chats/{chat['id']}/messages", json={"text": "без кэша"}, headers=keyed(alice)
|
||||
)
|
||||
logout = await http.delete("/api/v1/auth/sessions/current", headers=actor(alice))
|
||||
still = await http.get("/api/v1/users/me", headers=actor(alice))
|
||||
assert me.json() == alice
|
||||
@@ -113,6 +140,7 @@ async def test_unreachable_cache_is_bypassed_without_anonymous_access() -> None:
|
||||
assert stranger.headers["WWW-Authenticate"] == BEARER
|
||||
assert elapsed < 1
|
||||
assert ready.status_code == 200
|
||||
assert posted.status_code == 201
|
||||
assert logout.status_code == 503
|
||||
assert logout.json()["error"]["code"] == "unavailable"
|
||||
assert still.status_code == 200
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import asyncio
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from urllib.parse import quote
|
||||
from uuid import uuid4
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
||||
from conftest import PASSWORD, actor, keyed, make_chat, register
|
||||
from messenger.shared.infrastructure.clock import MonotonicUtcClock
|
||||
|
||||
CLIENTS = 10
|
||||
PER_CLIENT = 10
|
||||
@@ -60,6 +63,22 @@ async def test_hundred_messages_from_ten_clients(client: AsyncClient) -> None:
|
||||
assert len(set(stamps)) == TOTAL, "created_at внутри чата обязан строго возрастать"
|
||||
|
||||
|
||||
async def test_history_follows_the_clock_but_never_moves_back(
|
||||
monkeypatch: pytest.MonkeyPatch, client: AsyncClient
|
||||
) -> None:
|
||||
alice = await register(client, "alice")
|
||||
chat = await make_chat(client, alice)
|
||||
base = datetime.now(UTC) + timedelta(minutes=10)
|
||||
stamps = []
|
||||
for moment in (base, base - timedelta(minutes=5), base + timedelta(seconds=5)):
|
||||
monkeypatch.setattr(MonotonicUtcClock, "now", lambda _self, moment=moment: moment)
|
||||
response = await client.post(
|
||||
f"/api/v1/chats/{chat['id']}/messages", json={"text": "часы"}, headers=keyed(alice)
|
||||
)
|
||||
stamps.append(datetime.fromisoformat(response.json()["created_at"]))
|
||||
assert stamps == [base, base + timedelta(microseconds=1), base + timedelta(seconds=5)]
|
||||
|
||||
|
||||
async def test_parallel_registration_keeps_username_unique(client: AsyncClient) -> None:
|
||||
body = {"username": f"race_{uuid4().hex[:12]}", "display_name": "Гонка", "password": PASSWORD}
|
||||
responses = await asyncio.gather(*(client.post("/api/v1/users", json=body) for _ in range(20)))
|
||||
|
||||
@@ -9,10 +9,10 @@ import time
|
||||
import httpx
|
||||
|
||||
from conftest import DATABASE, new_user
|
||||
from messenger.shared.entrypoints.health import DRAINING
|
||||
from messenger.shared.infrastructure.readiness import DRAINING
|
||||
|
||||
DRAIN = 1.5
|
||||
SHUTDOWN = 4
|
||||
DRAIN = 1.0
|
||||
SHUTDOWN = 3
|
||||
GUNICORN = (
|
||||
"-m",
|
||||
"gunicorn",
|
||||
@@ -49,6 +49,17 @@ def status(port: int, path: str) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def answer_of(connection: socket.socket) -> tuple[str, dict[str, str], dict]:
|
||||
data = b""
|
||||
while chunk := connection.recv(4096):
|
||||
data += chunk
|
||||
connection.close()
|
||||
head, _, body = data.partition(b"\r\n\r\n")
|
||||
status, *lines = head.decode("latin-1").split("\r\n")
|
||||
headers = dict(line.lower().split(": ", 1) for line in lines)
|
||||
return status, headers, json.loads(body) if body else {}
|
||||
|
||||
|
||||
def begin_registration(port: int) -> tuple[socket.socket, bytes]:
|
||||
body = json.dumps(new_user("drain")).encode()
|
||||
head = (
|
||||
@@ -60,7 +71,7 @@ def begin_registration(port: int) -> tuple[socket.socket, bytes]:
|
||||
return connection, body[8:]
|
||||
|
||||
|
||||
def test_sigterm_leaves_rotation_then_closes_and_exits() -> None:
|
||||
def test_sigterm_leaves_rotation_then_closes_and_cancels_stuck_requests() -> None:
|
||||
port = free_port()
|
||||
settings = {
|
||||
"HOST": "127.0.0.1",
|
||||
@@ -86,6 +97,7 @@ def test_sigterm_leaves_rotation_then_closes_and_exits() -> None:
|
||||
assert time.monotonic() < deadline, "gunicorn не стал готов"
|
||||
time.sleep(0.2)
|
||||
pending, rest = begin_registration(port)
|
||||
stuck, _ = begin_registration(port)
|
||||
sent = time.monotonic()
|
||||
server.send_signal(signal.SIGTERM)
|
||||
time.sleep(0.3)
|
||||
@@ -98,13 +110,21 @@ def test_sigterm_leaves_rotation_then_closes_and_exits() -> None:
|
||||
pending.close()
|
||||
code = server.wait(timeout=SHUTDOWN + 2)
|
||||
exited = time.monotonic() - sent
|
||||
cancelled, headers, error = answer_of(stuck)
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
server.kill()
|
||||
print(f"окно: ready/live {during}, порт закрыт через {closed:.2f} с, выход {exited:.2f} с")
|
||||
print(f"запрос, принятый до SIGTERM и дописанный после закрытия порта: {answer}")
|
||||
print(f"запрос, тело которого так и не пришло: {cancelled or 'соединение закрыто без ответа'}")
|
||||
print(f" content-type {headers.get('content-type')}, тело {error}")
|
||||
assert during == (503, 200)
|
||||
assert answer == "HTTP/1.1 201 Created"
|
||||
assert cancelled == "HTTP/1.1 503 Service Unavailable"
|
||||
assert headers["content-type"] == "application/json"
|
||||
assert headers["x-instance-id"]
|
||||
assert error["error"]["code"] == "unavailable"
|
||||
assert error["error"]["request_id"] == headers["x-request-id"]
|
||||
assert DRAIN - 0.2 <= closed < SHUTDOWN
|
||||
assert exited < SHUTDOWN
|
||||
assert code == 0
|
||||
|
||||
@@ -77,18 +77,6 @@ async def test_queue_overflow_drops_events_without_raising() -> None:
|
||||
assert bus.pending <= 16
|
||||
|
||||
|
||||
async def test_projection_runs_before_publish_returns() -> None:
|
||||
bus = EventBus(NullLogger())
|
||||
seen: list[str] = []
|
||||
|
||||
async def projection(_event: MessagePosted) -> None:
|
||||
seen.append("projected")
|
||||
|
||||
bus.project(MessagePosted, projection)
|
||||
await InMemoryEventPublisher(bus).publish([posted()])
|
||||
assert seen == ["projected"]
|
||||
|
||||
|
||||
async def test_publication_does_not_delay_response() -> None:
|
||||
app = create_app(**split_settings(log_level="CRITICAL"))
|
||||
async with (
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
import json
|
||||
import time
|
||||
from collections.abc import AsyncIterator
|
||||
from uuid import uuid4
|
||||
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from conftest import PASSWORD, actor, keyed, make_chat, register, running_app, split_settings
|
||||
from conftest import (
|
||||
PASSWORD,
|
||||
actor,
|
||||
keyed,
|
||||
make_chat,
|
||||
new_user,
|
||||
register,
|
||||
running_app,
|
||||
split_settings,
|
||||
)
|
||||
from messenger.main import create_app
|
||||
|
||||
MARKER_TEXT = "маркер-который-не-должен-попасть-в-логи-9f3a"
|
||||
@@ -100,6 +110,23 @@ async def test_body_limit_returns_413() -> None:
|
||||
assert response.json()["error"]["code"] == "payload_too_large"
|
||||
|
||||
|
||||
async def test_chunked_body_is_limited_too() -> None:
|
||||
async def chunks(body: bytes) -> AsyncIterator[bytes]:
|
||||
for start in range(0, len(body), 1000):
|
||||
yield body[start : start + 1000]
|
||||
|
||||
user = json.dumps(new_user("chunked")).encode()
|
||||
async with running_app(max_body_bytes=4096) as http:
|
||||
large = await http.post("/api/v1/users", content=chunks(b"x" * 5000))
|
||||
small = await http.post(
|
||||
"/api/v1/users", content=chunks(user), headers={"Content-Type": "application/json"}
|
||||
)
|
||||
assert "content-length" not in large.request.headers
|
||||
assert large.status_code == 413
|
||||
assert large.json()["error"]["code"] == "payload_too_large"
|
||||
assert small.status_code == 201
|
||||
|
||||
|
||||
async def test_ready_turns_unavailable_without_database() -> None:
|
||||
async with running_app(database_url="postgresql://u:p@127.0.0.1:1/none") as http:
|
||||
started = time.perf_counter()
|
||||
|
||||
@@ -102,14 +102,15 @@ async def test_cursor_from_another_chat_is_rejected(client: AsyncClient) -> None
|
||||
assert response.json()["error"]["code"] == "invalid_request"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("cursor", ["garbage", "1.2.3.4", "%20"])
|
||||
@pytest.mark.parametrize("cursor", ["garbage", "1.2.3.4", "%20", ""])
|
||||
async def test_broken_cursor_is_rejected(client: AsyncClient, cursor: str) -> None:
|
||||
alice = await register(client, "alice")
|
||||
chat = await make_chat(client, alice)
|
||||
response = await client.get(
|
||||
f"/api/v1/chats/{chat['id']}/messages?cursor={cursor}", headers=actor(alice)
|
||||
)
|
||||
assert response.status_code == 400
|
||||
await fill(client, chat, alice, 1)
|
||||
for path in (f"/api/v1/chats/{chat['id']}/messages", "/api/v1/chats"):
|
||||
response = await client.get(f"{path}?limit=1&cursor={cursor}", headers=actor(alice))
|
||||
assert response.status_code == 400, f"{path}?cursor={cursor} → {response.status_code}"
|
||||
assert response.json()["error"]["code"] == "invalid_request"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("limit", ["0", "-1", "101", "abc", "1.5", ""])
|
||||
|
||||
@@ -29,16 +29,19 @@ def sweeper(http: AsyncClient) -> UploadSweeper:
|
||||
return APPS[id(http)].state.sweeper
|
||||
|
||||
|
||||
async def discarded(http: AsyncClient) -> list[AttachmentDiscarded]:
|
||||
seen: list[AttachmentDiscarded] = []
|
||||
|
||||
async def keep(event: AttachmentDiscarded) -> None:
|
||||
seen.append(event)
|
||||
|
||||
(await resolve(http, EventBus)).project(AttachmentDiscarded, keep)
|
||||
async def discarded(http: AsyncClient) -> asyncio.Queue[AttachmentDiscarded]:
|
||||
seen: asyncio.Queue[AttachmentDiscarded] = asyncio.Queue()
|
||||
(await resolve(http, EventBus)).subscribe(AttachmentDiscarded, seen.put)
|
||||
return seen
|
||||
|
||||
|
||||
async def delivered(seen: asyncio.Queue[AttachmentDiscarded], count: int) -> list[str]:
|
||||
async with asyncio.timeout(2):
|
||||
events = [await seen.get() for _ in range(count)]
|
||||
assert seen.empty()
|
||||
return sorted(f"{event.reason} {event.attachment_id}" for event in events)
|
||||
|
||||
|
||||
async def intent(http: AsyncClient, user: dict[str, Any], chat: dict[str, Any]) -> str:
|
||||
store = await storage(http)
|
||||
store.failing = True
|
||||
@@ -79,7 +82,7 @@ async def test_commit_failure_after_put_is_compensated(client: AsyncClient) -> N
|
||||
assert response.json()["error"]["code"] == "unavailable"
|
||||
assert await scalar("SELECT count(*) FROM attachments WHERE filename = $1", name) == 0
|
||||
assert set(store.objects) == before
|
||||
assert [event.reason for event in seen] == ["compensation"]
|
||||
assert [event.split()[0] for event in await delivered(seen, 1)] == ["compensation"]
|
||||
|
||||
|
||||
async def test_lost_intent_gives_503_and_no_object(client: AsyncClient) -> None:
|
||||
@@ -142,8 +145,7 @@ async def test_parallel_sweeps_share_the_work(client: AsyncClient) -> None:
|
||||
seen = await discarded(client)
|
||||
first, second = await asyncio.gather(sweeper(client).sweep(), sweeper(client).sweep())
|
||||
assert first + second == 5
|
||||
assert sorted(str(event.attachment_id) for event in seen) == sorted(pending)
|
||||
assert {event.reason for event in seen} == {"abandoned"}
|
||||
assert await delivered(seen, 5) == sorted(f"abandoned {item}" for item in pending)
|
||||
assert await sweeper(client).sweep() == 0
|
||||
objects = (await storage(client)).objects
|
||||
assert not any(f"attachments/{attachment_id}" in objects for attachment_id in pending)
|
||||
|
||||
@@ -86,7 +86,7 @@ def valkey() -> Iterator[dict[str, str]]:
|
||||
time.sleep(0.2)
|
||||
yield {"name": name, "url": f"redis://127.0.0.1:{published(name, 6379)}/0"}
|
||||
finally:
|
||||
subprocess.run(["docker", "rm", "-f", name], capture_output=True, check=False)
|
||||
subprocess.run(["docker", "rm", "-fv", name], capture_output=True, check=False)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -101,7 +101,7 @@ def database() -> Iterator[str]:
|
||||
DATABASE["url"] = dsn
|
||||
yield dsn
|
||||
finally:
|
||||
subprocess.run(["docker", "rm", "-f", name], capture_output=True, check=False)
|
||||
subprocess.run(["docker", "rm", "-fv", name], capture_output=True, check=False)
|
||||
|
||||
|
||||
def split_settings(**overrides: Any) -> dict[str, Any]:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import time
|
||||
from collections.abc import AsyncIterator
|
||||
from uuid import uuid4
|
||||
|
||||
@@ -18,6 +19,7 @@ from stand import (
|
||||
new_user,
|
||||
psql,
|
||||
report,
|
||||
restart_stack,
|
||||
started_at,
|
||||
timed,
|
||||
valkey,
|
||||
@@ -55,7 +57,8 @@ async def test_chat_creation_rolls_back_on_unknown_member(http: AsyncClient) ->
|
||||
json={"title": title, "member_ids": [alice["id"], str(uuid4())]},
|
||||
headers=bearer(token),
|
||||
)
|
||||
print(f"чат с несуществующим участником: {response.status_code}")
|
||||
code = response.json()["error"]["code"]
|
||||
print(f"чат с несуществующим участником: {response.status_code} {code}")
|
||||
assert response.status_code == 400
|
||||
assert response.json()["error"]["code"] == "invalid_request"
|
||||
assert psql("SELECT count(*) FROM chats WHERE title = :'title'", title=title) == "0"
|
||||
@@ -227,3 +230,43 @@ async def test_api_restart_keeps_session_without_extending_it(http: AsyncClient)
|
||||
print(f"expires_at при входе {session['expires_at']}, в БД после рестарта {stored}")
|
||||
assert me.status_code == 200
|
||||
assert stored.rstrip("Z").rstrip("0") == session["expires_at"].rstrip("Z").rstrip("0")
|
||||
|
||||
|
||||
async def test_full_restart_keeps_session_until_logout(http: AsyncClient) -> None:
|
||||
user, token = await enroll(http, "fullrestart")
|
||||
restart_stack()
|
||||
recovered = await wait_ready(http)
|
||||
me = await http.get("/api/v1/users/me", headers=bearer(token))
|
||||
logout = await http.delete("/api/v1/auth/sessions/current", headers=bearer(token))
|
||||
after = await http.get("/api/v1/users/me", headers=bearer(token))
|
||||
print(
|
||||
f"restart.sh: готовность через {recovered:.1f} с, прежний токен {me.status_code}, "
|
||||
f"выход {logout.status_code}, затем {after.status_code}"
|
||||
)
|
||||
assert me.json() == user
|
||||
assert logout.status_code == 204
|
||||
assert after.status_code == 401
|
||||
|
||||
|
||||
async def test_session_expires_after_restart_at_original_time(http: AsyncClient) -> None:
|
||||
user, token = await enroll(http, "shortrestart")
|
||||
expires_at = float(
|
||||
psql(
|
||||
"UPDATE sessions s SET expires_at = now() + interval '20 seconds' FROM users u "
|
||||
"WHERE u.id = s.user_id AND u.username = :'name' "
|
||||
"RETURNING extract(epoch FROM s.expires_at)",
|
||||
name=user["username"],
|
||||
).splitlines()[0]
|
||||
)
|
||||
compose("restart", "api")
|
||||
recovered = await wait_ready(http)
|
||||
fresh = await http.get("/api/v1/users/me", headers=bearer(token))
|
||||
await asyncio.sleep(max(0.0, expires_at - time.time()) + 0.5)
|
||||
stale = await http.get("/api/v1/users/me", headers=bearer(token))
|
||||
print(
|
||||
f"срок сессии сокращён до 20 с, рестарт api: готовность через {recovered:.1f} с, "
|
||||
f"до срока {fresh.status_code}, после срока {stale.status_code}"
|
||||
)
|
||||
assert fresh.status_code == 200
|
||||
assert stale.status_code == 401
|
||||
assert stale.headers["WWW-Authenticate"] == BEARER
|
||||
|
||||
@@ -32,6 +32,10 @@ def compose(*args: str, stdin: str | None = None) -> str:
|
||||
return done.stdout.strip()
|
||||
|
||||
|
||||
def restart_stack() -> None:
|
||||
subprocess.run(["sh", "scripts/restart.sh"], cwd=ROOT, check=True, capture_output=True)
|
||||
|
||||
|
||||
def psql(sql: str, **variables: str) -> str:
|
||||
assigned = [item for name, value in variables.items() for item in ("-v", f"{name}={value}")]
|
||||
command = ["exec", "-T", "postgres", "psql", "-U", "messenger", "-d", "messenger", "-tA"]
|
||||
|
||||
@@ -9,13 +9,12 @@ from messenger.identity.domain.errors import InvalidUserData
|
||||
from messenger.identity.domain.models import Session, User, token_digest
|
||||
from messenger.identity.domain.values import DisplayName, Password, Username
|
||||
from messenger.messaging.domain.errors import (
|
||||
ChatNotFound,
|
||||
IdempotencyConflict,
|
||||
InvalidAttachmentList,
|
||||
InvalidChatData,
|
||||
InvalidMessageText,
|
||||
)
|
||||
from messenger.messaging.domain.models import Chat, Receipt
|
||||
from messenger.messaging.domain.models import Chat, Message, Receipt, attachment_list
|
||||
from messenger.messaging.domain.values import MessageText
|
||||
from messenger.shared.infrastructure.clock import MonotonicUtcClock
|
||||
|
||||
@@ -90,17 +89,6 @@ def test_message_text_rejects_whitespace() -> None:
|
||||
assert MessageText("").value == ""
|
||||
|
||||
|
||||
def make_chat(*members: object) -> Chat:
|
||||
ids = [uuid4() for _ in members] if members else [uuid4()]
|
||||
return Chat.create(
|
||||
chat_id=uuid4(),
|
||||
title="Чат",
|
||||
member_ids=ids,
|
||||
creator_id=ids[0],
|
||||
created_at=MOMENT,
|
||||
)
|
||||
|
||||
|
||||
def test_chat_requires_creator_in_members() -> None:
|
||||
members = [uuid4(), uuid4()]
|
||||
with pytest.raises(InvalidChatData):
|
||||
@@ -137,87 +125,38 @@ def test_chat_rejects_more_than_hundred_members() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_outsider_cannot_post() -> None:
|
||||
chat = make_chat(1)
|
||||
with pytest.raises(ChatNotFound):
|
||||
chat.post(message_id=uuid4(), sender_id=uuid4(), text="привет", now=MOMENT)
|
||||
|
||||
|
||||
def test_post_never_moves_history_back() -> None:
|
||||
chat = make_chat(1)
|
||||
sender = chat.member_ids[0]
|
||||
first = chat.post(
|
||||
message_id=uuid4(), sender_id=sender, text="первое", now=MOMENT + timedelta(seconds=1)
|
||||
)
|
||||
second = chat.post(message_id=uuid4(), sender_id=sender, text="второе", now=MOMENT)
|
||||
assert second.created_at == first.created_at + timedelta(microseconds=1)
|
||||
assert chat.last_message_at == second.created_at
|
||||
|
||||
|
||||
def test_post_keeps_clock_when_it_is_ahead() -> None:
|
||||
chat = make_chat(1)
|
||||
sender = chat.member_ids[0]
|
||||
first = chat.post(message_id=uuid4(), sender_id=sender, text="первое", now=MOMENT)
|
||||
later = MOMENT + timedelta(seconds=5)
|
||||
second = chat.post(message_id=uuid4(), sender_id=sender, text="второе", now=later)
|
||||
assert first.created_at == MOMENT
|
||||
assert second.created_at == later
|
||||
|
||||
|
||||
def test_post_validates_membership_before_text() -> None:
|
||||
chat = make_chat(1)
|
||||
with pytest.raises(ChatNotFound):
|
||||
chat.post(message_id=uuid4(), sender_id=uuid4(), text="", now=MOMENT)
|
||||
|
||||
|
||||
def test_empty_text_needs_an_attachment() -> None:
|
||||
chat = make_chat(1)
|
||||
sender = chat.member_ids[0]
|
||||
with pytest.raises(InvalidMessageText):
|
||||
chat.post(message_id=uuid4(), sender_id=sender, text="", now=MOMENT)
|
||||
ids = (uuid4(), uuid4())
|
||||
message = chat.post(
|
||||
message_id=uuid4(), sender_id=sender, text="", now=MOMENT, attachment_ids=ids
|
||||
)
|
||||
assert message.attachment_ids == ids
|
||||
with pytest.raises(InvalidMessageText):
|
||||
chat.post(message_id=uuid4(), sender_id=sender, text=" ", now=MOMENT, attachment_ids=ids)
|
||||
attachment_list(MessageText(""), ())
|
||||
assert attachment_list(MessageText(""), ids) == ids
|
||||
|
||||
|
||||
@pytest.mark.parametrize("ids", [[uuid4() for _ in range(11)], [UUID_TWICE, UUID_TWICE]])
|
||||
def test_attachment_list_is_bounded_and_unique(ids: list[UUID]) -> None:
|
||||
chat = make_chat(1)
|
||||
with pytest.raises(InvalidAttachmentList):
|
||||
chat.post(
|
||||
message_id=uuid4(),
|
||||
sender_id=chat.member_ids[0],
|
||||
text="x",
|
||||
now=MOMENT,
|
||||
attachment_ids=ids,
|
||||
)
|
||||
|
||||
|
||||
def test_membership_is_checked_before_attachments() -> None:
|
||||
chat = make_chat(1)
|
||||
with pytest.raises(ChatNotFound):
|
||||
chat.post(
|
||||
message_id=uuid4(),
|
||||
sender_id=uuid4(),
|
||||
text="",
|
||||
now=MOMENT,
|
||||
attachment_ids=[uuid4() for _ in range(11)],
|
||||
)
|
||||
attachment_list(MessageText("x"), ids)
|
||||
|
||||
|
||||
def test_receipt_replays_only_the_same_request() -> None:
|
||||
chat = make_chat(1)
|
||||
message = chat.post(message_id=uuid4(), sender_id=chat.member_ids[0], text="раз", now=MOMENT)
|
||||
message = Message(uuid4(), uuid4(), uuid4(), MessageText("раз"), MOMENT)
|
||||
receipt = Receipt("key-1", b"a" * 32, message)
|
||||
assert receipt.replay(b"a" * 32) is message
|
||||
with pytest.raises(IdempotencyConflict):
|
||||
receipt.replay(b"b" * 32)
|
||||
|
||||
|
||||
def test_posted_message_describes_itself() -> None:
|
||||
message = Message(uuid4(), uuid4(), uuid4(), MessageText("пять"), MOMENT)
|
||||
event = message.posted()
|
||||
assert (event.message_id, event.chat_id, event.sender_id) == (
|
||||
message.id,
|
||||
message.chat_id,
|
||||
message.sender_id,
|
||||
)
|
||||
assert (event.text_length, event.created_at, event.name) == (4, MOMENT, "message.posted")
|
||||
|
||||
|
||||
def test_user_registration_emits_event() -> None:
|
||||
user, event = User.register(
|
||||
user_id=uuid4(),
|
||||
|
||||
@@ -46,15 +46,16 @@ def test_timeouts_shrink_inwards_and_shutdown_fits_the_stop_budget() -> None:
|
||||
database = api["DB_ACQUIRE_TIMEOUT_SECONDS"] + api["DB_COMMAND_TIMEOUT_SECONDS"]
|
||||
drain, shutdown = api["DRAIN_SECONDS"], api["SHUTDOWN_TIMEOUT_SECONDS"]
|
||||
print(
|
||||
f"обнаружение {detection} с (зависание {hung} с), окно {drain} с, остановка {shutdown} с,"
|
||||
f" хук {hook} с, stop_grace_period {grace} с; LB server {lb['timeout server']} с >"
|
||||
f"обнаружение {detection} с (зависание {hung} с), окно {drain} с,"
|
||||
f" дообработка {shutdown - drain - 1} с, остановка {shutdown} с, хук {hook} с,"
|
||||
f" stop_grace_period {grace} с; LB server {lb['timeout server']} с >"
|
||||
f" запрос {api['REQUEST_TIMEOUT_SECONDS']} с > БД {database} с;"
|
||||
f" readiness {2 * PING_TIMEOUT_SECONDS} с < check {lb['timeout check']} с"
|
||||
)
|
||||
assert lb["timeout server"] > api["REQUEST_TIMEOUT_SECONDS"] > database
|
||||
assert lb["timeout check"] > 2 * PING_TIMEOUT_SECONDS
|
||||
assert drain > detection
|
||||
assert shutdown - drain >= database
|
||||
assert shutdown - drain - 1 >= database
|
||||
assert shutdown < hook < grace < 10
|
||||
assert lb["hard-stop-after"] < seconds(stand["lb"]["stop_grace_period"])
|
||||
assert (detection, hung) == (1.5, 3.5)
|
||||
|
||||
@@ -277,6 +277,68 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.5.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/33/1c/f41d4e74c28ab327ff3acd36053f7ea506c55872d7a90b0fa71aa3ab0c89/charset_normalizer-3.5.2.tar.gz", hash = "sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef", size = 172659, upload-time = "2026-09-30T04:39:23.398Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/58/ca/7aa91362a2f77ac8e9e28a9b902a74f7d0e11a851ef0d27a74308da8cd90/charset_normalizer-3.5.2-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187", size = 226010, upload-time = "2026-09-30T04:36:27.669Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a8/cf/ac8878d0322cf88a1aad4c7b147db32ca0bd806eb0060957b2e31486dbe6/charset_normalizer-3.5.2-cp314-cp314-android_24_x86_64.whl", hash = "sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad", size = 239266, upload-time = "2026-09-30T04:36:29.434Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/6d/9a08d7e0b29b7208e2c6c01dc56c8e0520e7c7beadbbfb024b58fd69c8a5/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf", size = 206783, upload-time = "2026-09-30T04:36:30.872Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/44/b0aa350280e6ff5a5492d17cf10460dd39d5ee848f872f7ba2df10607f60/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995", size = 210449, upload-time = "2026-09-30T04:36:32.625Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/8a/40db9aa9f5907bb0e6f8b6d64064bf8852fb33d4b813ff9414911df7647c/charset_normalizer-3.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424", size = 367815, upload-time = "2026-09-30T04:36:34.197Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7f/72/9c5e7707b57c8ddfa9ddf7b0b1d009d7fbab9e9e887d5b721060f37e307d/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13", size = 247095, upload-time = "2026-09-30T04:36:35.803Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/83/09/71e453691e927de4ddf792770cfaab3f49d494e222f66ea5e404bbd5e39c/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d", size = 233942, upload-time = "2026-09-30T04:36:37.407Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9f/86/85c84e4da8b27dd409577d9437926ff581c5f9d3c66038dc68c1a526de51/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4", size = 273762, upload-time = "2026-09-30T04:36:38.904Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/08/564955a4b5f2ccb410ab480bbe8c6a18063ff27f2d35458731c4a5335df9/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438", size = 269514, upload-time = "2026-09-30T04:36:40.469Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/24/bad3ac4271589df29cf5ce2f5ae490518a5739358052bd0d61209e6fea54/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a", size = 255056, upload-time = "2026-09-30T04:36:42.02Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/3e/350d89ad49916b86554d6f5f2d03ec1152148f87e5ff735106c6a03b1a36/charset_normalizer-3.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56", size = 251311, upload-time = "2026-09-30T04:36:43.577Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/5b/4970a2d154df502e133402906dd04e3ae7cada7b3011283c88d0479a2585/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd", size = 250190, upload-time = "2026-09-30T04:36:45.185Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/88/8c/f1a91bddc8fb47c2889e29ea7ea49a194eb0d9868675d786806519c00d76/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204", size = 237098, upload-time = "2026-09-30T04:36:46.689Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/24/0e/bb5dace3cc7e79068425386a6589c19b5a2ab5fefc2a46abea6919683332/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7", size = 274228, upload-time = "2026-09-30T04:36:48.31Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/79/b849ad523017ea9f5a45581bbebed91439e0cf42fd2860a6f64e358eb5a6/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd", size = 252401, upload-time = "2026-09-30T04:36:50.091Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/8c/75469d690cf47200bce8f6cad7655724fc23148e147abfc5ce78b5f65863/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc", size = 271846, upload-time = "2026-09-30T04:36:51.719Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/cd/6d52d3c7437cdcf2e310ce9f28f282e733d4ef60ed19105d1819c356255f/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874", size = 258151, upload-time = "2026-09-30T04:36:53.234Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f7/4c/070b38bdb5f49a70199fce923ec0726a49536a63ab262abbfcaaf351110b/charset_normalizer-3.5.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655", size = 143570, upload-time = "2026-09-30T04:36:54.816Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/84/9ebfc8ed6c8c4fcd8e726ff6bf220cc8deb3966e31dce9be8dd8aa017e64/charset_normalizer-3.5.2-cp314-cp314-win32.whl", hash = "sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0", size = 186412, upload-time = "2026-09-30T04:36:56.643Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/78/5ed86f743d4bc350db307e7636419a0a5ee1d91806d30c7f667bd5c80dae/charset_normalizer-3.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c", size = 210965, upload-time = "2026-09-30T04:36:58.205Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/94/a3a7698e9b1a395e1eb99ccd9a324be9347973bff4e72db2a06496d7cd27/charset_normalizer-3.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253", size = 200406, upload-time = "2026-09-30T04:36:59.764Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/48/c5dd00d5ef7791f02666de250a5bb6071e29b7e133cf4b835800b6d3bc27/charset_normalizer-3.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709", size = 396871, upload-time = "2026-09-30T04:37:01.543Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/c8/8379554b42e8368161d898476686947a0fdbd3e8865170d7909dcabfdee8/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084", size = 249711, upload-time = "2026-09-30T04:37:03.111Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/eb/2ddb1035d17320caa9f41682935123a9a250277b261c3efc86b2d2a21343/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb", size = 231146, upload-time = "2026-09-30T04:37:04.721Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/24/2ecb4bde104322cd7859d6594fcfa74649f8d90b3221c9feecbef149875b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f", size = 271552, upload-time = "2026-09-30T04:37:06.295Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/98/9d5f6ebc3aee9fef5d30b4aff11fb2ab7a1222b4064f8ef2c7c87cde217a/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09", size = 269810, upload-time = "2026-09-30T04:37:07.905Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/e1/a3b06a10461b1b7628853c934c644e03bc28e42767116afb52f19a56519b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80", size = 259845, upload-time = "2026-09-30T04:37:09.554Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/d3/6f561f74a296cf27d61775a1dc665ad13f3bff6a798810ca05907f37a7c4/charset_normalizer-3.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c", size = 252825, upload-time = "2026-09-30T04:37:11.274Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/9f/69e13ca3b18f43e0eafcd34c04a45b732ae22a43b54a5fc9e119103356eb/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f", size = 252659, upload-time = "2026-09-30T04:37:12.941Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/a9/ace29806a0dae18939919c76ba526472d83214afa101105fabff2cf30625/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03", size = 238819, upload-time = "2026-09-30T04:37:14.659Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f8/c1/6116d52a2e3311ec80f21f5fb5e17b27405f10b9608af8f6e69516841a1b/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604", size = 272973, upload-time = "2026-09-30T04:37:16.346Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/aa/9955c7e93bba10a9c7e8f7a5031b7ced66f3a1883a55c00712b8d5850ff3/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8", size = 253692, upload-time = "2026-09-30T04:37:18.212Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/33/2a6ae7fdc1b10cb581cef91addd8cdfc5f40d50abb5702309369d5834579/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93", size = 268757, upload-time = "2026-09-30T04:37:19.877Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/22/80992720a0282cd39bba1db35868e6b9c22f41281160143a836544bc1d8a/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915", size = 262220, upload-time = "2026-09-30T04:37:21.583Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/9f/181fd07e1bffea1d95cd80c84ac537354f50699c22cfc4d3c02b6fc16208/charset_normalizer-3.5.2-cp314-cp314t-win32.whl", hash = "sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5", size = 197797, upload-time = "2026-09-30T04:37:23.235Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/49/1c/25d8415ec1c4f2f41f1680435e4c87cfb378ff2f677d950946f2a45d0632/charset_normalizer-3.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc", size = 222765, upload-time = "2026-09-30T04:37:24.891Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/b4/46b48f013dadfc0d0d33b375438e31bdf5a989dc68389c6bf627054d4df9/charset_normalizer-3.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105", size = 210985, upload-time = "2026-09-30T04:37:26.634Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/ab/176fbfd5b64939c55d652366aa5b9ef1d767af207a3aa6ebeb0d226c484d/charset_normalizer-3.5.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd", size = 331815, upload-time = "2026-09-30T04:38:26.216Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/84/371eac6b30bdbcbf2d632a1a01809103459216fcaae61b8b8d922c1bfb8a/charset_normalizer-3.5.2-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7", size = 253276, upload-time = "2026-09-30T04:38:28.032Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/6f/c4fbae58febff71709c51bc7e18fdfa55341dc382704740f9f0cbf03817b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f", size = 241239, upload-time = "2026-09-30T04:38:29.732Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/71/458c3f42164a07d0c5210798e9e704b39e540a6793b05aba67f3a35243a9/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93", size = 231121, upload-time = "2026-09-30T04:38:31.462Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/54/ab9e89367076f6331bb6c65c4bf14a5361fa5191cb6561bf534f18504e1b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade", size = 260350, upload-time = "2026-09-30T04:38:33.239Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/c1/061431ecc688d9d76602502cb57cc01e691e682c18f1beb45f9673b5bbd2/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0", size = 255430, upload-time = "2026-09-30T04:38:34.865Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/1f/20c8949f0676f7ab811abdeb7f4d7f1cbc6e61ff20bef08b44edeb092bc8/charset_normalizer-3.5.2-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26", size = 250612, upload-time = "2026-09-30T04:38:36.649Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/9e/46f2fa4c431fc98c4ae76a8cb5bdca54e0341e3cfc3fcfd8e82740250818/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011", size = 242083, upload-time = "2026-09-30T04:38:38.26Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/39/559be29a0c0f086e0bba6922babd38916cc5e0b58ced4de13ee01ea05508/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621", size = 232738, upload-time = "2026-09-30T04:38:39.81Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/6c/387b0e4f756a282831c1d9fc6aeb6c51ca4507ca202767c8de15ce9b12e2/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4", size = 260703, upload-time = "2026-09-30T04:38:41.346Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/92/1fdf015f09ef449f50d3ac4b67c90887c9c318b727daa95cc4f866e6521d/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e", size = 247622, upload-time = "2026-09-30T04:38:42.937Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/dc/3c/8e7b8a5671ad5d433669fb2a76f1a0164df2d9b1718b0206bc2a16d840cc/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c", size = 257500, upload-time = "2026-09-30T04:38:44.604Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/f0/45b579df5cabc1d5d53ea1cc35e8437d3ca768c0acccc7041517cb6fbb32/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0", size = 255100, upload-time = "2026-09-30T04:38:46.289Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/31/68/fdec18a343f5fb3f310588dd478b09ac4799e0b187dbade3a8cd776f03ef/charset_normalizer-3.5.2-cp37-abi3-win32.whl", hash = "sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf", size = 174499, upload-time = "2026-09-30T04:38:47.999Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/8a/b618149cc5207943a0242068d7a27897f56a62947b5a039085f2a22029f8/charset_normalizer-3.5.2-cp37-abi3-win_amd64.whl", hash = "sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036", size = 200092, upload-time = "2026-09-30T04:38:49.707Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/cf/4c66866fa9e2b1c78e3c911516d1de497a677b7ac60f1eceda74ce777ca3/charset_normalizer-3.5.2-cp37-abi3-win_arm64.whl", hash = "sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e", size = 294363, upload-time = "2026-09-30T04:38:51.312Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/ad/d07d7862a62ffa6d79d68074d14823243dd235a77c45262acbf6adeb28bf/charset_normalizer-3.5.2-py3-none-any.whl", hash = "sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685", size = 68872, upload-time = "2026-09-30T04:39:21.828Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.5.0"
|
||||
@@ -456,6 +518,74 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/14/2f/967ba146e6d58cf6a652da73885f52fc68001525b4197effc174321d70b4/jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64", size = 20419, upload-time = "2026-01-22T16:35:24.919Z" },
|
||||
]
|
||||
|
||||
[[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.3.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pathable" },
|
||||
{ name = "pyyaml" },
|
||||
{ name = "referencing" },
|
||||
{ name = "requests" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6e/45/41ebc679c2a4fced6a722f624c18d658dee42612b83ea24c1caf7c0eb3a8/jsonschema_path-0.3.4.tar.gz", hash = "sha256:8365356039f16cc65fddffafda5f58766e34bebab7d6d105616ab52bc4297001", size = 11159, upload-time = "2025-01-24T14:33:16.547Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/58/3485da8cb93d2f393bce453adeef16896751f14ba3e2024bc21dc9597646/jsonschema_path-0.3.4-py3-none-any.whl", hash = "sha256:f502191fdc2b22050f9a81c9237be9d27145b9001c55842bece5e94e382e52f8", size = 14810, upload-time = "2025-01-24T14:33:14.652Z" },
|
||||
]
|
||||
|
||||
[[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/d0/0b/410ea9a56ad59421d8969535099560f0bad7162d483869e1c07ff5880f35/lazy_object_proxy-1.13.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:62612150e2b67d1cb26c2201d020773e9bab9c596d783d55ada42885a695f749", size = 26856, upload-time = "2026-10-17T16:37:48.864Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/97/79ab37585905cf6841134806e73ace576d61a87c4eee333be4622161b23f/lazy_object_proxy-1.13.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ad7630266b5775463f2a1806165c1d9dff07780cf1bba3c53f311e1d026e8921", size = 70985, upload-time = "2026-10-20T01:05:49.274Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/2e/66bbb45f20aab9e81139e2bf9fea1a29850b5af769cbf7f181221ce062dc/lazy_object_proxy-1.13.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:73f05b09e37b0eb0ca7d6e80e2b0689c49bedac8c5d69667c1ebb9f02a4ed5c7", size = 70984, upload-time = "2026-10-20T01:05:50.548Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/e0/63dc39750c7b266e9e25022962eba32ba80e4f17fdcd674fc4ad4143fd90/lazy_object_proxy-1.13.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:91a725d3c64dfe13d365cf78c469c2a8f95884859379aeca89cb8d2ed291649a", size = 65689, upload-time = "2026-10-20T01:05:51.765Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e7/6c/b94a8779eec1331477557ca3ea4742860d59dc9bcd4dcf21bcef3cd8c4f2/lazy_object_proxy-1.13.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e28a75d33378141927c08f3eb291cc98d0a22776670ae330f8347f898cd3b175", size = 69492, upload-time = "2026-10-20T01:05:53.116Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/99/6c3ff4a32f15e807ffb868c47de136ebd4be31e7320af42b699dc43a7495/lazy_object_proxy-1.13.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:a785fe44b61fcbffc0e264fe6b735a909e0b5ef922f0e976e281bbe8477fb47a", size = 65019, upload-time = "2026-10-20T01:05:54.462Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/1a/447ff40629a11f879f194e839d59e5a026dd26f4d0eb8672de858644be85/lazy_object_proxy-1.13.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e321425f76451885c93083ecec0850b64de0f83bb94c113e930e8a0a630e45ab", size = 70334, upload-time = "2026-10-20T01:05:55.619Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/52/2ca84fb914b17d4b02193cbf8b6ba9344b36459944a19711d3da1d14b03d/lazy_object_proxy-1.13.0-cp314-cp314-win_amd64.whl", hash = "sha256:0e52094b7fff1f26f4e227b88be3f350817078e4bb79b4c80846fca0d15efae4", size = 26122, upload-time = "2026-10-17T16:37:53.02Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/c7/ebbeb84639e84fbf6f07a48373f76fe048d23fbcfd4557509b48f35d284d/lazy_object_proxy-1.13.0-cp314-cp314-win_arm64.whl", hash = "sha256:b2dd1c37d64cf9f3f4a2072971639408989b0803a3b7f05e75c1fe28d1a93c1f", size = 24746, upload-time = "2026-10-17T16:37:53.954Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/ac/8ff35cc4d1316e056144edfb816dbff9b5db9ccd7e98c69f6b602c11bc29/lazy_object_proxy-1.13.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:348370676ea6d9ed08f9b74545c37e5be4cf009c45b9d50c6aff476fb7fcc7ec", size = 27524, upload-time = "2026-10-17T16:37:49.825Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/14/c5/8afe34ead41fdd48a207c4535192a4e931c56c791d5f0a57c0abd4558c1c/lazy_object_proxy-1.13.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:dee2fb3326cd81384d2b752c3f6888d7ed9eba2cdbf0583097b5168b8bb4a703", size = 80523, upload-time = "2026-10-20T01:05:57.129Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/fd/0e68a385daaf141b1b1d943b132b8a9887bd53abb88886dab286cca9b62e/lazy_object_proxy-1.13.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2b4c446cbc8e411b116c9ee9b475cb664b8bc5c3d912bcbf1bab5c785fc69a02", size = 82823, upload-time = "2026-10-20T01:05:58.56Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/ce/648e09f90dc59cb6007d9093c2cc17d72e2d93c06553828037126205ea7c/lazy_object_proxy-1.13.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1e671e0e9f2793759f382a69a3853c8742474bc011865ed3595187340ac5956d", size = 74655, upload-time = "2026-10-20T01:05:59.717Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/4d/811442390862dbf85e00520ecb0cb58c7dbdf824dc563ad933729f9e20f3/lazy_object_proxy-1.13.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:a0155084a5dc8ce3e1a3d6e3f2fb4d84d5fc09e66ed84dc0e5f8a2697d421ea0", size = 80848, upload-time = "2026-10-20T01:06:00.884Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/24/4e/c30ea3678b50a7ed7774760fbde917106cbb860edb88cc31a17a8385b3d4/lazy_object_proxy-1.13.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:2d07e0bde2738922a7117fccc1a82514aefbc9c07ee8ff0bb84a1c606dbb5ac8", size = 74127, upload-time = "2026-10-20T01:06:01.949Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/d0/862f0f96b031dab7faa036679e2076bbd6a18ea06e34fb1400fca65b03f0/lazy_object_proxy-1.13.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:da9f1b8780678af93c4ddba46826166c53a25d8d71133fc818542bf7b481e033", size = 79497, upload-time = "2026-10-20T01:06:03.122Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/50/20454483d8f95a11710b951518f86aaaaaae9195982fe27c12eeed130660/lazy_object_proxy-1.13.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f21b4711e6744d46a4672497ca2db390cbdb03241d9b1654bbf38dbbc4db2a5e", size = 26670, upload-time = "2026-10-17T16:37:50.977Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/df/c1ff843fd9c4978d9a50ef2bceda3897d71645d4127ec1413aa15204cb64/lazy_object_proxy-1.13.0-cp314-cp314t-win_arm64.whl", hash = "sha256:de295ae25e5c1fd712088547f251c4b2976d2f60df28057b6c416e771a99842b", size = 25297, upload-time = "2026-10-17T16:37:52.088Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mtusi-messenger"
|
||||
version = "1.4.0"
|
||||
@@ -480,6 +610,7 @@ dependencies = [
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "httpx" },
|
||||
{ name = "openapi-spec-validator" },
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-asyncio" },
|
||||
{ name = "ruff" },
|
||||
@@ -507,6 +638,7 @@ requires-dist = [
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "httpx", specifier = ">=0.28.0" },
|
||||
{ name = "openapi-spec-validator", specifier = "==0.7.2" },
|
||||
{ name = "pytest", specifier = ">=8.4.0" },
|
||||
{ name = "pytest-asyncio", specifier = ">=1.2.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.0" },
|
||||
@@ -565,6 +697,35 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/96/1aaad0e5df33f1f5af21775c411349c0234a6edd581ea403bc81919a6eab/multidict-7.2.1-py3-none-any.whl", hash = "sha256:08ea94663d9e7c25d14d78222f7aee906c472d4837766bec62477c38f6e419dc", size = 28145, upload-time = "2026-10-24T20:40:59.159Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openapi-schema-validator"
|
||||
version = "0.6.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "jsonschema" },
|
||||
{ name = "jsonschema-specifications" },
|
||||
{ name = "rfc3339-validator" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/8b/f3/5507ad3325169347cd8ced61c232ff3df70e2b250c49f0fe140edb4973c6/openapi_schema_validator-0.6.3.tar.gz", hash = "sha256:f37bace4fc2a5d96692f4f8b31dc0f8d7400fd04f3a937798eaf880d425de6ee", size = 11550, upload-time = "2025-01-10T18:08:22.268Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/21/c6/ad0fba32775ae749016829dace42ed80f4407b171da41313d1a3a5f102e4/openapi_schema_validator-0.6.3-py3-none-any.whl", hash = "sha256:f3b9870f4e556b5a62a1c39da72a6b4b16f3ad9c73dc80084b1b11e74ba148a3", size = 8755, upload-time = "2025-01-10T18:08:19.758Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openapi-spec-validator"
|
||||
version = "0.7.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "jsonschema" },
|
||||
{ name = "jsonschema-path" },
|
||||
{ name = "lazy-object-proxy" },
|
||||
{ name = "openapi-schema-validator" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/82/af/fe2d7618d6eae6fb3a82766a44ed87cd8d6d82b4564ed1c7cfb0f6378e91/openapi_spec_validator-0.7.2.tar.gz", hash = "sha256:cc029309b5c5dbc7859df0372d55e9d1ff43e96d678b9ba087f7c56fc586f734", size = 36855, upload-time = "2025-06-07T14:48:56.299Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/27/dd/b3fd642260cb17532f66cc1e8250f3507d1e580483e209dc1e9d13bd980d/openapi_spec_validator-0.7.2-py3-none-any.whl", hash = "sha256:4bbdc0894ec85f1d1bea1d6d9c8b2c3c8d7ccaa13577ef40da9c006c9fd0eb60", size = 39713, upload-time = "2025-06-07T14:48:54.077Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "orjson"
|
||||
version = "3.12.0"
|
||||
@@ -593,6 +754,15 @@ 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.4.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/67/93/8f2c2075b180c12c1e9f6a09d1a985bc2036906b13dff1d8917e395f2048/pathable-0.4.4.tar.gz", hash = "sha256:6905a3cd17804edfac7875b5f6c9142a218c7caef78693c2dbbbfbac186d88b2", size = 8124, upload-time = "2025-01-10T18:43:13.247Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/eb/b6260b31b1a96386c0a880edebe26f89669098acea8e0318bff6adb378fd/pathable-0.4.4-py3-none-any.whl", hash = "sha256:5ae9e94793b6ef5a4cbe0a7ce9dbbefc1eec38df253763fd0aeeacf2762dbbc2", size = 9592, upload-time = "2025-01-10T18:43:11.88Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pillow"
|
||||
version = "13.0.0"
|
||||
@@ -846,6 +1016,83 @@ 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.36.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/2f/db/98b5c277be99dd18bfd91dd04e1b759cad18d1a338188c936e92f921c7e2/referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa", size = 74744, upload-time = "2025-01-25T08:48:16.138Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/b1/3baf80dc6d2b7bc27a95a67752d0208e410351e3feb4eb78de5f77454d8d/referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0", size = 26775, upload-time = "2025-01-25T08:48:14.241Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.34.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "certifi" },
|
||||
{ name = "charset-normalizer" },
|
||||
{ name = "idna" },
|
||||
{ name = "urllib3" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" },
|
||||
]
|
||||
|
||||
[[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/8a/f2/67b94be1532767803415c1c5a1fd88ea487643d74a673cec1ba140af77bb/rpds_py-2026.9.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c9d1aca01f49170fdcf5c92761b1fafe97f554b721ca4570c5949fff778f0d4b", size = 347178, upload-time = "2026-10-04T16:30:00.865Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/04/37/b751de2b59b0197a1d92a5dd491de88e8a5e928c2e6562581974f1e85263/rpds_py-2026.9.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3f0e9ac28fc067d4d34b88ae43c48e9489455c97fee9633d851f7eeed5a05d35", size = 341878, upload-time = "2026-10-04T16:30:02.564Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/e2/5873bc4643c250db9e05d48dc0c93763d4aa68bc3b81164cb1af3b45b284/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07deecbfce94c78473018bc7d10b337cc651d12df87a1eb2cb3e4024bc9c33d0", size = 373963, upload-time = "2026-10-04T16:30:04.026Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/03/5acf7632158247f3f6386ff0af3a1ee48167d575037e8d0920594b76d92b/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:821b2755db9194409254012f429c56643416fb96ef9be090be82ec8826b7f477", size = 377975, upload-time = "2026-10-04T16:30:05.555Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/00/63fda451b8bffa5808fc8bb311ee7c073b340974b09f273c7b2a145d3d62/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c91c210ae7645626c608400e3519b4a642f837cce09ca830db3beb2e9f274d4", size = 490347, upload-time = "2026-10-04T16:30:07.156Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/ae/c093ffd070ba0fb02f76c565d06fecc65ad6e4afdbae78f7031076d3cdac/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54ac2158a6f96cfbabff0b2eedaf94b90c5ec7ca8317fcadc61e1c2b2e0ff6ef", size = 392962, upload-time = "2026-10-04T16:30:08.77Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/22/9d/d08a1128ab199b2f0cf25bfeb0639bd05119fff4b7c47bec24ef9a8ec23f/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eac2f5dbafd585dfe31f86a23ebf0d3ba480a9d49ebc87947267b5608d4ea0cd", size = 371623, upload-time = "2026-10-04T16:30:10.501Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/c7/4758ddcbb75609414bbccfcb11d612436f9b3ee821bd2f33f0f1604ee648/rpds_py-2026.9.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:8aa5dda18d39b6143eb24809d158f9252c88f402749b6f1b62a506cc7d96cc35", size = 376997, upload-time = "2026-10-04T16:30:12.124Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/87/e4/947bd7f608ff60faf46dc9d389c3dffd0e3d767d78a0be19978448ef0ce7/rpds_py-2026.9.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5c90e7fa02e8f5de0d10c17595c568ada48c5302e749462c0ea1a4c362111a86", size = 400169, upload-time = "2026-10-04T16:30:13.804Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/35/fe93e020a0543b5670472c18d7e6af3197c08da571240ce1965c84f85c0f/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e6d198bad4e49dd6732fbd636e2fc5c082f45c8cad0b4acb756b00c82c76072e", size = 551615, upload-time = "2026-10-04T16:30:15.332Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/4f/5d2a0136bb03b2a56a39dc6ff92d58a6e3e53a2e17079238b86228882f16/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:96beca19ec79de272e8668585380ff9092c47077c1d7a1e098e00bbd921f4785", size = 614655, upload-time = "2026-10-04T16:30:16.92Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/1c/3f1025aaf70d9bf7272cc41f8b64ee76b48bf01726248138430e16f23b38/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5cf77eb04f20b720be95265a3e00eb2a14814074255cc27069c551b2db53118", size = 579602, upload-time = "2026-10-04T16:30:18.555Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/0d/5c72e6204f76610608706da32b6b7e11ef7e10317558a7bb15a122e008dc/rpds_py-2026.9.1-cp314-cp314-win32.whl", hash = "sha256:a03d57b86d2a51d0a66c92177e2be154ad015f357791d306e714569999cdb4cc", size = 206315, upload-time = "2026-10-04T16:30:20.05Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/0b/489d48abbcc7d70cf3fbf662d9d22abf1f4650761c0a9ae05260800800d3/rpds_py-2026.9.1-cp314-cp314-win_amd64.whl", hash = "sha256:837c6b305e26fe0f75b15c92cf3b2ba29e0ae19dc40b1c557b026cb426347d0c", size = 222852, upload-time = "2026-10-04T16:30:21.604Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/16/bbb05a7e6a10cf79ba639be7f799d770ee15f64175cc61d081b218dd402a/rpds_py-2026.9.1-cp314-cp314-win_arm64.whl", hash = "sha256:fce4b85234a0cbad67bf8e6e1201ee815d172c9aebad75f25645bc4d834f8e31", size = 218709, upload-time = "2026-10-04T16:30:23.036Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/22/ac/ac507a0a4ec478ca470440a09583db4be5259ba7670aeba0620822f1e57a/rpds_py-2026.9.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:3a72c11530d71abfb66c8d7696a2f86c43e63fca8b948f1a784ac490f4ec688e", size = 349596, upload-time = "2026-10-04T16:30:24.558Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/f2/817a46b658d5070f477f722c298ee9a24525b0e4017347964146ef5fdd0e/rpds_py-2026.9.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:068c37bba854ec2fe42f7365c640af11dd9895890ccbf2df5070d0c059bd7f96", size = 343114, upload-time = "2026-10-04T16:30:26.048Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6c/42/6ade976b13ac1b4cb3bf2eb603f1be2fe74df19a29988d4c2b386be59d6f/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fca4eb6df565e2a928f1c7dad92d27db8f9df0f449e76423ed5d7e713ed445", size = 374197, upload-time = "2026-10-04T16:30:27.699Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/70/77cdf1d3f1a07faabe936016ae623aec7981f73108a8fe7a203ed2e21998/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c933c6678c6f116ff8af47a4c6db0868b8ace74af0343016c0ef00f00272ea69", size = 378025, upload-time = "2026-10-04T16:30:29.451Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/6b/18a44a3beaa9b7931acb04af7bd9539836477c630a794452d4826d6185d4/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:028ad274ea951dac64491b5d1e65712a4aeabfdbdb9fccf797b57bd899b0c495", size = 491969, upload-time = "2026-10-04T16:30:30.995Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/27/fb39cfd6bddaf741b024f813890374578ff8ac1f1adc473659c048b03b05/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:740d0a99cf9de0b17a3943388e9294a59becf75e7c43421f387bd3c7a9901f7c", size = 393905, upload-time = "2026-10-04T16:30:32.628Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ed/71/0fa7bb77b57af0d710273964180d11b503f62b8a5c358eb2d8c3f62feff6/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0da298fb372dc192610a4b9ecbc68a0cd8b675bbbd1fc519d01b41cfd658333e", size = 374569, upload-time = "2026-10-04T16:30:34.257Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/54/22/f41cfac269af3b449513ef1bc3d7f32fde52abbbd2d01c7e76b47743acd9/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:eb61be926bb81567c1f48bdc8aa22b9855048dc2efd53871f9f7e6e9a5632346", size = 377482, upload-time = "2026-10-04T16:30:35.997Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/fc/312b49006e7f8f9ca5f96647577b8aa6f3df30519c46bd448f5c425af0b2/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:42e75466f83cd43f6026c81eab74246efb2bdadafb307b85700632d06c68f299", size = 400040, upload-time = "2026-10-04T16:30:37.76Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cf/a6/18cca7a878dc7fa95165a83343fd4d7b65643fd22e54e47340a451121d5c/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:617f59cde379b4f648a09797b7f683d04b90a46344cddab85639da5aff0f5531", size = 551849, upload-time = "2026-10-04T16:30:39.443Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/6d/1f5685e20f39604691bdc3c05aaa6b8bd2f954e9e996477adf2376768e33/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3edae8c5ddfdb6985d49ae9d150516e5076888879022f91a26c2de9276ce0bdb", size = 614842, upload-time = "2026-10-04T16:30:41.231Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/25/98652109fd9f7e10268dd4571aa52b81987001b806f37ef1a18260de714a/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0f045bb053c9057720d72c56dffe30dffdc05997b2897a827b9325f0ab6623fa", size = 582606, upload-time = "2026-10-04T16:30:43.345Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/03/11ca09099bab5f53373a80a334c424ec917c13d050760a59499d2af5171e/rpds_py-2026.9.1-cp314-cp314t-win32.whl", hash = "sha256:bf35d0568abda97233239ce32896d3ad53fccc537832c104e30c94aa5fb93569", size = 203341, upload-time = "2026-10-04T16:30:44.954Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6f/8a/88909e3ffd9f47f5b58211473875d8c3c09079f0058c46fb72c55a702a26/rpds_py-2026.9.1-cp314-cp314t-win_amd64.whl", hash = "sha256:1e8d4d79d828299bf44a55db22a9388ab967b49d17132c88eab0f4360b48da8e", size = 222843, upload-time = "2026-10-04T16:30:46.486Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.16.9"
|
||||
|
||||
Reference in New Issue
Block a user