From b72fa4b82dd4e89da82f40d9b090504e25dc2a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=94=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=B9=D0=BA=D0=B8=D0=BD?= Date: Fri, 6 Nov 2026 19:23:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=BE=D0=B9=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D1=8B=204=20=D0=BD=D0=B0=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 25 + REPORT.md | 75 +- compose.yaml | 188 ++ infra/nginx/errors.conf | 15 + infra/nginx/nginx.conf | 101 + migrations/0001_init.sql | 60 + migrations/0002_message_idempotency.sql | 18 + migrations/0003_attachments.sql | 18 + migrations/0004_messages_empty_text.sql | 8 + poetry.lock | 1964 +++++++++++++++++ pyproject.toml | 31 + scripts/check_migrations.sh | 58 + scripts/check_previous_version.sh | 89 + scripts/experiment.py | 480 ++++ scripts/explain_history.sql | 111 + scripts/instances.sh | 17 + scripts/reconcile_s3.py | 10 + scripts/restart.bat | 6 + scripts/restart.sh | 12 + scripts/restore.sh | 9 + scripts/rolling-update.sh | 42 + scripts/sigterm_check.py | 148 ++ scripts/stop-one.sh | 24 + src/application/__init__.py | 4 + src/application/api/__init__.py | 10 + src/application/api/dependencies/__init__.py | 4 + src/application/api/dependencies/auth.py | 15 + src/application/api/dependencies/security.py | 52 + src/application/api/handlers/__init__.py | 3 + src/application/api/handlers/exceptions.py | 61 + src/application/api/health/__init__.py | 3 + src/application/api/health/endpoints.py | 36 + src/application/api/middlewares/__init__.py | 3 + .../api/middlewares/request_context.py | 71 + src/application/api/routers/__init__.py | 17 + .../api/routers/attachments/__init__.py | 2 + .../api/routers/attachments/endpoints.py | 58 + src/application/api/routers/auth/__init__.py | 3 + src/application/api/routers/auth/endpoints.py | 35 + src/application/api/routers/chats/__init__.py | 3 + .../api/routers/chats/endpoints.py | 58 + .../api/routers/messages/__init__.py | 3 + .../api/routers/messages/endpoints.py | 63 + src/application/api/routers/users/__init__.py | 3 + .../api/routers/users/endpoints.py | 33 + src/application/api/utils/__init__.py | 13 + src/application/api/utils/errors.py | 33 + src/config/__init__.py | 77 + src/config/log_config.py | 12 + src/config/settings.py | 55 + src/domain/__init__.py | 37 + src/domain/attachments/__init__.py | 3 + src/domain/attachments/schemas.py | 30 + src/domain/auth/__init__.py | 7 + src/domain/auth/schemas.py | 35 + src/domain/chats/__init__.py | 7 + src/domain/chats/schemas.py | 42 + src/domain/errors/__init__.py | 24 + src/domain/errors/codes.py | 15 + src/domain/errors/exceptions.py | 64 + src/domain/errors/schemas.py | 21 + src/domain/health/__init__.py | 3 + src/domain/health/schemas.py | 9 + src/domain/messages/__init__.py | 17 + src/domain/messages/schemas.py | 56 + src/domain/pagination/__init__.py | 6 + src/domain/pagination/schemas.py | 26 + src/domain/users/__init__.py | 7 + src/domain/users/schemas.py | 40 + src/domain/utils/__init__.py | 15 + src/domain/utils/types.py | 36 + src/gateway.py | 126 ++ src/healthcheck.py | 20 + src/infrastructure/__init__.py | 4 + src/infrastructure/dependencies/__init__.py | 13 + src/infrastructure/dependencies/cache.py | 94 + src/infrastructure/dependencies/database.py | 236 ++ .../dependencies/service_creator.py | 118 + src/infrastructure/repositories/__init__.py | 15 + .../repositories/attachment_repository.py | 48 + .../repositories/chat_repository/__init__.py | 3 + .../repositories/chat_repository/postgres.py | 150 ++ .../message_repository/__init__.py | 3 + .../message_repository/postgres.py | 165 ++ .../repositories/session_cache/__init__.py | 3 + .../repositories/session_cache/valkey.py | 87 + .../session_repository/__init__.py | 3 + .../session_repository/postgres.py | 85 + .../repositories/user_repository/__init__.py | 3 + .../repositories/user_repository/postgres.py | 67 + src/infrastructure/s3_client.py | 37 + src/infrastructure/security/__init__.py | 4 + .../security/password_hasher.py | 50 + src/infrastructure/security/tokens.py | 17 + src/infrastructure/services/__init__.py | 7 + .../services/attachment_service/__init__.py | 2 + .../attachment_service/attachment_service.py | 98 + .../services/auth_service/__init__.py | 3 + .../services/auth_service/auth_service.py | 92 + .../services/chat_service/__init__.py | 3 + .../services/chat_service/chat_service.py | 46 + .../services/message_service/__init__.py | 3 + .../message_service/message_service.py | 83 + .../services/user_service/__init__.py | 3 + .../services/user_service/user_service.py | 17 + src/infrastructure/utils/__init__.py | 15 + src/infrastructure/utils/pagination.py | 44 + src/infrastructure/utils/repository_utils.py | 39 + src/infrastructure/utils/transaction.py | 29 + src/interfaces/__init__.py | 15 + src/interfaces/attachment_repository.py | 12 + src/interfaces/chat_repository.py | 34 + src/interfaces/message_repository.py | 30 + src/interfaces/session_cache.py | 35 + src/interfaces/session_repository.py | 36 + src/interfaces/user_repository.py | 24 + src/migrate.py | 24 + student-tests/conftest.py | 77 + student-tests/helpers.py | 103 + student-tests/test_attachments.py | 97 + student-tests/test_auth.py | 131 ++ student-tests/test_balancing.py | 74 + student-tests/test_concurrency.py | 78 + student-tests/test_dependency_failures.py | 129 ++ student-tests/test_expiry.py | 55 + student-tests/test_foreign_chat.py | 51 + student-tests/test_health.py | 15 + student-tests/test_idempotency.py | 249 +++ student-tests/test_invalid_json.py | 112 + student-tests/test_messages.py | 79 + student-tests/test_pagination.py | 138 ++ student-tests/test_transactions.py | 95 + student-tests/test_users.py | 95 + tests/client.py | 2 +- 134 files changed, 8344 insertions(+), 20 deletions(-) create mode 100644 Dockerfile create mode 100644 compose.yaml create mode 100644 infra/nginx/errors.conf create mode 100644 infra/nginx/nginx.conf create mode 100644 migrations/0001_init.sql create mode 100644 migrations/0002_message_idempotency.sql create mode 100644 migrations/0003_attachments.sql create mode 100644 migrations/0004_messages_empty_text.sql create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 scripts/check_migrations.sh create mode 100644 scripts/check_previous_version.sh create mode 100644 scripts/experiment.py create mode 100644 scripts/explain_history.sql create mode 100644 scripts/instances.sh create mode 100644 scripts/reconcile_s3.py create mode 100644 scripts/restart.bat create mode 100644 scripts/restart.sh create mode 100644 scripts/restore.sh create mode 100644 scripts/rolling-update.sh create mode 100644 scripts/sigterm_check.py create mode 100644 scripts/stop-one.sh create mode 100644 src/application/__init__.py create mode 100644 src/application/api/__init__.py create mode 100644 src/application/api/dependencies/__init__.py create mode 100644 src/application/api/dependencies/auth.py create mode 100644 src/application/api/dependencies/security.py create mode 100644 src/application/api/handlers/__init__.py create mode 100644 src/application/api/handlers/exceptions.py create mode 100644 src/application/api/health/__init__.py create mode 100644 src/application/api/health/endpoints.py create mode 100644 src/application/api/middlewares/__init__.py create mode 100644 src/application/api/middlewares/request_context.py create mode 100644 src/application/api/routers/__init__.py create mode 100644 src/application/api/routers/attachments/__init__.py create mode 100644 src/application/api/routers/attachments/endpoints.py create mode 100644 src/application/api/routers/auth/__init__.py create mode 100644 src/application/api/routers/auth/endpoints.py create mode 100644 src/application/api/routers/chats/__init__.py create mode 100644 src/application/api/routers/chats/endpoints.py create mode 100644 src/application/api/routers/messages/__init__.py create mode 100644 src/application/api/routers/messages/endpoints.py create mode 100644 src/application/api/routers/users/__init__.py create mode 100644 src/application/api/routers/users/endpoints.py create mode 100644 src/application/api/utils/__init__.py create mode 100644 src/application/api/utils/errors.py create mode 100644 src/config/__init__.py create mode 100644 src/config/log_config.py create mode 100644 src/config/settings.py create mode 100644 src/domain/__init__.py create mode 100644 src/domain/attachments/__init__.py create mode 100644 src/domain/attachments/schemas.py create mode 100644 src/domain/auth/__init__.py create mode 100644 src/domain/auth/schemas.py create mode 100644 src/domain/chats/__init__.py create mode 100644 src/domain/chats/schemas.py create mode 100644 src/domain/errors/__init__.py create mode 100644 src/domain/errors/codes.py create mode 100644 src/domain/errors/exceptions.py create mode 100644 src/domain/errors/schemas.py create mode 100644 src/domain/health/__init__.py create mode 100644 src/domain/health/schemas.py create mode 100644 src/domain/messages/__init__.py create mode 100644 src/domain/messages/schemas.py create mode 100644 src/domain/pagination/__init__.py create mode 100644 src/domain/pagination/schemas.py create mode 100644 src/domain/users/__init__.py create mode 100644 src/domain/users/schemas.py create mode 100644 src/domain/utils/__init__.py create mode 100644 src/domain/utils/types.py create mode 100644 src/gateway.py create mode 100644 src/healthcheck.py create mode 100644 src/infrastructure/__init__.py create mode 100644 src/infrastructure/dependencies/__init__.py create mode 100644 src/infrastructure/dependencies/cache.py create mode 100644 src/infrastructure/dependencies/database.py create mode 100644 src/infrastructure/dependencies/service_creator.py create mode 100644 src/infrastructure/repositories/__init__.py create mode 100644 src/infrastructure/repositories/attachment_repository.py create mode 100644 src/infrastructure/repositories/chat_repository/__init__.py create mode 100644 src/infrastructure/repositories/chat_repository/postgres.py create mode 100644 src/infrastructure/repositories/message_repository/__init__.py create mode 100644 src/infrastructure/repositories/message_repository/postgres.py create mode 100644 src/infrastructure/repositories/session_cache/__init__.py create mode 100644 src/infrastructure/repositories/session_cache/valkey.py create mode 100644 src/infrastructure/repositories/session_repository/__init__.py create mode 100644 src/infrastructure/repositories/session_repository/postgres.py create mode 100644 src/infrastructure/repositories/user_repository/__init__.py create mode 100644 src/infrastructure/repositories/user_repository/postgres.py create mode 100644 src/infrastructure/s3_client.py create mode 100644 src/infrastructure/security/__init__.py create mode 100644 src/infrastructure/security/password_hasher.py create mode 100644 src/infrastructure/security/tokens.py create mode 100644 src/infrastructure/services/__init__.py create mode 100644 src/infrastructure/services/attachment_service/__init__.py create mode 100644 src/infrastructure/services/attachment_service/attachment_service.py create mode 100644 src/infrastructure/services/auth_service/__init__.py create mode 100644 src/infrastructure/services/auth_service/auth_service.py create mode 100644 src/infrastructure/services/chat_service/__init__.py create mode 100644 src/infrastructure/services/chat_service/chat_service.py create mode 100644 src/infrastructure/services/message_service/__init__.py create mode 100644 src/infrastructure/services/message_service/message_service.py create mode 100644 src/infrastructure/services/user_service/__init__.py create mode 100644 src/infrastructure/services/user_service/user_service.py create mode 100644 src/infrastructure/utils/__init__.py create mode 100644 src/infrastructure/utils/pagination.py create mode 100644 src/infrastructure/utils/repository_utils.py create mode 100644 src/infrastructure/utils/transaction.py create mode 100644 src/interfaces/__init__.py create mode 100644 src/interfaces/attachment_repository.py create mode 100644 src/interfaces/chat_repository.py create mode 100644 src/interfaces/message_repository.py create mode 100644 src/interfaces/session_cache.py create mode 100644 src/interfaces/session_repository.py create mode 100644 src/interfaces/user_repository.py create mode 100644 src/migrate.py create mode 100644 student-tests/conftest.py create mode 100644 student-tests/helpers.py create mode 100644 student-tests/test_attachments.py create mode 100644 student-tests/test_auth.py create mode 100644 student-tests/test_balancing.py create mode 100644 student-tests/test_concurrency.py create mode 100644 student-tests/test_dependency_failures.py create mode 100644 student-tests/test_expiry.py create mode 100644 student-tests/test_foreign_chat.py create mode 100644 student-tests/test_health.py create mode 100644 student-tests/test_idempotency.py create mode 100644 student-tests/test_invalid_json.py create mode 100644 student-tests/test_messages.py create mode 100644 student-tests/test_pagination.py create mode 100644 student-tests/test_transactions.py create mode 100644 student-tests/test_users.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3c8d7873 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.12.12-slim-bookworm + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + POETRY_VIRTUALENVS_CREATE=false + +WORKDIR /app +COPY poetry.lock pyproject.toml ./ +RUN pip install --no-cache-dir --timeout 60 --retries 10 "poetry==2.2.1" \ + && poetry install --only main --no-root --no-interaction +COPY migrations ./migrations +COPY src ./src + +# Процесс работает не от root +RUN useradd --system --uid 10001 --no-create-home app +USER app + +ARG APP_REVISION=dev +ENV APP_REVISION=${APP_REVISION} +LABEL org.opencontainers.image.revision=${APP_REVISION} + +EXPOSE 8080 +HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \ + CMD ["python", "src/healthcheck.py"] +CMD ["python", "src/gateway.py"] diff --git a/REPORT.md b/REPORT.md index 9ad2b84f..9c88bbfa 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,37 +1,74 @@ # Отчёт — лабораторная 4 -- Автор, группа: TODO -- Целевая оценка; выбранный трек 5, если нужен: TODO +- Дадайкин Андрей, БВТ2302 +- Целевая оценка: 4 - Commit/PR: TODO после публикации -- Использованные источники, библиотеки и помощь ИИ: TODO +- Использованные источники, библиотеки и помощь ИИ: +- - aioboto3` для асинхронной работы с S3 API. +- - Использован ИИ (LLM) для код-ревью структуры валидатора изображений +- ## Запуск из чистого clone -TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных. +**Требования:** ОС Windows 11 (или Linux/WSL2), Docker Desktop, Python 3.12, Poetry. + +1. **Настройка окружения:** + Скопируйте пример переменных окружения: + ```cmd + copy .env.example .env + ``` + + +2. **Запуск инфраструктуры и API:** + ```cmd + docker compose --env-file .env up -d --build + ``` + *Контейнер `migrate` автоматически применит миграции к PostgreSQL перед стартом `api`. SeaweedFS поднимется как S3-совместимое хранилище.* + +3. **Локальные тесты (в WSL или Git Bash):** + ```bash + poetry install + poetry run make check + poetry run make test BASE_URL=http://localhost:8080 + poetry run pytest student-tests/ + ``` + +4. **Тестирование отказоустойчивости:** + ```bash + poetry run make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://localhost:8080 + poetry run make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://localhost:8080 + ``` + *(На Windows скрипты `.sh` необходимо запускать через WSL или терминал, поддерживающий bash-скрипты, предварительно выполнив `chmod +x scripts/*.sh`).* + +5. **Остановка и очистка данных:** + ```cmd + docker compose down -v + ``` ## Архитектура и решения -TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab3, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации. +- **Хранилище байтов (S3):** Использован легковесный SeaweedFS (`chrislusf/seaweedfs:latest`), работающий в режиме S3-шлюза. Сервис изолирован в сети `backend`, публичный доступ закрыт (доступ только через API-реплики). +- **Хранилище метаданных:** PostgreSQL (таблица `attachments` с полями `status`, `sha256`, `size_bytes`, `content_type`). +- **Связь файлов и сообщений:** Массив `attachment_ids (UUID[])` добавлен в таблицу `messages`. +- **Потоковая загрузка:** Реализован endpoint `POST /chats/{chat_id}/attachments`. Данные читаются через `request.stream()` и записываются в `tempfile`. +- **Эффективная защита по RAM (Anti-Decompression Bomb):** Парсинг ширины и высоты PNG/JPEG происходит путем ручного чтения бинарных заголовков. Это позволяет отсекать изображения >40 млн пикселей, не декодируя файл в оперативную память. +- **Безопасность имен:** Оригинальное имя файла `filename` сохраняется в БД для отображения клиенту. В S3 объект сохраняется под сгенерированным ключом `chat_id/attachment_id`, что исключает атаки типа Path Traversal. ## Доказательства критериев | Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства | | --- | --- | --- | --- | -| Публичный smoke | make test | TODO | TODO | -| Остальные пункты уровня 3 | TODO | TODO | TODO | -| Все пункты уровня 4, если заявлен | TODO | TODO | TODO | -| Выбранный трек 5, если заявлен | TODO | TODO | TODO | +| Публичный smoke | `make test` | Пройден сценарий lab4, SHA-256 скачанного файла совпал. | `tests/smoke.py` | +| Ограничение загрузки (до 10 МБ, mime) | `pytest student-tests/test_attachments.py` | Загрузка TXT под видом PNG возвращает 415. | `student-tests/test_attachments.py` | +| Отсутствие доступа у постороннего | `make test` | Вызов GET-методов контента от 3-го лица выдает 404. | `tests/smoke.py` | +| Restart стенда с сохранением файлов | `make test-persistence` | После `scripts/restart.sh` (БД, Valkey, API, S3) скачанный файл не бьется. | `scripts/restart.sh` | +| Отказ API при загрузке (failover) | `make test-failover` | Скачивание файла происходит успешно через соседнюю реплику после остановки первой. | `scripts/stop-one.sh` | +| Механизм компенсации БД/S3 | Запуск `scripts/reconcile_s3.py` | Скрипт (запускаемый по cron) находит `queued` файлы старше 24ч и удаляет сирот из S3. | `scripts/reconcile_s3.py` | -TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены. - -## Эксперименты и отказы - -TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения. - -| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных | -| --- | --- | --- | --- | -| TODO | TODO | TODO | TODO | ## Ограничения и следующие шаги -TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза. +- **Ограничения парсера:** Ручной валидатор изображений `validate_image_and_get_mime` поддерживает базовые форматы JPEG и PNG. Прогрессивные форматы (WebP, AVIF) пока отклоняются с ошибкой 415. +- **Упрощение реконсиляции:** Текущий механизм реконсилятора (`reconcile_s3.py`) запускается вручную. В production среде его необходимо вынести в Celery Beat или Kubernetes CronJob. +- **Следующий шаг:** Переход на асинхронную генерацию миниатюр (thumbnail) и crop вариантов через брокер сообщений (RabbitMQ) для выполнения требований Лабораторной №5. + diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 00000000..3b19a3a1 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,188 @@ +name: messenger-lab3 + +x-app: &app + build: + context: . + args: + APP_REVISION: ${APP_REVISION:-dev} + image: mtusi-messenger:lab3 + env_file: + - .env + environment: &app-network + DB_HOST: postgres + DB_PORT: "5432" + VALKEY_HOST: valkey + VALKEY_PORT: "6379" + +x-api-resources: &api-resources + resources: + limits: + cpus: "1.0" + memory: 512M + reservations: + cpus: "0.25" + memory: 128M + +x-api: &api + <<: *app + restart: unless-stopped + depends_on: + migrate: + condition: service_completed_successfully + postgres: + condition: service_healthy + valkey: + condition: service_started + networks: + - edge + - backend + healthcheck: + test: ["CMD", "python", "src/healthcheck.py"] + interval: 5s + timeout: 3s + retries: 2 + start_period: 20s + start_interval: 1s + stop_grace_period: 10s + +services: + nginx: + image: nginx:1.28.0-alpine3.21 + restart: unless-stopped + depends_on: + api: + condition: service_healthy + ports: + - "127.0.0.1:${LB_PORT:-8080}:8080" + - "127.0.0.1:${LB_EXPIRY_PORT:-8081}:8081" + volumes: + - ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - ./infra/nginx/errors.conf:/etc/nginx/errors.conf:ro + networks: + - edge + healthcheck: + test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8090/healthz"] + interval: 5s + timeout: 2s + retries: 3 + stop_grace_period: 10s + deploy: + resources: + limits: + cpus: "0.5" + memory: 64M + + api: + <<: *api + deploy: + <<: *api-resources + replicas: ${API_REPLICAS:-2} + + migrate: + <<: *app + command: ["python", "src/migrate.py"] + restart: "no" + depends_on: + postgres: + condition: service_healthy + networks: + - backend + healthcheck: + disable: true + deploy: + resources: + limits: + cpus: "0.5" + memory: 256M + + postgres: + image: postgres:18.2-alpine3.22 + restart: unless-stopped + environment: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASS} + POSTGRES_DB: ${DB_NAME} + volumes: + - postgres_data:/var/lib/postgresql + healthcheck: + test: ["CMD-SHELL", "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""] + interval: 2s + timeout: 3s + retries: 15 + start_period: 10s + networks: + - backend + stop_grace_period: 30s + deploy: + resources: + limits: + cpus: "1.5" + memory: 512M + + valkey: + image: valkey/valkey:8.1.4-alpine3.22 + restart: unless-stopped + environment: + VALKEY_PASS: ${VALKEY_PASS} + command: + - valkey-server + - --requirepass + - ${VALKEY_PASS} + - --save + - "" + - --appendonly + - "no" + - --maxmemory + - 64mb + - --maxmemory-policy + - allkeys-lru + healthcheck: + test: ["CMD-SHELL", "valkey-cli --no-auth-warning -a \"$$VALKEY_PASS\" ping | grep -q PONG"] + interval: 2s + timeout: 3s + retries: 15 + networks: + - backend + deploy: + resources: + limits: + cpus: "0.25" + memory: 96M + + api-short-ttl: + <<: *api + profiles: + - expiry + environment: + <<: *app-network + SESSION_TTL_SECONDS: "2" + deploy: + <<: *api-resources + replicas: 1 + + s3: + image: chrislusf/seaweedfs:latest + restart: unless-stopped + command: server -s3 -dir=/data -s3.port=9000 + environment: + AWS_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY} + S3_BUCKET: ${S3_BUCKET} + volumes: + - s3_data:/data + networks: + - backend + healthcheck: + test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:9000/"] + interval: 5s + timeout: 3s + retries: 5 + +networks: + edge: {} + backend: + internal: true + +volumes: + postgres_data: + s3_data: \ No newline at end of file diff --git a/infra/nginx/errors.conf b/infra/nginx/errors.conf new file mode 100644 index 00000000..495a21c8 --- /dev/null +++ b/infra/nginx/errors.conf @@ -0,0 +1,15 @@ +# Ошибки, созданные самим балансировщиком, — в формате ошибок контракта. +# Ответы реплик (включая их 503) проходят без изменений: proxy_intercept_errors off. +# X-Instance-Id здесь нет: ответ создан LB, а не API-репликой. + +location @unavailable { + default_type application/json; + add_header X-Request-Id $request_id always; + return 503 '{"error":{"code":"unavailable","message":"Нет доступной API-реплики","request_id":"$request_id"}}'; +} + +location @too_large { + default_type application/json; + add_header X-Request-Id $request_id always; + return 413 '{"error":{"code":"payload_too_large","message":"Тело запроса слишком большое","request_id":"$request_id"}}'; +} diff --git a/infra/nginx/nginx.conf b/infra/nginx/nginx.conf new file mode 100644 index 00000000..1845986f --- /dev/null +++ b/infra/nginx/nginx.conf @@ -0,0 +1,101 @@ +worker_processes 1; +pid /tmp/nginx.pid; +error_log /dev/stderr warn; + +events { + worker_connections 1024; +} + +http { + resolver 127.0.0.11 valid=2s ipv6=off; + resolver_timeout 1s; + + log_format upstream_json escape=json + '{"time":"$time_iso8601","request_id":"$request_id",' + '"method":"$request_method","uri":"$uri","status":$status,' + '"request_time":$request_time,"upstream_addr":"$upstream_addr",' + '"upstream_status":"$upstream_status",' + '"upstream_response_time":"$upstream_response_time",' + '"instance":"$upstream_http_x_instance_id"}'; + access_log /dev/stdout upstream_json; + + server_tokens off; + client_max_body_size 1m; + client_body_buffer_size 64k; + client_header_timeout 10s; + client_body_timeout 10s; + send_timeout 10s; + keepalive_timeout 65s; + + upstream api { + zone api 64k; + server api:8080 resolve max_fails=1 fail_timeout=5s; + keepalive 32; + # Меньше APP_KEEPALIVE_TIMEOUT_SEC (75 с): idle-соединение первым + # закрывает nginx, а не реплика, — нет гонки «запрос в закрытое соединение» + keepalive_timeout 60s; + } + + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_set_header Host $host; + # Один ID на LB и реплику: API принимает $request_id и возвращает его + proxy_set_header X-Request-Id $request_id; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # connect внутри bridge-сети завершает ядро за доли мс даже у занятой реплики. + # Самый долгий запрос API: ожидание пула 3 с + statement_timeout 5 с + proxy_connect_timeout 500ms; + proxy_send_timeout 10s; + proxy_read_timeout 10s; + + # Повтор на другой реплике только при ошибке соединения/таймауте. + # POST, уже отправленный реплике, nginx не повторяет (non_idempotent выключен): + # повтор сообщения делает клиент с тем же Idempotency-Key. + # 503 приложения (общая зависимость недоступна) не повторяется и не исключает + # реплику: другая реплика зависит от той же БД. + proxy_next_upstream error timeout; + proxy_next_upstream_tries 3; + proxy_next_upstream_timeout 5s; + + server { + listen 8080; + + location / { + proxy_pass http://api; + } + + error_page 502 503 504 = @unavailable; + error_page 413 = @too_large; + + include /etc/nginx/errors.conf; + } + + server { + listen 8081; + + # Реплика api-short-ttl только для make test-expiry (профиль expiry): + # адрес резолвится на каждый запрос, без профиля — 503 от LB + location / { + set $api_short_ttl http://api-short-ttl:8080; + proxy_pass $api_short_ttl; + } + + error_page 502 503 504 = @unavailable; + error_page 413 = @too_large; + + include /etc/nginx/errors.conf; + } + + # Liveness самого балансировщика для healthcheck контейнера; наружу не публикуется + server { + listen 127.0.0.1:8090; + access_log off; + + location = /healthz { + default_type text/plain; + return 200 "ok\n"; + } + } +} diff --git a/migrations/0001_init.sql b/migrations/0001_init.sql new file mode 100644 index 00000000..e9a91a3a --- /dev/null +++ b/migrations/0001_init.sql @@ -0,0 +1,60 @@ +CREATE TABLE users ( + id uuid PRIMARY KEY DEFAULT uuidv7(), + username text NOT NULL, + display_name text NOT NULL, + password_hash text NOT NULL, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + CONSTRAINT users_username_key UNIQUE (username), + CONSTRAINT users_username_format CHECK (username ~ '^[a-z0-9_]{3,32}$'), + CONSTRAINT users_display_name_len CHECK (char_length(display_name) BETWEEN 1 AND 100) +); + +-- Источник истины для сессий; токен хранится только как SHA-256 +CREATE TABLE sessions ( + token_hash bytea PRIMARY KEY, + user_id uuid NOT NULL REFERENCES users (id) ON DELETE CASCADE, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + expires_at timestamptz NOT NULL, + revoked_at timestamptz, + CONSTRAINT sessions_token_hash_len CHECK (octet_length(token_hash) = 32), + CONSTRAINT sessions_expiry_order CHECK (expires_at > created_at) +); + +CREATE INDEX sessions_user_id_idx ON sessions (user_id); + +CREATE TABLE chats ( + id uuid PRIMARY KEY DEFAULT uuidv7(), + title text NOT NULL, + created_by uuid NOT NULL REFERENCES users (id), + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + CONSTRAINT chats_title_len CHECK (char_length(title) BETWEEN 1 AND 100) +); + +-- position сохраняет порядок member_ids из запроса создания +CREATE TABLE chat_members ( + chat_id uuid NOT NULL REFERENCES chats (id) ON DELETE CASCADE, + user_id uuid NOT NULL REFERENCES users (id), + position smallint NOT NULL, + PRIMARY KEY (chat_id, user_id), + CONSTRAINT chat_members_position_key UNIQUE (chat_id, position) +); + +-- Список чатов пользователя: WHERE user_id = $1 +CREATE INDEX chat_members_user_id_chat_id_idx ON chat_members (user_id, chat_id); + +-- created_at назначает приложение под блокировкой чата (строго возрастает в чате) +CREATE TABLE messages ( + id uuid PRIMARY KEY DEFAULT uuidv7(), + chat_id uuid NOT NULL, + sender_id uuid NOT NULL, + text text NOT NULL, + created_at timestamptz NOT NULL, + CONSTRAINT messages_text_len CHECK (char_length(text) BETWEEN 1 AND 4000), + -- отправитель обязан быть участником этого чата + CONSTRAINT messages_sender_member_fkey FOREIGN KEY (chat_id, sender_id) + REFERENCES chat_members (chat_id, user_id) ON DELETE CASCADE +); + +-- Keyset-пагинация истории: WHERE chat_id = $1 AND (created_at, id) > ($2, $3) +-- ORDER BY created_at, id LIMIT $4 — Index Scan без сортировки и полного прохода +CREATE INDEX messages_chat_id_created_at_id_idx ON messages (chat_id, created_at, id); diff --git a/migrations/0002_message_idempotency.sql b/migrations/0002_message_idempotency.sql new file mode 100644 index 00000000..ffc709e2 --- /dev/null +++ b/migrations/0002_message_idempotency.sql @@ -0,0 +1,18 @@ +-- Idempotency-Key отправки сообщения (lab3). Область по контракту: +-- пользователь + метод + путь + ключ. Метод и путь фиксированы +-- (POST /api/v1/chats/{chat_id}/messages), поэтому ключ — (sender_id, chat_id, key). +-- Только добавление таблицы (expand): предыдущая версия API работает на новой схеме. +CREATE TABLE message_idempotency_keys ( + sender_id uuid NOT NULL, + chat_id uuid NOT NULL, + idempotency_key text NOT NULL, + request_hash bytea NOT NULL, + message_id uuid NOT NULL REFERENCES messages (id) ON DELETE CASCADE, + created_at timestamptz NOT NULL DEFAULT clock_timestamp(), + expires_at timestamptz NOT NULL, + PRIMARY KEY (sender_id, chat_id, idempotency_key), + CONSTRAINT message_idempotency_keys_key_format + CHECK (idempotency_key ~ '^[A-Za-z0-9._:-]{1,128}$'), + CONSTRAINT message_idempotency_keys_hash_len CHECK (octet_length(request_hash) = 32), + CONSTRAINT message_idempotency_keys_expiry_order CHECK (expires_at > created_at) +); diff --git a/migrations/0003_attachments.sql b/migrations/0003_attachments.sql new file mode 100644 index 00000000..b4332308 --- /dev/null +++ b/migrations/0003_attachments.sql @@ -0,0 +1,18 @@ +-- Таблица для метаданных вложений +CREATE TABLE attachments ( + id UUID PRIMARY KEY, + chat_id UUID NOT NULL REFERENCES chats(id) ON DELETE CASCADE, + owner_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, + filename TEXT NOT NULL, + content_type TEXT NOT NULL, + size_bytes BIGINT NOT NULL, + sha256 TEXT NOT NULL, + status TEXT NOT NULL, + error_code TEXT, + variants JSONB NOT NULL DEFAULT '[]'::jsonb, + created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp() +); + +-- Добавляем колонку для прикрепленных файлов в сообщения +ALTER TABLE messages ADD COLUMN attachment_ids UUID[] NOT NULL DEFAULT '{}'::UUID[]; \ No newline at end of file diff --git a/migrations/0004_messages_empty_text.sql b/migrations/0004_messages_empty_text.sql new file mode 100644 index 00000000..8e1b8eac --- /dev/null +++ b/migrations/0004_messages_empty_text.sql @@ -0,0 +1,8 @@ +-- Удаляем старое ограничение, которое запрещало пустой текст +ALTER TABLE messages DROP CONSTRAINT IF EXISTS messages_text_len; + +-- Добавляем новое: текст может быть пустым ТОЛЬКО ЕСЛИ есть хотя бы одно вложение +ALTER TABLE messages ADD CONSTRAINT messages_text_len CHECK ( + (char_length(text) >= 1 OR cardinality(attachment_ids) >= 1) + AND char_length(text) <= 4000 +); \ No newline at end of file diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..ba05fff5 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,1964 @@ +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. + +[[package]] +name = "aioboto3" +version = "13.4.0" +description = "Async boto3 wrapper" +optional = false +python-versions = "<4.0,>=3.8" +groups = ["main"] +files = [ + {file = "aioboto3-13.4.0-py3-none-any.whl", hash = "sha256:d78f3400ef3a01b4d5515108ef244941894a0bc39c4716321a00e15898d7e002"}, + {file = "aioboto3-13.4.0.tar.gz", hash = "sha256:3105f9e5618c686c90050e60eb5ebf9e28f7f8c4e0fa162d4481aaa402008aab"}, +] + +[package.dependencies] +aiobotocore = {version = "2.18.0", extras = ["boto3"]} +aiofiles = ">=23.2.1" + +[package.extras] +chalice = ["chalice (>=1.24.0)"] +s3cse = ["cryptography (>=2.3.1)"] + +[[package]] +name = "aiobotocore" +version = "2.18.0" +description = "Async client for aws services using botocore and aiohttp" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "aiobotocore-2.18.0-py3-none-any.whl", hash = "sha256:89634470946944baf0a72fe2939cdd5f98b61335d400ca55f3032aca92989ec1"}, + {file = "aiobotocore-2.18.0.tar.gz", hash = "sha256:c54db752c5a742bf1a05c8359a93f508b4bf702b0e6be253a4c9ef1f9c9b6706"}, +] + +[package.dependencies] +aiohttp = ">=3.9.2,<4.0.0" +aioitertools = ">=0.5.1,<1.0.0" +boto3 = {version = ">=1.36.0,<1.36.2", optional = true, markers = "extra == \"boto3\""} +botocore = ">=1.36.0,<1.36.2" +jmespath = ">=0.7.1,<2.0.0" +multidict = ">=6.0.0,<7.0.0" +python-dateutil = ">=2.1,<3.0.0" +urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""} +wrapt = ">=1.10.10,<2.0.0" + +[package.extras] +awscli = ["awscli (>=1.37.0,<1.37.2)"] +boto3 = ["boto3 (>=1.36.0,<1.36.2)"] + +[[package]] +name = "aiofiles" +version = "25.1.0" +description = "File support for asyncio." +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "aiofiles-25.1.0-py3-none-any.whl", hash = "sha256:abe311e527c862958650f9438e859c1fa7568a141b22abcd015e120e86a85695"}, + {file = "aiofiles-25.1.0.tar.gz", hash = "sha256:a8d728f0a29de45dc521f18f07297428d56992a742f0cd2701ba86e44d23d5b2"}, +] + +[[package]] +name = "aiohappyeyeballs" +version = "2.7.1" +description = "Happy Eyeballs for asyncio" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "aiohappyeyeballs-2.7.1-py3-none-any.whl", hash = "sha256:9243213661e29250eb41368e5daa826fc017156c3b8a11440826b2e3ed376472"}, + {file = "aiohappyeyeballs-2.7.1.tar.gz", hash = "sha256:065665c041c42a5938ed220bdcd7230f22527fbec085e1853d2402c8a3615d9d"}, +] + +[[package]] +name = "aiohttp" +version = "3.14.5" +description = "Async http client/server framework (asyncio)" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "aiohttp-3.14.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ef692a24087a699c0a4a26af45e746e0c1eae2116f6d8a5ff91d8aae2b867b45"}, + {file = "aiohttp-3.14.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1220353657ad49493551f089ce02f1a348fd57ffd585bfec77f2f3c4fe3a7346"}, + {file = "aiohttp-3.14.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:330900acd0dc4cb8b27f9c127fbaad770964845338493e7906ae3822e82dbf8d"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0684952aeae1f5dbfe02d46039338513b94009baecd15d8e4098a357c4c4a2a6"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d94e44be379e569758fee8a9a58431cfc3c2598c708b92b1cfe96c66b4c94aef"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5af42135fdfebdadbc2bcd9c0842a48ccf0d62794c36a260b21dc4b94d1e0119"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4f07fe3ac408d8b3f768be471dc3f56d43843c47d97c66120534467a15ead197"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f375db73a39f5cf83696d500e21a67f418dc9a988955756f254be8f03b7b3651"}, + {file = "aiohttp-3.14.5-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8df7d481654ac96fe1ba9a02a9f67770fdd367823e0d5ef01b922725c4bd2cfa"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e95c8def4b81c5d68d5cf1f54c07acd7c0d2577af244e5b6da802120825737c6"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:f2ebb54b3f932210503072f09974b4fb574d823e497a944adfdcd140a6a00255"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:038c2c7e8caa26b6c8423779b5eaf1893904048a512c19b32fe841ffa5592b50"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:b7806e804889231b0e06469fd4a5c06313d1c0a3377322b6d9237fa5e0fe4167"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:9bab2045550c4fe0f7baf89574db1b455c195750702ba96fef1f16972b146617"}, + {file = "aiohttp-3.14.5-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:96a2e584f0b9ed8f1fa33211397dcf67bb7069866402cb405d191c2f0defb9a3"}, + {file = "aiohttp-3.14.5-cp310-cp310-win32.whl", hash = "sha256:602c1e9b718a3275c580149f947e7fac65044c0a20e599553fb12e9700da9eca"}, + {file = "aiohttp-3.14.5-cp310-cp310-win_amd64.whl", hash = "sha256:bea559ad70218d230663e4210875735076a9bfea5994cef34a55a25faeaf2544"}, + {file = "aiohttp-3.14.5-cp310-cp310-win_arm64.whl", hash = "sha256:dca3fa8d8a0a26679862eccb0b1a9151b2b9f1cd2c212e7a6335778faaff5833"}, + {file = "aiohttp-3.14.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d51db97c96384fbfcaf8f4c65922183a68b94f891c3c10c862ef5f6df2adbb1f"}, + {file = "aiohttp-3.14.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ae53924aa853a7a2ca20ed4142c7c6b56338e4d4cd999e2980075b9efc2e257a"}, + {file = "aiohttp-3.14.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a2c473a355f9239efcb72c92d5abfd8fcdb0cc78c8e9af607e72ca12dbb36593"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:32e8fa6644e541fcd7e02430588c7fc93b602c1778ea0bc345505db76b61cfb4"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:579f97d5120f2971876d2ddca2968135f6944d00c44c3a6590ad7d86ca9b403f"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:24409db442e2fb6e766bc7f3943851a8381dec3098140e43bb2e843b79e31b12"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5e8f97c0488ffda3082766ac0f2c8150a9a58c4d05788330e479cfd449b37939"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50a195903119008fe9cc68710535eb37f556ffffd6a7759afe70a2c145587045"}, + {file = "aiohttp-3.14.5-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0133c3c3b54a0bf1e71fa5c1ad95c93f07fd54e24ef1fe182f5122e1573d2bf1"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c172db893e516e1358e65a95ee20b7ce7173963eefe318b6ab2a2220688b999e"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f2a7966bda23dd85051f1661ce0ace38d6890e05ec6c357ecae9d2479cba377e"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4887d130a7bbfed3a85493bb5a25e5b5b558d40c1d986dd16970d2bb26d63793"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:225c579c23b68b343cccea27a7e06e3bd8ec23a09c30b427eb3f1e4ca6239b20"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:ab52d8f1fc1b64821c1fbad64a647ed6203627004059a6d1ed4f0858a1499703"}, + {file = "aiohttp-3.14.5-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cb131d775a1573c1aee66656bd78b023577bbdb6cb8349a07773bd4f73e68a6e"}, + {file = "aiohttp-3.14.5-cp311-cp311-win32.whl", hash = "sha256:e87046c8ff77a8decdb6a41d8ab25824b47531b2da933aeab0c1e21c7acff329"}, + {file = "aiohttp-3.14.5-cp311-cp311-win_amd64.whl", hash = "sha256:6f275c11d1aa6d4c458e05a68be084efe3c55a113d99e3f46a318098e52948fc"}, + {file = "aiohttp-3.14.5-cp311-cp311-win_arm64.whl", hash = "sha256:b032a0023eb41d768ce77d83210ab2a3c389bc0b09313273c7e1eca48c10a755"}, + {file = "aiohttp-3.14.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:df37b620684e19b5e25724412518ccafc3b1a49cdac706fdbd2f983fad943450"}, + {file = "aiohttp-3.14.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ef60869969180ec2464f1349aff07138ae35ca2200f0946cb3552e49e8f301a8"}, + {file = "aiohttp-3.14.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d079c0a0135c36e7beb6f1c88087c8f108dc5891cdd0b5eafa778421bda70ed2"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:abfda5cb094a829f7bc25216a32f7db2e85cc65bd59910f8e7b40b3d9b224764"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9cc882cf8619109583c906b4d4a85d6a111a98afa34b7a450d1e08118d016820"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7457580535e019e1247ea35d6a02bf081ad30c26d0cbc210c93f6c3ab67a0835"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c5ed596aedb9c42afd3fe0aae3117725378ac73d2cc5ddc735056fbdb96c5d02"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20f085697d7e911f1f73c43ed03fafbed1e7121797e2eb5428efa80398060584"}, + {file = "aiohttp-3.14.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:74b0a9c8270f9b0a11410e124ff8d4f18bfc1f1837440ec84da5ae7b50927b5d"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:19e2ba471507c34f8252402ab50f5ab512398b9ea8c8f1cb26beb3f75793ba30"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d418ce2af40c6bb685b3f663e9e8de27cb0a22431d8e88a167348d7f01878073"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:70cb4008ac2ed1e0ca9e824deb4b53d3aa0d939109698ebf1e723a84337bd794"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:a23fe35d776bc03cb495938b9594450d047e3bc08c5255315a82323e9cb7d2dd"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3e0eb43bed3c6801a6cee315195377789e90b2a72c2277a475b578535312488d"}, + {file = "aiohttp-3.14.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be7dd397d64ca3e1869626fa9318aaebb54b7bf93bc72d7a205448d83e4f748"}, + {file = "aiohttp-3.14.5-cp312-cp312-win32.whl", hash = "sha256:eb324e2009fb54db30a071dad7caf6998ee2879c4704007efb244514dad1fec1"}, + {file = "aiohttp-3.14.5-cp312-cp312-win_amd64.whl", hash = "sha256:2cc38a4f2b516bef1714e690df87a0e043faf1a7693c82d860091684453d5111"}, + {file = "aiohttp-3.14.5-cp312-cp312-win_arm64.whl", hash = "sha256:a63afd1f757de949028387e65a7127b61ad0f775432dbb0e62816ae619fe69ac"}, + {file = "aiohttp-3.14.5-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:9ad7e6aa38c20da1be697874349c4c273c8a03b7887169665081706398d0439a"}, + {file = "aiohttp-3.14.5-cp313-cp313-android_24_x86_64.whl", hash = "sha256:f59c7673465908cbe506117176156c127f29f917677afceada34957179221d91"}, + {file = "aiohttp-3.14.5-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:1b5416552740edf07234cc9437d0706f2acb67b93c198670b1a68e1b2b587dec"}, + {file = "aiohttp-3.14.5-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:43351bdb5e4c3cb7d1772368e988534e869a74db7778079a83782c11c69535c7"}, + {file = "aiohttp-3.14.5-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:c8c4478bef6d57fcfda15dae461ea3c9f06aa7b257c58df3f2300174ccbb185a"}, + {file = "aiohttp-3.14.5-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c2c30484dd1417ef98b51021ffa2cc0d7f3c78918adaaaab7e70817335ab3e02"}, + {file = "aiohttp-3.14.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dab9ac5a67c8d1f070c00fa8fccb7cbd1b8dcc1a8d6b42f37540df9b3d4cc603"}, + {file = "aiohttp-3.14.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e1cc2bfaee8c214f06080a7c7d5772419b8a1108e8e5349236189811823fb02a"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:74efb69332b85675b1eabd760a8cfc2e2cf42c60607c66f88014c1bdfb40942d"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:42b5e616946dbaf505e2bff18c9af2cd4ef9e7ef300ee58a6e951a5b7cf147ae"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f9033b43f511f27547c557dcaba0177649e10a3725336ccd2cce0fdc1dc4850d"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:15a310d3c71398e3d7bfc93a1a73fbe664315cd9e9016b8efc1cff85eeab7155"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1ffa3a523a36d8628f98c06492ae16a31a23d14c0b4ec721757b477319f656d6"}, + {file = "aiohttp-3.14.5-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5fb6a6e919bfb703227bc1ce6579281b84b1a2ba57deb9794dfdbec7dcd1e40c"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:43e1b7994a8b038125f722bff07492ef501110722c2727c408995d9fb864c421"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:5f3e96071686755d9cd3600c3880183eb94b012178e92746d68101800f0ed8a3"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:cd88b01f3d37b7a2a34f91d98f14720206f1ea3d540843fab2d649dd5fb91fec"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:f2ed8b64dc0c651c0f5a9c926777719770021251b8f336d97c4b80b660836ce1"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a9918e58faf62ba2c7147927d06057aec78f42475aff5048047ec47e7265a600"}, + {file = "aiohttp-3.14.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:42f320d4a5b00b9af0bddcfec5407dc6f2d9816f006b2f79ebbaa31f16895df3"}, + {file = "aiohttp-3.14.5-cp313-cp313-win32.whl", hash = "sha256:3ae800a20947e2c2e53088047d021e6bf7d51560cc49f6a0737a1f79d2e3a13c"}, + {file = "aiohttp-3.14.5-cp313-cp313-win_amd64.whl", hash = "sha256:d05e94cdfe0d15d0206f970722d2554780ce562787b21b218b275447f8751319"}, + {file = "aiohttp-3.14.5-cp313-cp313-win_arm64.whl", hash = "sha256:f001b571ead90ca1770f1e616db255351a1703317f20374c361ef22f12c06d09"}, + {file = "aiohttp-3.14.5-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:939042d5cda21d41a6f512e7cc8b8e33a2aebff863352251da495fbd91b673b5"}, + {file = "aiohttp-3.14.5-cp314-cp314-android_24_x86_64.whl", hash = "sha256:6da32b5ff3fd78d244e37300463434c7145162bfd2b6e9e915ab164da37f7343"}, + {file = "aiohttp-3.14.5-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:1b438b73c38111818d0c9d6a5c2bfed8584c8e503a49ef085d70e874ec846738"}, + {file = "aiohttp-3.14.5-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:755933b107ea7a6a9ac916f635a70595a5b1a32fac10a8ff0b9f2ab88555550c"}, + {file = "aiohttp-3.14.5-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:b3cc509327c7b27f6f4727a8830f4004f6df7766e179f2f4b8e54e65c0bec5d3"}, + {file = "aiohttp-3.14.5-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:7bd8ac754ebd6733a3e2a0dd1674c4d8ab086196803fd8dcd776f07b4e2607d9"}, + {file = "aiohttp-3.14.5-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e724a7b6091f0b1ac064f9d1b15ff9ec52e6033a86cdae649e5f086e32a3c0db"}, + {file = "aiohttp-3.14.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c32e26310cc10e547f53cd13d39a369034f69dcb7d749d5cb0e5f67bc196b6ba"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1eb8167961ec4dfcc8cb9dd50bd0ee72519f7ef496be95203e49e27b01618382"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c1d60eafd9c7e8e74abd03a5b00df44e7febfe6d9b89b559c0a6551eef0699d4"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:137351bf20bbed9a65e839f4a4452ac377389bdb2f2857d2acffef38f5e9f2d1"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fba47bc2c3d7303c3d027c6cf4d07626c37b1314ac81f5820c31032e0ca1f677"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:94684b879ac1d71e4238850c99b62dc1b28d9086b156a2555f082010b85a865c"}, + {file = "aiohttp-3.14.5-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:56572c42e3ecd636de8d2c3dd54cf5fc939cb5c32eb56297f176a0d366fac622"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a95529a92a446db351675f4aab518feaf5e99842f63f5dd17160c2b74f382db3"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:3edbece0379b8b4aaa67619b8aa2399bb66fce372cd5911098a434ea77220aa0"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:56d9828f204331a5ca8850fcfe2bcce95a149f1f223f60cc7216e5524978e480"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:20064a177a070d789ee64a50b01a9161d3468e989baacfc6c714aa685c4b332f"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:81c2b3dfd56c62bee6108e4852d5970b4cf9086390b6983f52b666e878c1f115"}, + {file = "aiohttp-3.14.5-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:09ec102b4b8c9a920275733bbc11fdbb615efe6f9231a06007c0218d336fb77a"}, + {file = "aiohttp-3.14.5-cp314-cp314-win32.whl", hash = "sha256:9c428eb2bd8817588d16a0ab898aa4eb5d141f896aa2b394cc79a4cf61d9a8e2"}, + {file = "aiohttp-3.14.5-cp314-cp314-win_amd64.whl", hash = "sha256:6f967dde489ca6a8c02d093ab245d2cbf50ccb5c36adf0188b17b0ca39d24b67"}, + {file = "aiohttp-3.14.5-cp314-cp314-win_arm64.whl", hash = "sha256:1d2d981b53dd09a319e3570ef8cc3bbc3ef86f5a7abef0f6b2bff3867db3a9e7"}, + {file = "aiohttp-3.14.5-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:9ce66feae6ac65327379460380549bf1b8df8e17c4e25df2a2bcf168272e3bed"}, + {file = "aiohttp-3.14.5-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:27c2322e03f66101acb09869ce1cf1efc04994ee95e1735b69827bf8c8b9d781"}, + {file = "aiohttp-3.14.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ff75a7537413a86e7cafe98e0e1d6e3dc4b15c6349896e7d5c6b881bfdb6d550"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c061aa954daaf57d2a4b8374f9fca621ef0e1b603584431c220c22458c59b6d"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1612fa5857b37bf32e5c1eaeefb96e3b01e9c70679eec81f0934e8a600080863"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:adbeee7d6fd4cf5fe0aece2fb3edc4243615d3180430ba8149d01a90670cac99"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b2966998927d7bed9db12c0a4647b0c7b179755878fc9c357fe1ffd3e3b0c1a5"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e317e0fb6b16212c881d2205a7d87414c29acd69320b3aa6dce9d9c7b86fe4f"}, + {file = "aiohttp-3.14.5-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:50343c1757b4b6f6708eeaf24534b32f19dfb99fb1b762c00420867a62fc81e0"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:083673c7a94c3ea035caaa5ca04288bdb44887abfe1f5ba23294e6a4b03efd2d"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:2528cb4c6b92008c76ac9ac6298624069bb2db91ff4929905512d1d84485f658"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b1b8ece1e71132d2afba4dbc0c3d62c766e25165990b25db1196c04969eb3d84"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:fce9523df31cea6284f3e2c479876750d7687cf671d7b25d32b19effc0e86441"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:09e0eb18c7e0c8777e2f9149de63799195b9b3ca1b5c81ba6f32f2c6b8628210"}, + {file = "aiohttp-3.14.5-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6774814fd5c338e72ee0da5cbb9432816df450e69c019f72b5d29bdec2a1792d"}, + {file = "aiohttp-3.14.5-cp314-cp314t-win32.whl", hash = "sha256:33f706574e32c6e694f352a856e05caf18f7f2c871b3e87b41c55ea452b409ab"}, + {file = "aiohttp-3.14.5-cp314-cp314t-win_amd64.whl", hash = "sha256:5ba14a839fbe87cf7c12a6b5661c05f324a296eb8363141edb3944ba63d4c9d3"}, + {file = "aiohttp-3.14.5-cp314-cp314t-win_arm64.whl", hash = "sha256:1061b364556e8172e8d46b0b183adeeb73e8c42d30ebc745591e1bd89acad52e"}, + {file = "aiohttp-3.14.5-cp315-cp315-android_24_arm64_v8a.whl", hash = "sha256:788ecaa9c10533b786ce5ba70c4f2df78ad41819fd00a6c99d92b66f9a32e1da"}, + {file = "aiohttp-3.14.5-cp315-cp315-android_24_x86_64.whl", hash = "sha256:5c76f1802bab718a68ac3cce447160605c734551f95c67ae90fa1132b215cb29"}, + {file = "aiohttp-3.14.5-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:a6d02b4c38de03d9c7617813433e6a0fb6b522797974177d69d9dad431900833"}, + {file = "aiohttp-3.14.5-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:20726f9782d5c2744c1c66255842d1d163bb3edcf768b8de25216bf47f7b6ccf"}, + {file = "aiohttp-3.14.5-cp315-cp315-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:248d779ad720b49d4fb355720e60c9e5f444f95887bc16974fea48fc56c41789"}, + {file = "aiohttp-3.14.5-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:0a8ea271867e360ac985ae607f4a23ad9a38414b9aca1d49ec98839ae660e49f"}, + {file = "aiohttp-3.14.5-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:823c910f046f23f4c713b8d99a2242dc65f591cb45ee86418fa11762a3c2963c"}, + {file = "aiohttp-3.14.5-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:9b42db919715e91eb76acf3bc492a9a7ccd8bd9adc6745c1412b689735269f14"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d3112585250b199296c26ca6e0131640b6a8d01bab8b232d2eb3763ed469de11"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c147451b4a58e7050f7f7394e6c467867c84161560001f9ad4fb2d1446743946"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bf163cc701f3d4ac43ba7d97771bf5fd955220ef5500ef3ee847bc0ecfbf4ec1"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f8d40ce41991e9d56fab4f5dc4a51fe59bc3b5c77c27f4b148963064d00232e8"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:276a4fc00b1d9ae492b802763a789c5b86328b989c5ea169f2faa447d6a11c7c"}, + {file = "aiohttp-3.14.5-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:50983e3be33d8c0942ab88cec3905b10602f64c469b20153c48c5d4e558dd016"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:16c8abd5bca220a47efe667d26f8460124c81810787e79ee87b242677563d9dd"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:0790ec66fa4013e83c53b9025a45d454723da1a2fce28b3208c9b32d08af162f"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:cb11a971a3aea10f9b8373be628f1df932964fc6c6b174516d318a48c3ac4412"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:932ce7e694bbc29b2bf6f64f2343c27d148d4997c771d01bdade4639b6749ff4"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:a7d470cf7b206e6359fc77b1b860632fde400d5a2ed59cd0181b93a686bc81ee"}, + {file = "aiohttp-3.14.5-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:6e1d8637cf73eebc92eba2e11d4cfff98a3b562f2505bd75bba766d908926e8d"}, + {file = "aiohttp-3.14.5-cp315-cp315-win32.whl", hash = "sha256:fbdc5ec49f9ca3cd24955cf3520b10a4d4c901ba2572094c84274e9e7eb30534"}, + {file = "aiohttp-3.14.5-cp315-cp315-win_amd64.whl", hash = "sha256:a9d3983bd6ab7aa1cfd573544ae98df9b6cb6912a5185a198263e024a636861d"}, + {file = "aiohttp-3.14.5-cp315-cp315-win_arm64.whl", hash = "sha256:e29347c142cf6e99e0dff5e2995ead1d50fa3b51bf37a7c726a7ccfe5419745a"}, + {file = "aiohttp-3.14.5-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:9bf1d5dcc15204d9ec8b8ea4c18fd66e6b80e5de1f4ecbafb3a2f2740f8039d4"}, + {file = "aiohttp-3.14.5-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:14f04769cfefe4734016a856a83af36133cd17779cef9ae817f812b8ba9d6d51"}, + {file = "aiohttp-3.14.5-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:6e4251c0ba4624a68a2c11471a1ac54c3306876c21f0ae86de085cc9241c8905"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e4f5cf4dc72a71c4cfa9751b4950be22f733626670230d46e7d606592aa22d59"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:dbf53ae2601b7fd5a93c3944deea3a78d40f495226d582c35ef7a433425ce2b2"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:657291433bf4dd3142f3abac495764cd47d0c7c92087751e6666c6447e65fcef"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3e51a27980c3788e6e6b3325d694fdd4898087fa8a86b2763af77b39353da41e"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:82c7583cd3dfdc7dcc927835b4f6c7faae7ecc1ba3ca5879321621ae2e6f8e84"}, + {file = "aiohttp-3.14.5-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6fdcd6af7e2e51d1ba1b4bea16e97b074bcb7b5dd0246a9d8201341bb28085a0"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:c8859a013ae0de1074660992139a1a440df3e6b219b86cf0d3f11c2692bb4fe3"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:8966ecac808dd5f473c9c4cefd10cd3ffda71c18a4d3493b7c7d2ae1803bf2cc"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:3093b72c215bda16ce961a6d073f6e71d46e022962a9d5d457c5d4d421c78b57"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:149fb56caf7acb67073126f675d0958d9c4b3125fcd3f6d4877df98aa8a97ce9"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:293d3ae7c6a0ed176a42e59a1b5fde825ead65c835360f734148e96729f928d2"}, + {file = "aiohttp-3.14.5-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:3f2dcc00191fd563e9075181a14ec31d7dd63223ced7582cc70a15a499de0c79"}, + {file = "aiohttp-3.14.5-cp315-cp315t-win32.whl", hash = "sha256:7779cd97e61ebe583ec2f1c5616cdd038aa08a4453b1848c67842176d054948e"}, + {file = "aiohttp-3.14.5-cp315-cp315t-win_amd64.whl", hash = "sha256:0e6f16f5e49c4b8267988c05ab07760d7064cea57d077c3d068d04b0fbb992cb"}, + {file = "aiohttp-3.14.5-cp315-cp315t-win_arm64.whl", hash = "sha256:1aead151c3abbac6b32942e452020cb66d7efc099d253cc6c20f748e926c858b"}, + {file = "aiohttp-3.14.5-py3-none-any.whl", hash = "sha256:efc21a454892828368b11c2c780de0ff8bc991f73f6b99c6b66e56205470929b"}, + {file = "aiohttp-3.14.5.tar.gz", hash = "sha256:5558a7f5a05af9ecf744af91e5baefc436f93c9333e656c27ec253f9a6bbe178"}, +] + +[package.dependencies] +aiohappyeyeballs = ">=2.5.0" +aiosignal = ">=1.4.0" +attrs = ">=17.3.0" +frozenlist = ">=1.1.1" +multidict = ">=4.5,<8.0" +propcache = ">=0.2.0" +typing_extensions = {version = ">=4.4", markers = "python_version < \"3.13\""} +yarl = ">=1.25.1,<2.0" + +[package.extras] +speedups = ["Brotli (>=1.2) ; platform_python_implementation == \"CPython\" and sys_platform != \"android\" and sys_platform != \"ios\"", "aiodns (>=3.3.0) ; sys_platform != \"android\" and sys_platform != \"ios\"", "backports.zstd ; platform_python_implementation == \"CPython\" and python_version < \"3.14\" and sys_platform != \"android\" and sys_platform != \"ios\"", "brotlicffi (>=1.2) ; platform_python_implementation != \"CPython\""] + +[[package]] +name = "aioitertools" +version = "0.13.0" +description = "itertools and builtins for AsyncIO and mixed iterables" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "aioitertools-0.13.0-py3-none-any.whl", hash = "sha256:0be0292b856f08dfac90e31f4739432f4cb6d7520ab9eb73e143f4f2fa5259be"}, + {file = "aioitertools-0.13.0.tar.gz", hash = "sha256:620bd241acc0bbb9ec819f1ab215866871b4bbd1f73836a55f799200ee86950c"}, +] + +[[package]] +name = "aiosignal" +version = "1.4.0" +description = "aiosignal: a list of registered asynchronous callbacks" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e"}, + {file = "aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7"}, +] + +[package.dependencies] +frozenlist = ">=1.1.0" +typing-extensions = {version = ">=4.2", markers = "python_version < \"3.13\""} + +[[package]] +name = "annotated-doc" +version = "0.0.5" +description = "Document parameters, class attributes, return types, and variables inline, with Annotated." +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101"}, + {file = "annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb"}, +] + +[[package]] +name = "annotated-types" +version = "0.8.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0"}, + {file = "annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7"}, +] + +[[package]] +name = "anyio" +version = "4.15.1" +description = "High-level concurrency and networking framework on top of asyncio or Trio" +optional = false +python-versions = ">=3.10" +groups = ["main", "dev"] +files = [ + {file = "anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101"}, + {file = "anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94"}, +] + +[package.dependencies] +idna = ">=2.8" +typing_extensions = {version = ">=4.16.0", markers = "python_version < \"3.15\""} + +[package.extras] +trio = ["trio (>=0.32.0)"] + +[[package]] +name = "argon2-cffi" +version = "25.1.0" +description = "Argon2 for Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "argon2_cffi-25.1.0-py3-none-any.whl", hash = "sha256:fdc8b074db390fccb6eb4a3604ae7231f219aa669a2652e0f20e16ba513d5741"}, + {file = "argon2_cffi-25.1.0.tar.gz", hash = "sha256:694ae5cc8a42f4c4e2bf2ca0e64e51e23a040c6a517a85074683d3959e1346c1"}, +] + +[package.dependencies] +argon2-cffi-bindings = "*" + +[[package]] +name = "argon2-cffi-bindings" +version = "26.1.0" +description = "Low-level CFFI bindings for Argon2" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:21ca0396fe5ec995dd54431c32698189666f9224810acfa752e50d2bd94d9df2"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:78de2d65e0b9ea7ce9d1b1c3e87297b2d7305a02c266ee2a2d6910daddd7ee69"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:27f1821903e2ceadcb88ec2b45ef190897b7682449c772f4d9b53e42c520cf29"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d88e5f7e60f28ae0b0cc6b2f16c43e87cd642a196a86f85e0d8bb6fe016fc16d"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:34b7d9c24a4165a2c61cc8ae11d44d48c9ce2830fb536cb7914e11fdd9962728"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:224865cbbcb7a2bd1356741dff12b0134df726b6d44bb7b500df8e303cbd9e81"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ffff613aaa9ce6236766e2fc6dc560bb5abde7a2e2416e3db1f9ae395a2b4dd4"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-win32.whl", hash = "sha256:a86c069c91a747a2c4e5c51473590aeb48172fff9b2130d23729a42d98665ecb"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-win_amd64.whl", hash = "sha256:2c36ff87b5dfaa477d0bd51e9d7f6abdae7c8955d2983c97419085d842154b3e"}, + {file = "argon2_cffi_bindings-26.1.0-cp310-abi3-win_arm64.whl", hash = "sha256:f9c4420a7a864fe1b86ce35befc95b8e39fb852493b81cf798671ddc265de638"}, + {file = "argon2_cffi_bindings-26.1.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:af11ac37a7c53dc16cb7950a6190851b0870fe218b6c60c0bb7ac355234e3083"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:db0fcd827ca61622a01b220aadfbece01939acf53888f2cb98cd93e9b1e2c97e"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:28524438cd3e723f25412f63d4fd516ff5bae9ae5aa56acbe2a1404398a0cf31"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ac82fc756a446b6ccd7139ce70efa9d8bbe541e7ad579a12dcb52764b7175c5f"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6a4e68eed961a8de6928d1c17ff3dc2a547e0e923c17f8f1cd79fb7bc9502f98"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:151dfaad9de753f4af2a7854e707e4784f2acc434340ade64239c5b104b2d605"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:061a6919145bbf282ebf1f9c59d3135d4833c25313c8595c0d68cf7712ddfce2"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:62ff20cd130c956c7c9144d5fe35228f98b51c579b2439e988b27ef93e16c02a"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:19423e5d7ac1cc354baab59eaabf18db2ec04ef6593b5abe5a34f323c4a8f87a"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-win32.whl", hash = "sha256:4f84cdd868978d7b7350a566c254042d44216d9e37f241f3a6d3b1dfebeede35"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2b741888c93147444fdfc851abd81cc207f37f7f7da42062a00deb3888e57da8"}, + {file = "argon2_cffi_bindings-26.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:6ab674f668d5962a3a4136ae0812519b0f1586874263723a32181d60d64137e1"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1d98e33bd8bd67d7206c124e200bf2229c4cfa8c9c19f7b44a897f0fc71837eb"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ccaf0a46cbb380f1fd102a874e32aa629fd3cb0c0e94f4943fa1f6d5edc5dac6"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f0c3103fcff20183e593459cfea6e012281c0e76ae3ed8b5565ad1b92eac3990"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c49e853a3bef9dd10329f31f702e7fa9b5c58229ff9c2ff6d069efaf09177c08"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:6376d4b3aca039375ca8bf92f770da0ec424a1ce3a37077a8d3c557411aa56ca"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:9bacedc04b0402837586a17f0919e3dfdd95291f441f1f56bd80ec274c2840a1"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:76ae29acace5d33355344612844d588e19deaaba4639d8bb01601e4b1418ef36"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-win32.whl", hash = "sha256:df612391feca41c44d20118f3b88d1b86419465cd1f5496859f715ca60ec2210"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-win_amd64.whl", hash = "sha256:1a0a29ed86960e44eaace7e081bdfab4f08b012fd96ec8edba71e2ad020939e4"}, + {file = "argon2_cffi_bindings-26.1.0-cp315-cp315t-win_arm64.whl", hash = "sha256:d157ddfab1e8b21f2f1dedda9c09645d98b5ed0b667b0626be600a345d426440"}, + {file = "argon2_cffi_bindings-26.1.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:7014ab7e6f5d8511af92544667a0346ea6dfc314ea9a7cad1dba9fdb5c9a6e33"}, + {file = "argon2_cffi_bindings-26.1.0-pp310-pypy310_pp73-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:242bb0cda2ae3650764fc194593d9ea45fc9e72729acd89778c7cfe184cec2a5"}, + {file = "argon2_cffi_bindings-26.1.0-pp310-pypy310_pp73-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b70225b5fd1e0d2ef4f7fd30d24658454535f0924dff0caca5dc08efbbbadfbb"}, + {file = "argon2_cffi_bindings-26.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:1af817e84578ef8b7295ad17de0f9896e4c8520dbf2233c7aa5aa3d487256fc4"}, + {file = "argon2_cffi_bindings-26.1.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:19b562b1de4b9052ef1214a2821c44b6e6f22945daa102c32ae4eff929d8b6d8"}, + {file = "argon2_cffi_bindings-26.1.0-pp311-pypy311_pp73-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49d525938467d52c923a890153c99087c9d5a937d1f6b585dbdba34ec82e397a"}, + {file = "argon2_cffi_bindings-26.1.0-pp311-pypy311_pp73-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1b0bcac4d490a237e18cf91f57352920c29f77f2fa39efd0813fb81298bf17ba"}, + {file = "argon2_cffi_bindings-26.1.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:0cc40f7b4050bb93eb67de95d2d759322fc7ce4930b9d645581ecf4913ec651e"}, + {file = "argon2_cffi_bindings-26.1.0.tar.gz", hash = "sha256:63505c71542a44b68b1e38060450fb006404170da375feb31af153e7f9c6205d"}, +] + +[package.dependencies] +cffi = {version = ">=1.0.1", markers = "python_version < \"3.14\""} + +[[package]] +name = "asyncpg" +version = "0.31.0" +description = "An asyncio PostgreSQL driver" +optional = false +python-versions = ">=3.9.0" +groups = ["main"] +files = [ + {file = "asyncpg-0.31.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:831712dd3cf117eec68575a9b50da711893fd63ebe277fc155ecae1c6c9f0f61"}, + {file = "asyncpg-0.31.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0b17c89312c2f4ccea222a3a6571f7df65d4ba2c0e803339bfc7bed46a96d3be"}, + {file = "asyncpg-0.31.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3faa62f997db0c9add34504a68ac2c342cfee4d57a0c3062fcf0d86c7f9cb1e8"}, + {file = "asyncpg-0.31.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8ea599d45c361dfbf398cb67da7fd052affa556a401482d3ff1ee99bd68808a1"}, + {file = "asyncpg-0.31.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:795416369c3d284e1837461909f58418ad22b305f955e625a4b3a2521d80a5f3"}, + {file = "asyncpg-0.31.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a8d758dac9d2e723e173d286ef5e574f0b350ec00e9186fce84d0fc5f6a8e6b8"}, + {file = "asyncpg-0.31.0-cp310-cp310-win32.whl", hash = "sha256:2d076d42eb583601179efa246c5d7ae44614b4144bc1c7a683ad1222814ed095"}, + {file = "asyncpg-0.31.0-cp310-cp310-win_amd64.whl", hash = "sha256:9ea33213ac044171f4cac23740bed9a3805abae10e7025314cfbd725ec670540"}, + {file = "asyncpg-0.31.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:eee690960e8ab85063ba93af2ce128c0f52fd655fdff9fdb1a28df01329f031d"}, + {file = "asyncpg-0.31.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2657204552b75f8288de08ca60faf4a99a65deef3a71d1467454123205a88fab"}, + {file = "asyncpg-0.31.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a429e842a3a4b4ea240ea52d7fe3f82d5149853249306f7ff166cb9948faa46c"}, + {file = "asyncpg-0.31.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c0807be46c32c963ae40d329b3a686356e417f674c976c07fa49f1b30303f109"}, + {file = "asyncpg-0.31.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e5d5098f63beeae93512ee513d4c0c53dc12e9aa2b7a1af5a81cddf93fe4e4da"}, + {file = "asyncpg-0.31.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37fc6c00a814e18eef51833545d1891cac9aa69140598bb076b4cd29b3e010b9"}, + {file = "asyncpg-0.31.0-cp311-cp311-win32.whl", hash = "sha256:5a4af56edf82a701aece93190cc4e094d2df7d33f6e915c222fb09efbb5afc24"}, + {file = "asyncpg-0.31.0-cp311-cp311-win_amd64.whl", hash = "sha256:480c4befbdf079c14c9ca43c8c5e1fe8b6296c96f1f927158d4f1e750aacc047"}, + {file = "asyncpg-0.31.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b44c31e1efc1c15188ef183f287c728e2046abb1d26af4d20858215d50d91fad"}, + {file = "asyncpg-0.31.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0c89ccf741c067614c9b5fc7f1fc6f3b61ab05ae4aaa966e6fd6b93097c7d20d"}, + {file = "asyncpg-0.31.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:12b3b2e39dc5470abd5e98c8d3373e4b1d1234d9fbdedf538798b2c13c64460a"}, + {file = "asyncpg-0.31.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:aad7a33913fb8bcb5454313377cc330fbb19a0cd5faa7272407d8a0c4257b671"}, + {file = "asyncpg-0.31.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3df118d94f46d85b2e434fd62c84cb66d5834d5a890725fe625f498e72e4d5ec"}, + {file = "asyncpg-0.31.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:bd5b6efff3c17c3202d4b37189969acf8927438a238c6257f66be3c426beba20"}, + {file = "asyncpg-0.31.0-cp312-cp312-win32.whl", hash = "sha256:027eaa61361ec735926566f995d959ade4796f6a49d3bde17e5134b9964f9ba8"}, + {file = "asyncpg-0.31.0-cp312-cp312-win_amd64.whl", hash = "sha256:72d6bdcbc93d608a1158f17932de2321f68b1a967a13e014998db87a72ed3186"}, + {file = "asyncpg-0.31.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c204fab1b91e08b0f47e90a75d1b3c62174dab21f670ad6c5d0f243a228f015b"}, + {file = "asyncpg-0.31.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:54a64f91839ba59008eccf7aad2e93d6e3de688d796f35803235ea1c4898ae1e"}, + {file = "asyncpg-0.31.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0e0822b1038dc7253b337b0f3f676cadc4ac31b126c5d42691c39691962e403"}, + {file = "asyncpg-0.31.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bef056aa502ee34204c161c72ca1f3c274917596877f825968368b2c33f585f4"}, + {file = "asyncpg-0.31.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0bfbcc5b7ffcd9b75ab1558f00db2ae07db9c80637ad1b2469c43df79d7a5ae2"}, + {file = "asyncpg-0.31.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:22bc525ebbdc24d1261ecbf6f504998244d4e3be1721784b5f64664d61fbe602"}, + {file = "asyncpg-0.31.0-cp313-cp313-win32.whl", hash = "sha256:f890de5e1e4f7e14023619399a471ce4b71f5418cd67a51853b9910fdfa73696"}, + {file = "asyncpg-0.31.0-cp313-cp313-win_amd64.whl", hash = "sha256:dc5f2fa9916f292e5c5c8b2ac2813763bcd7f58e130055b4ad8a0531314201ab"}, + {file = "asyncpg-0.31.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:f6b56b91bb0ffc328c4e3ed113136cddd9deefdf5f79ab448598b9772831df44"}, + {file = "asyncpg-0.31.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:334dec28cf20d7f5bb9e45b39546ddf247f8042a690bff9b9573d00086e69cb5"}, + {file = "asyncpg-0.31.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98cc158c53f46de7bb677fd20c417e264fc02b36d901cc2a43bd6cb0dc6dbfd2"}, + {file = "asyncpg-0.31.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9322b563e2661a52e3cdbc93eed3be7748b289f792e0011cb2720d278b366ce2"}, + {file = "asyncpg-0.31.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19857a358fc811d82227449b7ca40afb46e75b33eb8897240c3839dd8b744218"}, + {file = "asyncpg-0.31.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ba5f8886e850882ff2c2ace5732300e99193823e8107e2c53ef01c1ebfa1e85d"}, + {file = "asyncpg-0.31.0-cp314-cp314-win32.whl", hash = "sha256:cea3a0b2a14f95834cee29432e4ddc399b95700eb1d51bbc5bfee8f31fa07b2b"}, + {file = "asyncpg-0.31.0-cp314-cp314-win_amd64.whl", hash = "sha256:04d19392716af6b029411a0264d92093b6e5e8285ae97a39957b9a9c14ea72be"}, + {file = "asyncpg-0.31.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:bdb957706da132e982cc6856bb2f7b740603472b54c3ebc77fe60ea3e57e1bd2"}, + {file = "asyncpg-0.31.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6d11b198111a72f47154fa03b85799f9be63701e068b43f84ac25da0bda9cb31"}, + {file = "asyncpg-0.31.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:18c83b03bc0d1b23e6230f5bf8d4f217dc9bc08644ce0502a9d91dc9e634a9c7"}, + {file = "asyncpg-0.31.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e009abc333464ff18b8f6fd146addffd9aaf63e79aa3bb40ab7a4c332d0c5e9e"}, + {file = "asyncpg-0.31.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3b1fbcb0e396a5ca435a8826a87e5c2c2cc0c8c68eb6fadf82168056b0e53a8c"}, + {file = "asyncpg-0.31.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8df714dba348efcc162d2adf02d213e5fab1bd9f557e1305633e851a61814a7a"}, + {file = "asyncpg-0.31.0-cp314-cp314t-win32.whl", hash = "sha256:1b41f1afb1033f2b44f3234993b15096ddc9cd71b21a42dbd87fc6a57b43d65d"}, + {file = "asyncpg-0.31.0-cp314-cp314t-win_amd64.whl", hash = "sha256:bd4107bb7cdd0e9e65fae66a62afd3a249663b844fa34d479f6d5b3bef9c04c3"}, + {file = "asyncpg-0.31.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ebb3cde58321a1f89ce41812be3f2a98dddedc1e76d0838aba1d724f1e4e1a95"}, + {file = "asyncpg-0.31.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e6974f36eb9a224d8fb428bcf66bd411aa12cf57c2967463178149e73d4de366"}, + {file = "asyncpg-0.31.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc2b685f400ceae428f79f78b58110470d7b4466929a7f78d455964b17ad1008"}, + {file = "asyncpg-0.31.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bb223567dea5f47c45d347f2bde5486be8d9f40339f27217adb3fb1c3be51298"}, + {file = "asyncpg-0.31.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:22be6e02381bab3101cd502d9297ac71e2f966c86e20e78caead9934c98a8af6"}, + {file = "asyncpg-0.31.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:37a58919cfef2448a920df00d1b2f821762d17194d0dbf355d6dde8d952c04f9"}, + {file = "asyncpg-0.31.0-cp39-cp39-win32.whl", hash = "sha256:c1a9c5b71d2371a2290bc93336cd05ba4ec781683cab292adbddc084f89443c6"}, + {file = "asyncpg-0.31.0-cp39-cp39-win_amd64.whl", hash = "sha256:c1e1ab5bc65373d92dd749d7308c5b26fb2dc0fbe5d3bf68a32b676aa3bcd24a"}, + {file = "asyncpg-0.31.0.tar.gz", hash = "sha256:c989386c83940bfbd787180f2b1519415e2d3d6277a70d9d0f0145ac73500735"}, +] + +[package.extras] +gssauth = ["gssapi ; platform_system != \"Windows\"", "sspilib ; platform_system == \"Windows\""] + +[[package]] +name = "attrs" +version = "26.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309"}, + {file = "attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32"}, +] + +[[package]] +name = "boto3" +version = "1.36.1" +description = "The AWS SDK for Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "boto3-1.36.1-py3-none-any.whl", hash = "sha256:eb21380d73fec6645439c0d802210f72a0cdb3295b02953f246ff53f512faa8f"}, + {file = "boto3-1.36.1.tar.gz", hash = "sha256:258ab77225a81d3cf3029c9afe9920cd9dec317689dfadec6f6f0a23130bb60a"}, +] + +[package.dependencies] +botocore = ">=1.36.1,<1.37.0" +jmespath = ">=0.7.1,<2.0.0" +s3transfer = ">=0.11.0,<0.12.0" + +[package.extras] +crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] + +[[package]] +name = "botocore" +version = "1.36.1" +description = "Low-level, data-driven core of boto 3." +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "botocore-1.36.1-py3-none-any.whl", hash = "sha256:dec513b4eb8a847d79bbefdcdd07040ed9d44c20b0001136f0890a03d595705a"}, + {file = "botocore-1.36.1.tar.gz", hash = "sha256:f789a6f272b5b3d8f8756495019785e33868e5e00dd9662a3ee7959ac939bb12"}, +] + +[package.dependencies] +jmespath = ">=0.7.1,<2.0.0" +python-dateutil = ">=2.1,<3.0.0" +urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""} + +[package.extras] +crt = ["awscrt (==0.23.4)"] + +[[package]] +name = "certifi" +version = "2026.7.22" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775"}, + {file = "certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55"}, +] + +[[package]] +name = "cffi" +version = "2.1.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "cffi-2.1.1-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be"}, + {file = "cffi-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b"}, + {file = "cffi-2.1.1-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004"}, + {file = "cffi-2.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9"}, + {file = "cffi-2.1.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98"}, + {file = "cffi-2.1.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9"}, + {file = "cffi-2.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6"}, + {file = "cffi-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf"}, + {file = "cffi-2.1.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659"}, + {file = "cffi-2.1.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9"}, + {file = "cffi-2.1.1-cp310-cp310-win32.whl", hash = "sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41"}, + {file = "cffi-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1"}, + {file = "cffi-2.1.1-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12"}, + {file = "cffi-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1"}, + {file = "cffi-2.1.1-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0"}, + {file = "cffi-2.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813"}, + {file = "cffi-2.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990"}, + {file = "cffi-2.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af"}, + {file = "cffi-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632"}, + {file = "cffi-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd"}, + {file = "cffi-2.1.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a"}, + {file = "cffi-2.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa"}, + {file = "cffi-2.1.1-cp311-cp311-win32.whl", hash = "sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3"}, + {file = "cffi-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0"}, + {file = "cffi-2.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455"}, + {file = "cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0"}, + {file = "cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf"}, + {file = "cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a"}, + {file = "cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890"}, + {file = "cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50"}, + {file = "cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e"}, + {file = "cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf"}, + {file = "cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517"}, + {file = "cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735"}, + {file = "cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e"}, + {file = "cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a"}, + {file = "cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80"}, + {file = "cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e"}, + {file = "cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c"}, + {file = "cffi-2.1.1-cp313-cp313-macosx_10_15_x86_64.whl", hash = "sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6"}, + {file = "cffi-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971"}, + {file = "cffi-2.1.1-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c"}, + {file = "cffi-2.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125"}, + {file = "cffi-2.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264"}, + {file = "cffi-2.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3"}, + {file = "cffi-2.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2"}, + {file = "cffi-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b"}, + {file = "cffi-2.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7"}, + {file = "cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac"}, + {file = "cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d"}, + {file = "cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973"}, + {file = "cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c"}, + {file = "cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb"}, + {file = "cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54"}, + {file = "cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72"}, + {file = "cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1"}, + {file = "cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062"}, + {file = "cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03"}, + {file = "cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96"}, + {file = "cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527"}, + {file = "cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13"}, + {file = "cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c"}, + {file = "cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48"}, + {file = "cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836"}, + {file = "cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3"}, + {file = "cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2"}, + {file = "cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94"}, + {file = "cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc"}, + {file = "cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29"}, + {file = "cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676"}, + {file = "cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e"}, + {file = "cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f"}, + {file = "cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4"}, + {file = "cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e"}, + {file = "cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5"}, + {file = "cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d"}, + {file = "cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b"}, + {file = "cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4"}, + {file = "cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8"}, + {file = "cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6"}, + {file = "cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80"}, + {file = "cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779"}, + {file = "cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399"}, + {file = "cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688"}, + {file = "cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7"}, + {file = "cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac"}, + {file = "cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960"}, + {file = "cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1"}, + {file = "cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc"}, + {file = "cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab"}, + {file = "cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e"}, + {file = "cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358"}, + {file = "cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231"}, + {file = "cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6"}, + {file = "cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94"}, + {file = "cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5"}, + {file = "cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66"}, + {file = "cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3"}, + {file = "cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692"}, + {file = "cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be"}, +] + +[package.dependencies] +pycparser = {version = "*", markers = "implementation_name != \"PyPy\""} + +[[package]] +name = "click" +version = "8.5.0" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360"}, + {file = "click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main", "dev"] +markers = "sys_platform == \"win32\"" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "envparse" +version = "0.2.0" +description = "Simple environment variable parsing" +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "envparse-0.2.0.tar.gz", hash = "sha256:4f3b9a27bb55d27f124eb4adf006fec05e4588891c9a054a183a112645056eb7"}, +] + +[package.extras] +testing = ["pytest"] + +[[package]] +name = "fastapi" +version = "0.142.2" +description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "fastapi-0.142.2-py3-none-any.whl", hash = "sha256:bd5f4d81f1e93a88bcd77caf4dfe3c2dbffc3805407a0007e9a114c18b3a670b"}, + {file = "fastapi-0.142.2.tar.gz", hash = "sha256:06366626f2e70576367714d9ab2fe8472e6c8456dba69b399f9f797ab5e92570"}, +] + +[package.dependencies] +annotated-doc = ">=0.0.2" +opentelemetry-api = ">=1.44.0" +pydantic = ">=2.9.0" +starlette = ">=0.46.0" +typing-extensions = ">=4.8.0" +typing-inspection = ">=0.4.2" + +[package.extras] +all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.32)", "httpx (>=0.23.0,<1.0.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=3.1.5)", "opentelemetry-exporter-otlp-proto-http (>=1.44.0)", "opentelemetry-sdk (>=1.44.0)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "pyyaml (>=5.3.1)", "uvicorn[standard] (>=0.12.0)"] +opentelemetry = ["opentelemetry-exporter-otlp-proto-http (>=1.44.0)", "opentelemetry-sdk (>=1.44.0)"] +standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.32)", "fastar (>=0.9.0)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "opentelemetry-exporter-otlp-proto-http (>=1.44.0)", "opentelemetry-sdk (>=1.44.0)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] +standard-no-fastapi-cloud-cli = ["email-validator (>=2.0.0)", "fastapi-cli[standard-no-fastapi-cloud-cli] (>=0.0.32)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "opentelemetry-exporter-otlp-proto-http (>=1.44.0)", "opentelemetry-sdk (>=1.44.0)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] + +[[package]] +name = "frozenlist" +version = "1.8.0" +description = "A list-like structure which implements collections.abc.MutableSequence" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b37f6d31b3dcea7deb5e9696e529a6aa4a898adc33db82da12e4c60a7c4d2011"}, + {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef2b7b394f208233e471abc541cc6991f907ffd47dc72584acee3147899d6565"}, + {file = "frozenlist-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a88f062f072d1589b7b46e951698950e7da00442fc1cacbe17e19e025dc327ad"}, + {file = "frozenlist-1.8.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f57fb59d9f385710aa7060e89410aeb5058b99e62f4d16b08b91986b9a2140c2"}, + {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:799345ab092bee59f01a915620b5d014698547afd011e691a208637312db9186"}, + {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c23c3ff005322a6e16f71bf8692fcf4d5a304aaafe1e262c98c6d4adc7be863e"}, + {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8a76ea0f0b9dfa06f254ee06053d93a600865b3274358ca48a352ce4f0798450"}, + {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c7366fe1418a6133d5aa824ee53d406550110984de7637d65a178010f759c6ef"}, + {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:13d23a45c4cebade99340c4165bd90eeb4a56c6d8a9d8aa49568cac19a6d0dc4"}, + {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:e4a3408834f65da56c83528fb52ce7911484f0d1eaf7b761fc66001db1646eff"}, + {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:42145cd2748ca39f32801dad54aeea10039da6f86e303659db90db1c4b614c8c"}, + {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:e2de870d16a7a53901e41b64ffdf26f2fbb8917b3e6ebf398098d72c5b20bd7f"}, + {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:20e63c9493d33ee48536600d1a5c95eefc870cd71e7ab037763d1fbb89cc51e7"}, + {file = "frozenlist-1.8.0-cp310-cp310-win32.whl", hash = "sha256:adbeebaebae3526afc3c96fad434367cafbfd1b25d72369a9e5858453b1bb71a"}, + {file = "frozenlist-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:667c3777ca571e5dbeb76f331562ff98b957431df140b54c85fd4d52eea8d8f6"}, + {file = "frozenlist-1.8.0-cp310-cp310-win_arm64.whl", hash = "sha256:80f85f0a7cc86e7a54c46d99c9e1318ff01f4687c172ede30fd52d19d1da1c8e"}, + {file = "frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84"}, + {file = "frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9"}, + {file = "frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93"}, + {file = "frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f"}, + {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695"}, + {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52"}, + {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:edee74874ce20a373d62dc28b0b18b93f645633c2943fd90ee9d898550770581"}, + {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c9a63152fe95756b85f31186bddf42e4c02c6321207fd6601a1c89ebac4fe567"}, + {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6db2185db9be0a04fecf2f241c70b63b1a242e2805be291855078f2b404dd6b"}, + {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f4be2e3d8bc8aabd566f8d5b8ba7ecc09249d74ba3c9ed52e54dc23a293f0b92"}, + {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c8d1634419f39ea6f5c427ea2f90ca85126b54b50837f31497f3bf38266e853d"}, + {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:1a7fa382a4a223773ed64242dbe1c9c326ec09457e6b8428efb4118c685c3dfd"}, + {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:11847b53d722050808926e785df837353bd4d75f1d494377e59b23594d834967"}, + {file = "frozenlist-1.8.0-cp311-cp311-win32.whl", hash = "sha256:27c6e8077956cf73eadd514be8fb04d77fc946a7fe9f7fe167648b0b9085cc25"}, + {file = "frozenlist-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac913f8403b36a2c8610bbfd25b8013488533e71e62b4b4adce9c86c8cea905b"}, + {file = "frozenlist-1.8.0-cp311-cp311-win_arm64.whl", hash = "sha256:d4d3214a0f8394edfa3e303136d0575eece0745ff2b47bd2cb2e66dd92d4351a"}, + {file = "frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1"}, + {file = "frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b"}, + {file = "frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4"}, + {file = "frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383"}, + {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4"}, + {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8"}, + {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b"}, + {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52"}, + {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29"}, + {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3"}, + {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143"}, + {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608"}, + {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa"}, + {file = "frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf"}, + {file = "frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746"}, + {file = "frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd"}, + {file = "frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a"}, + {file = "frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7"}, + {file = "frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40"}, + {file = "frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027"}, + {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822"}, + {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121"}, + {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5"}, + {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e"}, + {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11"}, + {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1"}, + {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1"}, + {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8"}, + {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed"}, + {file = "frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496"}, + {file = "frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231"}, + {file = "frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62"}, + {file = "frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94"}, + {file = "frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c"}, + {file = "frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52"}, + {file = "frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51"}, + {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65"}, + {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82"}, + {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714"}, + {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d"}, + {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506"}, + {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51"}, + {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e"}, + {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0"}, + {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41"}, + {file = "frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b"}, + {file = "frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888"}, + {file = "frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042"}, + {file = "frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0"}, + {file = "frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f"}, + {file = "frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c"}, + {file = "frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2"}, + {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8"}, + {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686"}, + {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e"}, + {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a"}, + {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128"}, + {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f"}, + {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7"}, + {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30"}, + {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7"}, + {file = "frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806"}, + {file = "frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0"}, + {file = "frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b"}, + {file = "frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d"}, + {file = "frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed"}, + {file = "frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930"}, + {file = "frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c"}, + {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24"}, + {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37"}, + {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a"}, + {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2"}, + {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef"}, + {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe"}, + {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8"}, + {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a"}, + {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e"}, + {file = "frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df"}, + {file = "frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd"}, + {file = "frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79"}, + {file = "frozenlist-1.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d8b7138e5cd0647e4523d6685b0eac5d4be9a184ae9634492f25c6eb38c12a47"}, + {file = "frozenlist-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a6483e309ca809f1efd154b4d37dc6d9f61037d6c6a81c2dc7a15cb22c8c5dca"}, + {file = "frozenlist-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1b9290cf81e95e93fdf90548ce9d3c1211cf574b8e3f4b3b7cb0537cf2227068"}, + {file = "frozenlist-1.8.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:59a6a5876ca59d1b63af8cd5e7ffffb024c3dc1e9cf9301b21a2e76286505c95"}, + {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6dc4126390929823e2d2d9dc79ab4046ed74680360fc5f38b585c12c66cdf459"}, + {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:332db6b2563333c5671fecacd085141b5800cb866be16d5e3eb15a2086476675"}, + {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9ff15928d62a0b80bb875655c39bf517938c7d589554cbd2669be42d97c2cb61"}, + {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7bf6cdf8e07c8151fba6fe85735441240ec7f619f935a5205953d58009aef8c6"}, + {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:48e6d3f4ec5c7273dfe83ff27c91083c6c9065af655dc2684d2c200c94308bb5"}, + {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:1a7607e17ad33361677adcd1443edf6f5da0ce5e5377b798fba20fae194825f3"}, + {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3a935c3a4e89c733303a2d5a7c257ea44af3a56c8202df486b7f5de40f37e1"}, + {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:940d4a017dbfed9daf46a3b086e1d2167e7012ee297fef9e1c545c4d022f5178"}, + {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b9be22a69a014bc47e78072d0ecae716f5eb56c15238acca0f43d6eb8e4a5bda"}, + {file = "frozenlist-1.8.0-cp39-cp39-win32.whl", hash = "sha256:1aa77cb5697069af47472e39612976ed05343ff2e84a3dcf15437b232cbfd087"}, + {file = "frozenlist-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:7398c222d1d405e796970320036b1b563892b65809d9e5261487bb2c7f7b5c6a"}, + {file = "frozenlist-1.8.0-cp39-cp39-win_arm64.whl", hash = "sha256:b4f3b365f31c6cd4af24545ca0a244a53688cad8834e32f56831c4923b50a103"}, + {file = "frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d"}, + {file = "frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad"}, +] + +[[package]] +name = "h11" +version = "0.16.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.8" +groups = ["main", "dev"] +files = [ + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.16" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.20" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.9" +groups = ["main", "dev"] +files = [ + {file = "idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c"}, + {file = "idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44"}, +] + +[package.extras] +all = ["coverage (>=7.10.0)", "hypothesis (>=6.141.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.16.0)", "ty (>=0.0.37)"] + +[[package]] +name = "iniconfig" +version = "2.3.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"}, + {file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"}, +] + +[[package]] +name = "jmespath" +version = "1.1.0" +description = "JSON Matching Expressions" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64"}, + {file = "jmespath-1.1.0.tar.gz", hash = "sha256:472c87d80f36026ae83c6ddd0f1d05d4e510134ed462851fd5f754c8c3cbb88d"}, +] + +[[package]] +name = "loguru" +version = "0.7.3" +description = "Python logging made (stupidly) simple" +optional = false +python-versions = "<4.0,>=3.5" +groups = ["main"] +files = [ + {file = "loguru-0.7.3-py3-none-any.whl", hash = "sha256:31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c"}, + {file = "loguru-0.7.3.tar.gz", hash = "sha256:19480589e77d47b8d85b2c827ad95d49bf31b0dcde16593892eb51dd18706eb6"}, +] + +[package.dependencies] +colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} +win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} + +[package.extras] +dev = ["Sphinx (==8.1.3) ; python_version >= \"3.11\"", "build (==1.2.2) ; python_version >= \"3.11\"", "colorama (==0.4.5) ; python_version < \"3.8\"", "colorama (==0.4.6) ; python_version >= \"3.8\"", "exceptiongroup (==1.1.3) ; python_version >= \"3.7\" and python_version < \"3.11\"", "freezegun (==1.1.0) ; python_version < \"3.8\"", "freezegun (==1.5.0) ; python_version >= \"3.8\"", "mypy (==v0.910) ; python_version < \"3.6\"", "mypy (==v0.971) ; python_version == \"3.6\"", "mypy (==v1.13.0) ; python_version >= \"3.8\"", "mypy (==v1.4.1) ; python_version == \"3.7\"", "myst-parser (==4.0.0) ; python_version >= \"3.11\"", "pre-commit (==4.0.1) ; python_version >= \"3.9\"", "pytest (==6.1.2) ; python_version < \"3.8\"", "pytest (==8.3.2) ; python_version >= \"3.8\"", "pytest-cov (==2.12.1) ; python_version < \"3.8\"", "pytest-cov (==5.0.0) ; python_version == \"3.8\"", "pytest-cov (==6.0.0) ; python_version >= \"3.9\"", "pytest-mypy-plugins (==1.9.3) ; python_version >= \"3.6\" and python_version < \"3.8\"", "pytest-mypy-plugins (==3.1.0) ; python_version >= \"3.8\"", "sphinx-rtd-theme (==3.0.2) ; python_version >= \"3.11\"", "tox (==3.27.1) ; python_version < \"3.8\"", "tox (==4.23.2) ; python_version >= \"3.8\"", "twine (==6.0.1) ; python_version >= \"3.11\""] + +[[package]] +name = "multidict" +version = "6.9.1" +description = "multidict implementation" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "multidict-6.9.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:aef74e9beabbd6c4aafc091dabff86d046ccf013ce1e4396c0fbb01b4cad9de8"}, + {file = "multidict-6.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1ca5ebe6d454f1e5496cf052386a559f1080bf2de75bf327ebca0a6003b79f19"}, + {file = "multidict-6.9.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02f6d0c4b70f783305e73f9944d8efe6be1022550f0974ba0ae9d8893c0350fa"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8050e75af7e4c6e2d5260b84eeedb618f3e452e66473432e085b5d1b81429299"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4736d350371337825cac1793c9f7c40701c32a03912548c2a7608e51679cbb96"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:02fe09dc197b8ae7e355371e51e5dce2f39060cd5a8badf94904527e23a3f188"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ad4528cdce058b684f75fad1faf4a6a6c992fe2f08376370ca66e4ce5916a84a"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8885e3808aedbd6725b921fb67dacaae0678933561ddd47c2b01315198c70e2e"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d3b6e6840421c83ccb60398e333b44f910b0907bb409597685ab2eedd1e22eab"}, + {file = "multidict-6.9.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c9648ed33dc8179e4ec04bbc73bd7f0038e1e81217a69467f61f02a78bf07e88"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d9d6544790ba50438a9c1a903c3c4afb1ec8a7832db5518549275b40ef0dd4b1"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:1c9f3c25df6c9d3bbae4f6fd3f514b1c5c740a2110f56ccf36069c85417e289c"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:cf22b43f35b7dbb9f71e8ee2041b5c00029cdfc28ede3a2f31cf8906f9a6c126"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8ed78ccad4c7b421804f5d524b7740946a7ef75d89dc0dac52e9d7c24c472410"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:e3b1aa25f01238886a6baed9e13b9a9240ed344346c79ae280ae65e8603b21d5"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:bc94a68ea5e18f8e85dc6b522bcb53093f692c8eb62b4837ac047da73956cbe4"}, + {file = "multidict-6.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:73533644e1f69ea1164d56cc6505f564c6c44072b646b66d67df2d31fed0348c"}, + {file = "multidict-6.9.1-cp310-cp310-win32.whl", hash = "sha256:66987aa68b0f7c2a1cc5f388ca962b8ed92b10f79de38d6d0d8c716154f519d9"}, + {file = "multidict-6.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a32b78c1e52ebd8e247bb68300b90b233300d8816faa008ed0713bc539fb6af0"}, + {file = "multidict-6.9.1-cp310-cp310-win_arm64.whl", hash = "sha256:ab64ace1a68682d191d9bedd9d4c939406ad86b1d9f628180410644249ad46c2"}, + {file = "multidict-6.9.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:910d4260512660484c0dc1588a316fbb35a40c081c36fc51d1225351af17cfe4"}, + {file = "multidict-6.9.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:33fa55b990f81c2927e01399ace0d18926c69d69baa8cdaa819424132fb97987"}, + {file = "multidict-6.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:369b5aa01b241cd3fea6890bdbb11a1425d87bf1515831500d518f4223e9d72c"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:803f8b575a71b1b299d677c28db0653459c79b5308874efec813f17b7457c7f1"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b8a65621b98984a62e59403009591b8a5a7736273aefe1cab64cfb85b365cc07"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:13849a1d4f54c3809ae721e9e83ab28f5ea602f33660cb84eb6ef261eac706c1"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dd9a137a4a9becda3094f3831cd026380f75f6855e051eefe4c73ade524f1cc3"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9ae9614c317c50836689ce2dfde07c05fe0b16378562e2221746c3913ede3c80"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e8f1e362c9352b50ed120f001046fdbb80810c9d56580f4c3fc13bbe30823387"}, + {file = "multidict-6.9.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0dd655518f136febd96c05131a76a863e32fc2a1d7acd4e3c959e3ceb77d8345"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2c5d675da8f1cb5650271c8ad5e95c0a3e5a183c105e72d953b12877b1c8d0fd"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:658f90f49cf5af2441cad0a2b801c3ef520471989a1ec55bcb25b255b2ca8d2f"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:43124fe172ada86d03ac3c8dc8179091341f6724d5e5d5b160e1587e4cd3761b"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:b2f0adc22a4eb31e545221d93fc73a0f6a8cc2379d0f4309f71d1d17ba938b82"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7fc59e9ba821b220944ccfe0f89c9dc4745f6d097569992356eb03869f21e953"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:87cc632c88ee5dc80e12681047839304d98ee5c9a708d686505767001c9b8b9a"}, + {file = "multidict-6.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b828cf64d62dc09ac183f03c1aeedd164ade96a2ce4934109452edf29de1dd13"}, + {file = "multidict-6.9.1-cp311-cp311-win32.whl", hash = "sha256:2c1aeb92eea59d824f004341b26d5e4b47a8a441cf9726769b9a90abf9d0e08f"}, + {file = "multidict-6.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:5f89dad732280e7a10b74d40b91364f88e13c3f2c08c2ef83a8cd42f7a61af2e"}, + {file = "multidict-6.9.1-cp311-cp311-win_arm64.whl", hash = "sha256:5800368526647146978389dfaa46da3356291e9f0fff9a4ef12e8c2bef964a0d"}, + {file = "multidict-6.9.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:29138fef49828542e859828107e42e50d0e587c513b7eb4b2d92bade2b0860fe"}, + {file = "multidict-6.9.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:19e31815d41cefc365489e591d105d2baceb2f65aa75d29471fbdbda8651e006"}, + {file = "multidict-6.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6ed30be8918e18c8bed0a2e8b70639ecf02feb61ed00ca2e41cfcb2a50fa3f42"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:637f4ae36264bd7b8d9a60193acddc1d735ad52e8ed53a19931ea6d921fea8e5"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:35fc236507fb1b3138f0af5ecd5f94ed752d4d6d826248eae425f86204013eea"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e58952f04772f59f11c6e007471449809a30165188669bca8fdb19dde40a8f24"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d35a4f1c63f07fbb8c8f9946dea98b21eddf6c57421585f71d91864be3ba2a24"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b5f8771aaaed7f80e84a4e471d2f29ab6721e4595075e54d03ae1ed951b2000a"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:976fd7689d69ec78d67d31d38d396d8adb562f7e8368279f76aed4aa451fa06d"}, + {file = "multidict-6.9.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:95052e8777a86bae87c0bd0b5ab22d809e3d1d02bf69e3e66ddda5ba75a05805"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1a8adfcaf96f587ab138476eaddef95f29b8a2a8a9afbfea8d2fd62180995d02"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1a53de2772cfb74559df2eb4456ec4eeb908435ec55a84b69370d9d745d62aa8"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f2ce963299d42fa3f22a90adc0fdf174792ffef5ff4c7ffb68260548fb05580"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5b30ddf7234e611ca877575b62840e6af5977f92f1f9d532eedbb05a44ff8004"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:63ada7ee2e9345695f9e9bc4c65d72222253f07b1ac94fd0e37555cc6f3c7f60"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3c95601ed98fad3f6e2f8fe809c3b526b0fab31ef525e00a155e227f3d17f58a"}, + {file = "multidict-6.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c148e8b596000dd3e4bfe206e70f3e666be18d72032e0012555f2373c52e35d6"}, + {file = "multidict-6.9.1-cp312-cp312-win32.whl", hash = "sha256:f9dad513626a33670f17cddc6078e30e311f444c957e8dbfc5b2b4603c8b4edb"}, + {file = "multidict-6.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:a16a1dc8529f9e734a41c3b856f3eae7ebacdc061dde3f8a844e0c7889c97203"}, + {file = "multidict-6.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:361f7206cf341ba94fb015688f5c8b480f8e63bd58a4c14a48aeca7851a241cc"}, + {file = "multidict-6.9.1-cp313-cp313-android_24_x86_64.whl", hash = "sha256:d7bf9e43282d69561618e8a0ea33368d532ebef42f15c096f427090521dd74f3"}, + {file = "multidict-6.9.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:03d47df72f084f757c1cb771188d5f4e3a805e4abc4d67e32509272343ae9382"}, + {file = "multidict-6.9.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6bc94fe17c3c56e5418f79515b786b101845f70609b0d19d0c1ba13448e5633a"}, + {file = "multidict-6.9.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8f2973bbd2bebd9d2e0cd6394c1292a1a19ccd56bdcbe1e174059f1a39be5b40"}, + {file = "multidict-6.9.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:de7738b8c0bb74c4cc16bbd7fb49fc2bcf6430dba11b3432cd52768ae40933e8"}, + {file = "multidict-6.9.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e5ccad4b7bac125722f48d6f862bed3b514d8526deea06316bb72f152cd30a7c"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:a49ff5cdb33654cb7d6a3c377aa2a83ddefaa1db31eb10bcf3c180aa84f9af8a"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b22ff30006a2f28f8bff878fb93413cbe3a4d1fd517c28081d848c90e9cfd2c8"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3adf06c66041aa21eeb8a71e82379b74773298c8e6d3d839b151aae441a99b94"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:963a8d8f97057082679523d0fd4c53a38f86bc58cabe4556faef682ae53fa2fa"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b66ccc5c2cdd26e74fa5d4c29ffae424cc6148bf93ce574821783fb3b6d452c5"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7fd79c521f6290c69125fa2b85fa65d9e657e6a8ffaf722dc881b926bef4aa5c"}, + {file = "multidict-6.9.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1d804e4caf5d5da37d6dac1325da5629ebef1e27a294c2b568b295814aa36c7b"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bb0d664505f4b112f384cffeee82e91e3f6448d8e574989479db4439b68cba05"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:9e14d17773b1b3c758ff153659a1824608a0cb562c45f484b5ed8a433428444a"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:083735b7f395894e43adb278d5dae901448883a835ff8f1977e285fefdb10418"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b65121091567847a8cb520d364ab22ba90e00d3cc55fa9eb34bb439f0684bcd1"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:ea999ae6e80e66ad5eea287860951b033d0104ca34d6d87c7b5125ebe0e12721"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:095d900c242e00fbe5f321ee072e7278b4153e78c5ce9c1efde167d62c1e4771"}, + {file = "multidict-6.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6441cc837aea58be7d9baef1b2383eb8311ab9303f500f99ac90b584cd78bb14"}, + {file = "multidict-6.9.1-cp313-cp313-win32.whl", hash = "sha256:9c4880d017555d70dea367dd49271830842d48e3891c2da97da7ce8c4abcee40"}, + {file = "multidict-6.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:ac51cd64bae51c462ea58ad2492c9b8209667a4ef60c45c4a304518b67598d5d"}, + {file = "multidict-6.9.1-cp313-cp313-win_arm64.whl", hash = "sha256:37a9ebe00c698279213d56e6c64e1962ab1e092918270649b397cac3dc196ca4"}, + {file = "multidict-6.9.1-cp314-cp314-android_24_x86_64.whl", hash = "sha256:fc0dcb22fa9aeabfe3fa4e0430099acff985ec5d77a851382f76cc6146e780e5"}, + {file = "multidict-6.9.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:024123f0ab402ab33828e24eb80fa8f25167d0d3783ba5f287e39ed741e6abf9"}, + {file = "multidict-6.9.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:af1b5a92315048c3e36bbebfa7d4760a9c3e910bc4166f11b20d77d20d6bcfca"}, + {file = "multidict-6.9.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:b2483da477932ad1983d1d33c18bc3771c6fb00cfbaaed70a875fd547ef8e840"}, + {file = "multidict-6.9.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:db4d697b18b6ef5528b1f36bfa25072cd2a421869f5963bc0e92c8a34b9e2800"}, + {file = "multidict-6.9.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:854fd2f1bc6e8a56b89910b5cd7261a8b40f13ebb31572da985ce59c7da0886d"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:03731f6fc036180700c9dc2308205a48e5ca6f3ff03087739ab746f294022201"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:989261c5f1735a165f2e4e87cf6d5f17ab734fa18f9ad0383d5adfcdaefce701"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b4c9e5d05b126b267ac048a89a0e2d9b48b1b648add62d4872906304a8590610"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9d0a21cf76153de8f2d96a877991d6bc59b9ab5180b949e50db73cc193b4a694"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e7386aa18d98d6b8af44b92173654ec469237fda35f8e8523e43b581a86f476a"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b69651732c64afb691e50cdc3387cae305e0eeff8804fe3e3ce203876494932a"}, + {file = "multidict-6.9.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1fee9a16d88a1c4865610de31ef5c666671020d7a81d1f510eaf3c97d00ebeba"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7814bbee202acd3bd240204c17d8b87a4c48c81064fd8674dbe527d94d5a4290"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:95f273bea318a194f656527ee2ed19494327bc500b8e87d9358e3222579aa28d"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:73bcafa21a78d0776b3ee7cd2a63c66f968eb7db8e8d594e32d7329950f6e828"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:1a938761c77e0e6edb0c93d02f4e988d44a69e5195e5a3b893e5553311347132"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:37245ca4105386194dd1d292a6f2aae09bfe1bd7ac6f9ec25093e3cf8e9b143b"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f0700527dd5bfa8b7204b08330542f4f388899d3c14d885d8a368992e0eb562d"}, + {file = "multidict-6.9.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6b7e54fd883671d1a8810704851c044b7173287c552b9f5c3d9e0eb9f00ae194"}, + {file = "multidict-6.9.1-cp314-cp314-win32.whl", hash = "sha256:e81ae656b9935ac4528a71f96bb7a14d949778ed1897c573d3e7ebb9187f8841"}, + {file = "multidict-6.9.1-cp314-cp314-win_amd64.whl", hash = "sha256:acddcac38adc8342ba48aba98896faa7928854bebb62542362138655b5367ee3"}, + {file = "multidict-6.9.1-cp314-cp314-win_arm64.whl", hash = "sha256:32217133dddc58c927805cf6c0731d8144584176b768042ee886d51e71860bc9"}, + {file = "multidict-6.9.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0b2fb8c349d1103863750b5d8cb5ace766917f4b35f3d883c8f778853eaa9f76"}, + {file = "multidict-6.9.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:56d834b74c993a7d7cb2b8ab33a0d55c3e0d4a3d2f2da2808a4ad3d79189711b"}, + {file = "multidict-6.9.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:783ba7d845d79ce976afd9c1e91a4e5714671defa198ee789e8b23316083a485"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4d718fa1b5f0d0dd75e86fbbc5b0c93ea3a5d65216c85c61cd5d7cdddfe08455"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a313bad717dde740959d50850c315b75fd4eb0c5e6b4dc8535db0f1c369be125"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ef01d29fca550ab871fd99154f82c6472aacf8e7def272dfb07b460123850390"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0f3bd290711c6e9486173a6ee7cd4e7f00c3971c7908c1ec1b6e5437c5e4c6f9"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:81cdc537e0a42e3c0170752fcadbe450246d5c3b4b7231d6eb9672456605ac94"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8b193bf7a443c97d81c47052f60c486071a4bdef4a573fa2514f920089414d45"}, + {file = "multidict-6.9.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7a0c98f6a636adf0d7edd60c61589eaf52d149239af754d0bfeb0effedba53a8"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:6e6b7e3a1520c39a2772f414cd9ddf5995f77e4e823dfa1522af383addd465a3"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:ca65cced0d67a9039e93bcd98a369920e499bf98296844ff56ead01c9085321f"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:372c063f37480f62c1ae32dc3a1a0a5942b180c883f99789075a8a8ec3c4e709"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:827c92145b3b976b39430129c89d213b250dacbe5fce678e9a03940e6e848983"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:9b0124b9c17e9890f0819b2e7a5f65ec9a2f5aabd6c8e7ad090c1675cf70dee6"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:23136f5a564654eb61061ec6d5620a4c1ea32c8f552b65e9982a12b72bff601b"}, + {file = "multidict-6.9.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f2524ec55b3e65cbe235a8b3c36e2af3b635be02ed05e20c94e70c5c943c009e"}, + {file = "multidict-6.9.1-cp314-cp314t-win32.whl", hash = "sha256:35ba0263bae5dd3ad5aad767cc9afc01a8598c7dae30f1b3b2de98b1b32c28bd"}, + {file = "multidict-6.9.1-cp314-cp314t-win_amd64.whl", hash = "sha256:7c8d5882ba25ac0282258be435d8a05aa0cbcacfce15799154a338f847f159b9"}, + {file = "multidict-6.9.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ac348379cf4de5538a0a213be1532d289aa801ec5d267c5909446b9ea2f8e2c3"}, + {file = "multidict-6.9.1-cp315-cp315-android_24_x86_64.whl", hash = "sha256:f04551dce5a7db8c9659f2e4245494c182d0663b83661803e08d46bfcae5eda1"}, + {file = "multidict-6.9.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:c0c88085affd35c33e124e36930c5ad96aff9294ce195eaa0fd9cec962b64a82"}, + {file = "multidict-6.9.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:a8b75dd3d3638d9a19f23e84af4ffab3b8940422c0df2da2a77005ef5aa3d7ea"}, + {file = "multidict-6.9.1-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:006c4478de0a1876f4834e14255776286f09b9846b505fe63f67f9d173a9487c"}, + {file = "multidict-6.9.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:2784090c30a586d5b45197bd9c32f87fb927216cde302f6cfd76d76577e90f08"}, + {file = "multidict-6.9.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:7c708566da8014b120a64b1eb6d200c6c0c8cb36296383723cdb6fc82038270b"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:042fb0196047e786936a730bd302de83143950da45f2c16078da8f35e1cf7919"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a2212a0c842c723d919ea4a22a9296cb6b244b386e4e6ea92adfc7fbf3095519"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fd882aa29bf402b62bf1fd7c19fd5df4b6528cf468a908864b39368572b662a9"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c57541034d12b215ab0a2bfa371d1a8a198da18176d0426c27105b9161a6862d"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d73fed4e37158ff00cd271871170b79e40138db51e625fd352fa17c6acb34f67"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:79da2491348b30810728050b4a8ec0416f85884125c2fd44655b3d01150d9c3e"}, + {file = "multidict-6.9.1-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b4da208a63434d21a3df64d29758e650fc4aa8cb05848554b76949c296539cca"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:877ca17fdcfdf5c397493a71e5ff97a87bb181417fe717fdadc77c08c09301ac"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:40aec5299e1ed71fbb988389059da381c3c1a60e0c649acceb2a35d9b128848e"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:4a409ccc42aefec904038695d5d7fd6d8f3af2721b7b6401d55135ec7d6d298e"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:0a5769559e3312dd96731fbe15b4abb6033368ac1cad5a98dadd21946a4c7d6c"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:03fac50ddfd8302175b77863a015eccfae76767cda5506eef86df559ba861e1f"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:5ecace251ccfa705bf3d7d35c5032cf750f5c629809740405697bce5c118c4a4"}, + {file = "multidict-6.9.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:ecc89dbd4155b2f8a47f4bbd89242a35ed15e8e0ec581cab5ac65fa38407329d"}, + {file = "multidict-6.9.1-cp315-cp315-win32.whl", hash = "sha256:a3ffe881246d28a862f1985824f484cb7361f44d6b99c4c620436ef56462f38d"}, + {file = "multidict-6.9.1-cp315-cp315-win_amd64.whl", hash = "sha256:59c123d0e948d760a5f930f316cfefa07e8d632ab84327c0693ee6a88171154f"}, + {file = "multidict-6.9.1-cp315-cp315-win_arm64.whl", hash = "sha256:31199204b3ced121ff5407a2c342326a5d27e3870abbf94bd80dbd2451b7bc8f"}, + {file = "multidict-6.9.1-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8879510a76940670517ea1cb589978da44b86e286ec3e50d664ef330817afce7"}, + {file = "multidict-6.9.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:aec65b53a07f580606593f877eefbb29a45939bfc0d3fe6e6d9f42b41b749f68"}, + {file = "multidict-6.9.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:14c56f73e78faa1f68bbb826197cd5871994e70e841b8590829c35912ece5c64"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:38c9986f9ce50c459b10de216a05f4bd7ed5ac63887d56e500a52bb464b861ce"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:15db6a102cbaf1949cf028ecf080aac76d20bcd29ad4e092574db6c6b7af78a5"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:bd82c4977196681a499bb6ca9e462afbc5c91c1c15b6a991dfbd72733fea4dd2"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bb58ba73a3f96f9a3e46b1fab69929d7edbbddb3133ee74b5c3c54074a53c4f1"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c6eecfab7ce4cd9487ff8ba936fe38cdfd68c04faf3d5c710363c6a8e695659"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c62e71e6289d78c0108d8aeb495f8bd3cad4bc1632fedddc9297ddf287ecc20"}, + {file = "multidict-6.9.1-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:539c2cd5fed0947c135cd7eabaaac55f48300dfa1de0f3ca4edb5efa6606f471"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:3100d169ceb7bc8f05f89a6db11d1b21f119975fc26f29dc45a472e3569f0879"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:696477ad71385c4795e3b8e4cf10b0d2c28c2a1ca6a955e031cb1e62993e9ee3"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:f5844e7befc707367807586f550fa97e23dcfef0728f02b98c7bc498a961a5df"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:abc7c2e4b47bfe6a9aea434d3fdebb9597ee636e914e92ba352f2068b9142f4c"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:7ab379f95caee071a37cbd8be86d4c65accc651d391f9f97748fef006f38769c"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:557a4e1708df428ebe6c3081c83a273d275dad2446ce0d81fc648ac71afdb18d"}, + {file = "multidict-6.9.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:475d04d5192eba487a3e2f935976340baa24529046e9c1c9c7a3b7bf80445ae1"}, + {file = "multidict-6.9.1-cp315-cp315t-win32.whl", hash = "sha256:10083a8a0f4e1b26b599889e90b9802504ce5d3f7722f925bbb7ca47dd22a7c1"}, + {file = "multidict-6.9.1-cp315-cp315t-win_amd64.whl", hash = "sha256:e96ca64383efa107262ee3949f047af5ee4f1845ba09463466c04d35a83bd3ec"}, + {file = "multidict-6.9.1-cp315-cp315t-win_arm64.whl", hash = "sha256:501ed8b02a5990c67a91c732843609d43a6be1f7576fcdfc867331239f37fbd3"}, + {file = "multidict-6.9.1-py3-none-any.whl", hash = "sha256:7bf6478188f4e47bf5686e8a33da4ae28bf43b1b2528d9ee144d28492bfac60b"}, + {file = "multidict-6.9.1.tar.gz", hash = "sha256:0f06e60fa190aa7abd0914c2a766736fdc8e9f34878c4346338534b73d1b20e2"}, +] + +[[package]] +name = "opentelemetry-api" +version = "1.45.0" +description = "OpenTelemetry Python API" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "opentelemetry_api-1.45.0-py3-none-any.whl", hash = "sha256:80e068aba7cd56c8b58512d6a36f8d25cb1dfaa0c0a4cc1c938ccf9f362d9cb3"}, + {file = "opentelemetry_api-1.45.0.tar.gz", hash = "sha256:711ede81773c8025c2c03dac0450bc89f3d30aea6eabcc815c570d4e35a963f7"}, +] + +[package.dependencies] +typing-extensions = ">=4.5.0" + +[[package]] +name = "packaging" +version = "26.3" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c"}, + {file = "packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79"}, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, + {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["coverage", "pytest", "pytest-benchmark"] + +[[package]] +name = "propcache" +version = "0.5.4" +description = "Accelerated property cache" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "propcache-0.5.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b77c313314524ca9c38fbd70f73515d04597ac58c40c939bc0e71eeb4abff680"}, + {file = "propcache-0.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8f911c395cef73c510bac566da9507bb6a43e7763d0c79138dc60ee53f11207e"}, + {file = "propcache-0.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d83b12902eb8bce151259c86c03ba746600b2d994543de46e370cecf96c452f2"}, + {file = "propcache-0.5.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c9281e922c072158c91974d4589f1dbe0fee6d467f284c28e463f9f5a4d933f4"}, + {file = "propcache-0.5.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9f3551b8a35c1df3e7ea4d2d86edee15f0dde1bddd434a71744048683544d0ef"}, + {file = "propcache-0.5.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ec6a85f424afa8d23e0d9a094e5dbb6eda01da91c92b9183cd433768247ffc97"}, + {file = "propcache-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f574e460d1c8a08384a016fdb09ccf3543433263ed6b2f97104f979e64ea57c2"}, + {file = "propcache-0.5.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d8e017eeb7482bed34cdb0d61cf2bcfc88d104bbab296a17cd16a6af8aabc70e"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f273dcf7149a50527c4fd1f55cfe9eac0f60753f5af544b4c9352578e20c0874"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:fc2461ecc45f17893f8207e73b46ea8ba93e33630e51cf4af3fbc21d47462b1a"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:279655a16973f1ee2bd2fe79973137681642fd9ae0d89215bba263726eb0dc3a"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:e9f165403b81fea7e89c932d89046a1e3d9a3a60e8d7ef2f249dccdcb0982bf5"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:1783582065a1f07f9d9ee1e992e13f15d7dc8fb1eb3a7476d43eb3f2e69d26bb"}, + {file = "propcache-0.5.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3d605bb239b796e82a81c6709548b2bd460ab73b4590cb0c83de8a2dd9694d0f"}, + {file = "propcache-0.5.4-cp310-cp310-win32.whl", hash = "sha256:141fdbd73748db0cf7636035030aaac383d2efde8f34e7bc24594cc776d225b8"}, + {file = "propcache-0.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:146f48a9e4812611a7581003b1a39de56c34967046310c4171a68ef908c9a745"}, + {file = "propcache-0.5.4-cp310-cp310-win_arm64.whl", hash = "sha256:6c7599df2b57ebeea8de011b5f2f7b85de95e76037d43d34b95e328430275487"}, + {file = "propcache-0.5.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:897d1ddf6716e8f47200f7aad9a0efa6cc7586df66c6defa572f9eab379c078e"}, + {file = "propcache-0.5.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9cbfff4423eef4cc6cafc021469641a2b835f610b2647a6c5281903e21b8670d"}, + {file = "propcache-0.5.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3fc24f209c1b7f7f688b66b98293954f5504279760999b58920ee12dd8471c1d"}, + {file = "propcache-0.5.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:62530ca89187827e4a4fe733f971abe81a7542eeea48ff61995f19b64d7199c8"}, + {file = "propcache-0.5.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:56fc3f7599528db40b1efa0889a620116e2704144495273d66066e8164e45838"}, + {file = "propcache-0.5.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4f2d880ff60f45898f4acfa152aac8d04e3ee627d90ff4003491bf92239d5757"}, + {file = "propcache-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6e9368e87a3efc285e559131092c5db643eb8e56de4ee42064d5baec22ef2bb5"}, + {file = "propcache-0.5.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:004e685b315646c410771836e72a44f143bbe624f29653a42687815069a303d5"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:594eb4c6ec35e7179b058481f4e9f02521b56de16fa577c4b85c76fb1bf8a9f8"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:2dba2f02d2d5c09ef8a0e6c1a42aeaa451f4be9898cb00b04fe98717da2eb23b"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c3ef2818d63bc86071e9d2989ae75a1bc32b8f7059cfd9f5abbbee70c32e2ed6"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:dd2ac8f5b643454c2cc6b6118b13da16e88f4a6434fc3ba61aca384029f04f36"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:4054acf80d40456a0537f2913b349718649d8d6458a14ab7f48d0ce28c30869d"}, + {file = "propcache-0.5.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:40e94adb1e7d39ff28a8bd8d8b8fbd1df6b9f40976dbe379134f1ce058e532dd"}, + {file = "propcache-0.5.4-cp311-cp311-win32.whl", hash = "sha256:9f86f7259efe2c951f43e57d471c9b41daa5bfc7db9f67189059cf1ae6d77fd9"}, + {file = "propcache-0.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:e904d4d01f36bd6e197590be1533c44e06058771e0746dd073a8ebb3ef880858"}, + {file = "propcache-0.5.4-cp311-cp311-win_arm64.whl", hash = "sha256:d42a9a856a4a6e2f6c10f1318c07e7daa498d6593abe745c71dae4521a26ca39"}, + {file = "propcache-0.5.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b28f41fa3b8c6900457f858ec5b03998f3a6d535fbc1bb2edec5961ea05ec429"}, + {file = "propcache-0.5.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:dcbf346a318a5e30063f547630b02bb787ce2f45b6368d5da143660b6a3835d8"}, + {file = "propcache-0.5.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:87a3caecf8095e48dc72f84bfa42e23a848cf410cc9cc13031fba4869b706a21"}, + {file = "propcache-0.5.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:60a64cbccaa11b7760ce705a14ada17ba459e7ca9f23ba587eb013821032d7ef"}, + {file = "propcache-0.5.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a74bfa37147cc08fb29df10bd9c16f40fa7f860cd3a6d2fff853323a94f6e17f"}, + {file = "propcache-0.5.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a4d7a54719b67338a305dca2ce6aafe366817df94ddfd4b5514374356f5ca546"}, + {file = "propcache-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2814ecd8e818f487bee4b0f921bc4d1c176cc5fc71ac0f072d0fa67eda4ac14b"}, + {file = "propcache-0.5.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6af4693716bfb03f1752ef1b30faa593db2c01d5272e9b8564a1549452a979ab"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4fbc1a15dc8cd1689508758d626b372b1f09d28d9577667feaf9e6bfcd8efcbc"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:cdee8205a44d0be91bbac4c41b95d86641b72dfc7aef1279400e4fda3f26a937"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:9a2a8a50a93dee0268a860a07fa3b4bd968f8ce4dbd794957da772f395368526"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:7ffafcbfc7b549ab940047e505c831eabac5e67de53e1bc174adbc5285c55944"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:d1f5a500bfcbb2c0ab85e98a0dcd70f5899d34efe365a0187700369a79603031"}, + {file = "propcache-0.5.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8a235f73d6e020855dc29dff012d920c02ee0feab8d73a24185a7569f4be1161"}, + {file = "propcache-0.5.4-cp312-cp312-win32.whl", hash = "sha256:b3083bfe87f95c756e610bd8025f26cbd1cd4aaa03a422f2d65efb7a97cd53d8"}, + {file = "propcache-0.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:98914de2c4d7f0f9f4a8c6ea4bf05841f4175796941e3ef7d47eb718f22311fb"}, + {file = "propcache-0.5.4-cp312-cp312-win_arm64.whl", hash = "sha256:8876b39961e33d912afe3c1bee18ee564fdad0206f873cc15d522756b7f50737"}, + {file = "propcache-0.5.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:36c0d9db44b523ef93d03341b1c42d69ff01d673c053d1b1c6c3a363bcaa39ba"}, + {file = "propcache-0.5.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1d52a05dc417279f7e5c7618c5dfbbc29923aaf9bc0a5c1802ddcebf54c61a0"}, + {file = "propcache-0.5.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:44149f46500a0a41b95b4d99c2e586a77319539730607b9892974a092788b111"}, + {file = "propcache-0.5.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dbab5f5ff6897c81f355d079010cdae85b02e5a0b518b5251523b8ad8ae9ac3c"}, + {file = "propcache-0.5.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c3e98c55bde2bcf7db3c70d1aed7ae9aa8aebbf19a250c66645cde44cdb8b867"}, + {file = "propcache-0.5.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:db3ae52ccc150dbc84704e9d642743897f3e1c54742ff34cacb661e52e3818a9"}, + {file = "propcache-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f85915e00dcb1cd9f2f890ead064ed40a27df06f0db65be427b29482ae357572"}, + {file = "propcache-0.5.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c2ba30a89035b57b73e00475de948521602f543d79ce01db10b04b36c4c76fc8"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ae58f361bd5dae942717c65d3413b478c70aea9c462599e7b9adad3731db3894"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:96f7c5c15656040ddcbc51e56dc59b58aa25999d743c126abd425b9766ab43e9"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:7cc528e760a8af06f2b13e9b9f362cd90c7c718ea61228a96dbd31ba16ed7f47"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:425f8cc86ab5018b4b8d4a23bc8e74d964bd3d757c3702e301aa79be76c53f6c"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a5793c7698a53f56f4a1889a4737c7eeb1b7ad0842fa6b1abca22913ff79c8c1"}, + {file = "propcache-0.5.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c02c0e570c5c7e077b0181a9f3cdb7d4c3617d1cda6b5c95bd5d34022923d82c"}, + {file = "propcache-0.5.4-cp313-cp313-win32.whl", hash = "sha256:3e413d7a4a9b4866b7a761d6060d434b64d23cd35122eda3b026a0bbe8196b25"}, + {file = "propcache-0.5.4-cp313-cp313-win_amd64.whl", hash = "sha256:0c889f6fa84957bc7e8b4eab71fd16a0455068d5045e3aa40c733071d2b2fd77"}, + {file = "propcache-0.5.4-cp313-cp313-win_arm64.whl", hash = "sha256:69fc35c0779522da366c563e5faf203ffc1f8ff0021d5b1337fa4efa5be73177"}, + {file = "propcache-0.5.4-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:e6720ba44ad7e72174314d0e1fb0172494cff5c73a3a8a2159c3d2402ff15565"}, + {file = "propcache-0.5.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:4cfe0a92ae30151869e67a4b5f5e105e4e03ad30b3f38e5211b5bf77d0881993"}, + {file = "propcache-0.5.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d759d05634f1b038fb625a66662a8c85e5a8fec912da381b5149ddac107482b"}, + {file = "propcache-0.5.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:251c63dd46a0659bb875cb254dc4c1e79ee91a847c737cd62373295afc2235dc"}, + {file = "propcache-0.5.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7a8d5ff04eb1f85698a78d20c62a14676e7b960dcafde09a388d60ad377d355d"}, + {file = "propcache-0.5.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b9100a93b372418d8688f3f2a3e5b45c64d70ca4d6176e121aca1e3bfc1e32f"}, + {file = "propcache-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cc07876cfb079b6f6f36d21ce75784ad6c2c6b563eeac0ed26c2fa2669b85df9"}, + {file = "propcache-0.5.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0951315a6b3142ee2167404d707743f0157c110091342b1aa0accac5cf0e4acf"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:bee7d3aed13d56f54e681df38c3a23031bc9e3863f687d9d598825c9146acd7d"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:4e985382be6d15da8d0c2710a6fa7b9070fc9ecdeefb7f580e88373984ec8be3"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:9e9ab13760aa8b6d0881ae7cb04fd891d8d490cd2554ea8e79bb278399169bcc"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:1b2f3bec4261a94019575481c726c29850f72e27907773c75b1de421e20e9f9d"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:720cf832eb2d0b0dfee129cb3335a26f6ce3cc45ee1187e8f0731758caa16792"}, + {file = "propcache-0.5.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9fb0a5be8d9aa213150e8d8148a42aca4984b285bcad1e69587dc4298edd929b"}, + {file = "propcache-0.5.4-cp314-cp314-win32.whl", hash = "sha256:30cc1cebaf9aef49db06357a50398323ae04d70460c0491837d026ab7d6452ea"}, + {file = "propcache-0.5.4-cp314-cp314-win_amd64.whl", hash = "sha256:0a095db8e15a6020db149ecbed6461939fe74f6acaa3ae8b702a1fe8c38cd983"}, + {file = "propcache-0.5.4-cp314-cp314-win_arm64.whl", hash = "sha256:45488d1a5f9ab5bd90aaa1ca20f50fe1922b8ffad71a2009d2adf41355897aac"}, + {file = "propcache-0.5.4-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:53eaa697c4d0422ff4cb714d00231b43352064d97b944033b30c1d57cc506ec0"}, + {file = "propcache-0.5.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:886b59c4d28ca97dd23b025fdfc50a0356be934efbbbca89ad26230067f86fe5"}, + {file = "propcache-0.5.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3fa15757fea1dfcd5b7745cad9f4638929605531bd4018ab2adff7955f1a403d"}, + {file = "propcache-0.5.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6f0093ac3e9daada202c2082439d414a625c57184727a46e112a3fb2a81cb788"}, + {file = "propcache-0.5.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3cd3a7edb6b95b9b33998135ebfa18d709da82290fb8f27c858970b5a12c8b56"}, + {file = "propcache-0.5.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c174bfd1c48a1b51a3078e95586dde718374bac79719ab3541ec9e74aec40574"}, + {file = "propcache-0.5.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a219f0ac59817a9114dd2aa57c13180f993e819ba658c7ddab4b66ed1ee0d370"}, + {file = "propcache-0.5.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:17a7400cec0256f0a71ae71f9da398f9894c956ff6668a1c9d317b3367316320"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:978f28401afbc76cdc3df9e1717b4229a06b626a1dcc75db4e1f2beb3884c3e9"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:4a1f4f5ffa55dce6307631f3cb2948e117e665966ea512e0d502b16c24f567e7"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:213bb68d9ced5cf2bf717b1071bf2b09b4b04c426256f9fe6d054c60318424c4"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:286867fb156488c251a3721766e380ac4495e4fd6b51aaa1403d89ce7f4359d9"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:445ee3bfb46e85838387fb3c536a73cc0b994dc192b004e40e170adc54aa2a7e"}, + {file = "propcache-0.5.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:48cb48c5346a97de792254af77715aa2529c2a1ebc5f586aa0aae44a02f1fe57"}, + {file = "propcache-0.5.4-cp314-cp314t-win32.whl", hash = "sha256:03b229037d25b801e7af53fd52b9fc49d9439b036fca1e087e02780631adfa97"}, + {file = "propcache-0.5.4-cp314-cp314t-win_amd64.whl", hash = "sha256:8a1fc236528c457cd739c88abe823da851b7ab645d72792f88658114cc340c12"}, + {file = "propcache-0.5.4-cp314-cp314t-win_arm64.whl", hash = "sha256:135036c5cfc93864affb0f9af9a27e5d7a71cb7bd745e7b6dbfc2d56cc30e827"}, + {file = "propcache-0.5.4-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:45bf2e730ab8905d0527fe05a86500f406e64305c34cc81ebe64b4617cab9760"}, + {file = "propcache-0.5.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:31eb43ba2edc704ab2ec27815315dd8a19def0fb16215be4cfe8d32fe78ffd51"}, + {file = "propcache-0.5.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:174507f82d3594622acb1dd2dafecf2d899d6d506335494e7107767bf05f3aae"}, + {file = "propcache-0.5.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:50e337653721d20ead710da33bf44487fbe8a0db8782714b60306481e9f95b51"}, + {file = "propcache-0.5.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0d21d0d2c82bbfeb1677a9711f38df968f9837576102bb4add1bd449d28d88f1"}, + {file = "propcache-0.5.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ccf4f7a79e26bb7efb06ecd50c177833b71df05cbc748701372325e6bcc17f6f"}, + {file = "propcache-0.5.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23278f808cd81d5ada7184a76606b925fb3389c60e1077b2cd7da7b1fcf0553c"}, + {file = "propcache-0.5.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e738ab81179510ce79b2eac9a6ecf47feffd9e76d1c72e403005dddb6e36c06c"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:a419ee85e654927baabda3929c03c0cc1112bf472ff0dfd6142f4e3a81ca4162"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:b61805357d966680acf68b3b6d49772631ed9df44ebece10ff1460e117a7da8a"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:58134228927cee6c047d626c08e60a81be604a20578a12ce752cc5c9a84d4826"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:350b272b2279f4135a64fc0c304a5d08e28a137c9573442c606152446638a831"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:45bebbe252550fec975ba3b62bc6f931643cfd3b5464ef47619cf3fef154e01c"}, + {file = "propcache-0.5.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:ada748108a43d29b7c328ba7db3755327cd94f028bcc1a7ee3f0addcfacd9c38"}, + {file = "propcache-0.5.4-cp315-cp315-win32.whl", hash = "sha256:ee19113bce2f3acd46432050688b70f61acd6857d75abb9ec96341b7e9ced123"}, + {file = "propcache-0.5.4-cp315-cp315-win_amd64.whl", hash = "sha256:ceb3e879afac028f93d272c957814695dc5569e4904262dbee92f6c41bd5e4a3"}, + {file = "propcache-0.5.4-cp315-cp315-win_arm64.whl", hash = "sha256:c83acbce9f2b5e3f5f5eda9e53d2001fed22fcdfef81274a9e02d8fd53b70a30"}, + {file = "propcache-0.5.4-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:a5e8ef588c109725dc713ba69aadcac00a1ef90c2ce9c0a8c7075128f569f47f"}, + {file = "propcache-0.5.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:4d86476a935c88963d9b8e1a9a0d38188790e9622169bfbafa173046846709d3"}, + {file = "propcache-0.5.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:f5470694918830da62fac9e69133b53d23b736d7070e587b27a4a2be37e08e68"}, + {file = "propcache-0.5.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10ef33a68a61ce317e095fd2e202a592ea92392b90944a78c993f0d9a73ab06c"}, + {file = "propcache-0.5.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5cacf3c9efd09df409dc33654dd077e1c245ba8fb747b0f0236ef41b7c49b589"}, + {file = "propcache-0.5.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:770e8209d018175fc0063936fa9583b6d27e88c5ad31543f3383d66080efdd62"}, + {file = "propcache-0.5.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:03969626faf0783a592dfa17e28eac06018bd0b44dafae6943d53b92421a7f72"}, + {file = "propcache-0.5.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ef3b928d9c984322b5c44e6964d8dbc653da87d2d8ee1647fa6da43072e650a9"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:7177c43eddf10a0893c4fec52ebb408fdcd7f7d63962caace9180d8f81b14ece"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:420162a77f94eb1cf5ef7893f500016dabd548e73de956785a1dd899cc73006a"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:3eb2e820e8e2101407da93f17c57cbb7d225461955fc60105daaba14cd421ee2"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:13e52b6e0bde97dee98ab66552dbff2931649c96f1ac432eac299fe689ec373b"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:12682126712ddc19b70ff819debbd279e58adf1f0c8f8f8138c18ade2044b284"}, + {file = "propcache-0.5.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:3af0c8642b2da4815d86e631232ac8286e17644fad907c19508aa8e7cb4ba8ad"}, + {file = "propcache-0.5.4-cp315-cp315t-win32.whl", hash = "sha256:1df8d8561b21465c5dd56110a01caf897e026d065b4b84e98a488209094272ec"}, + {file = "propcache-0.5.4-cp315-cp315t-win_amd64.whl", hash = "sha256:02c0a34f16889cf800f10f0247a564d8ce6eeab6ffcd7c87198f769067eb8432"}, + {file = "propcache-0.5.4-cp315-cp315t-win_arm64.whl", hash = "sha256:dc4242ca653c9b30ab51c5f8193323e7bc0928f897ee9103201e59a43abcb72e"}, + {file = "propcache-0.5.4-py3-none-any.whl", hash = "sha256:62c60aec739ed00124573cce1178138fd690c7676352d67a37328c1cf51d7468"}, + {file = "propcache-0.5.4.tar.gz", hash = "sha256:ff6b113f50bc066a698db5d944d2c6dc7507168dd3341e255a8892fd0715a558"}, +] + +[[package]] +name = "pycparser" +version = "3.0" +description = "C parser in Python" +optional = false +python-versions = ">=3.10" +groups = ["main"] +markers = "implementation_name != \"PyPy\"" +files = [ + {file = "pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992"}, + {file = "pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29"}, +] + +[[package]] +name = "pydantic" +version = "2.13.5" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73"}, + {file = "pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.46.5" +typing-extensions = ">=4.14.1" +typing-inspection = ">=0.4.2" + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] + +[[package]] +name = "pydantic-core" +version = "2.46.5" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "pydantic_core-2.46.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:657b40d6240c0a7b6a64b30f22d1e3aa631c7e846c621b0c0f6d1d75e2e15ea6"}, + {file = "pydantic_core-2.46.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ecb42011e12ee19cafbc312887cbf3546959fe02fbad44f272d4be5baa997615"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4dedce55295becb61921e386b99d4f2706045306e7fa52249a33004c837379fb"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9f47b8a949e60f027f0aa0a6f6c7b7e9c55cbf4380d10b344e282fa4e7ab1e1b"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:200aa3dc9f8d54f0754f43247c0bad0999fdcfbfd2488384dd44f37279271fe6"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6d30e1a4f138b8951063e9a394752a9179b51da288ffa507b1e659222f4c1793"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:850a08d167dde16db8702c274f320c7be9d7da6f6dff2b58b18f9e815bd94f5b"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:c3471e5c4a949c26ec00a77f01df59096aa9495877de76fd60a980f8ee6be461"}, + {file = "pydantic_core-2.46.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3a3e26b6a8274211bddee2d0e4d0d42778f17a34510f49d2ec44b58abfc41736"}, + {file = "pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:fc5d783bd4a2387e97b8a2d5ec781cfb92b3d893bf82370548e99db5915935d3"}, + {file = "pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:356c8368cbc321050b169595683a2e1d63413b1e0e2868b330af9fc14c616d3f"}, + {file = "pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:eb7d8d0e5886a89a55d2eef490e272fa965a9d57c6b29a5b5088a7997ec2cad1"}, + {file = "pydantic_core-2.46.5-cp310-cp310-win32.whl", hash = "sha256:4d44cf99ddebf875f9b68cc267aa684c99b7b44fe63ee1cac4ec163807290069"}, + {file = "pydantic_core-2.46.5-cp310-cp310-win_amd64.whl", hash = "sha256:1e5aad1220a1192c42341c8fd4a8686657e73ab2a920c970bdc4de334fe3193d"}, + {file = "pydantic_core-2.46.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f"}, + {file = "pydantic_core-2.46.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee"}, + {file = "pydantic_core-2.46.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e"}, + {file = "pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2"}, + {file = "pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689"}, + {file = "pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec"}, + {file = "pydantic_core-2.46.5-cp311-cp311-win32.whl", hash = "sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129"}, + {file = "pydantic_core-2.46.5-cp311-cp311-win_amd64.whl", hash = "sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c"}, + {file = "pydantic_core-2.46.5-cp311-cp311-win_arm64.whl", hash = "sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8"}, + {file = "pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d"}, + {file = "pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869"}, + {file = "pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5"}, + {file = "pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3"}, + {file = "pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b"}, + {file = "pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0"}, + {file = "pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b"}, + {file = "pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8"}, + {file = "pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084"}, + {file = "pydantic_core-2.46.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:b7ca9034437b6022f941f4857459562ee00a560b97e7cce8a0ec5a74fc6766e0"}, + {file = "pydantic_core-2.46.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f332f0e72a5a0400141f830744e141bf9f97917878dbe968669e8a7fefea78ff"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:193375f3548919d3f0b60936ca113ada3e38f264f91b9b8e0508efaad57be931"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:79bdfa52f843137045b2d081cc05c120ba6665d29b7559c2c47690906f39279f"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:24922243639cbdac66c75fcb6fd6495a9cb52b213d62f9a0d16f0310b1ff8038"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c76fe65e607be28c7fd4d56fc3c42b1583aa058ce3408b7ad0fd540171d31f9f"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f7b393a8b3da82f5c1fc0751e6d01ac6c55b93c18226a60bdfba4a724efafd1"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:7ac031912d54f3d83ef3b3eb98dfabc1608802e2202263d25957eeed40b94761"}, + {file = "pydantic_core-2.46.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:837b396ca3d7b74091ca623f6cbd8351bd42d670a79c2683e79fb089f06a2de5"}, + {file = "pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:5ee239d575f80b08eca11f6e20f90c4c695de7825c67eefe6091fbf20dda648e"}, + {file = "pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:e80675d75ae2cd14372cb65cad5400d9347a3d3f6c13000183f22dfd027283ed"}, + {file = "pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:9c4b71f10dd532fb7a5cbc8f58707779e64f03a258c2bf8bfbaecfcd9970b519"}, + {file = "pydantic_core-2.46.5-cp313-cp313-win32.whl", hash = "sha256:97bf8de4d541598c94a59344eeb988a94c08ff76b5723c41f6567ec18c7892ea"}, + {file = "pydantic_core-2.46.5-cp313-cp313-win_amd64.whl", hash = "sha256:15f4a94963c95accac15b7b657bb177d3ad82bb90b0d0526d9a9b85079925db5"}, + {file = "pydantic_core-2.46.5-cp313-cp313-win_arm64.whl", hash = "sha256:d22a945598fb91236b4dd793a6e42e4f3dd7740bb5aace5ebd7d4c08d13bb575"}, + {file = "pydantic_core-2.46.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c1c43ad4339643d70ebb8124e1305a7dab423001eff58bb41a0f731adbc98355"}, + {file = "pydantic_core-2.46.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1a353f84de772f423b5ffb11d7ae352fbbef0f446f3c0b0af0f8236d7233606e"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5086029a57366b8cf81b130a43908738095c270c21a8d7f0e8bdfdb89718e2f3"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46c25dda9d092a06c08db76ffe0a197107904d0dfac653f7d5306bbcd6d6119c"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:37ea7b83c935e5b0d68c9449b82651accf78a10828b2c02b2f2d9e9496446c21"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e64e88d5585bea9ce95861079de72006c7fa6d3df4e3a3b65ba31eb979c15c9f"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d510bac3ee52247af28ed4bb18a1e799f040ac60fd2bf5ccd4c92f1fbe786f"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:a2a5e1d0ff29adddc9f6d6821a66302e4493f8ca898b715b6b1182c2c201ea0a"}, + {file = "pydantic_core-2.46.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03b9666e41e35d8909852ba191a0607520f81b74eaf12ccf8737005dbb313821"}, + {file = "pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:a91c17edf6eea2402cb5457b4c89e99bc5ed1004aa34c4adf1d4258c1a5c22c2"}, + {file = "pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b49924c73a235e969511bf2aabdff3beebf9820931f646c80274d5d780010c47"}, + {file = "pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:2cbd9a5eff05e51c447c34dfa4632145b26b09120cf04bd0c871e44c1a5e1c9a"}, + {file = "pydantic_core-2.46.5-cp314-cp314-win32.whl", hash = "sha256:2d5d76654becf5efd62c9e51c3756c67b49498b0c9a40884934c40807adbd074"}, + {file = "pydantic_core-2.46.5-cp314-cp314-win_amd64.whl", hash = "sha256:fa10ef4112775900e7a0661068635eb67b2ab824fbde764de6e0e21982a93db0"}, + {file = "pydantic_core-2.46.5-cp314-cp314-win_arm64.whl", hash = "sha256:045ab3b6d308439e32b81cc173bba5b9018bc6ed896afd0c65b3b009b1699af5"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8816f3d218beb4b787de5c9759c259b8fa61f9dec42dc7811f320a33771778b7"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:bce57638e08ac148e5778cce7feb968307a727d66f8e2274a543d0cf0c9ad6a3"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:976e1128455aa595ea04c79ccfedff1aaeab96ee013fcc916bed120c4f0ad94f"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b891faeedeafba41b2983e5001a81b6a915b69544c7e7570d1989ce1c36ac7"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f194189415698233dd1114a093a9b56e61e2c57e11b469be3b0506f46f0771c"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82a36973cf8a2ef5406f4fe2edbf8ed0c99629535d959e0b100c76a32535a111"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdbb78909f52b981d3b2d56b97328d71eb0b974c36bd77c920123a7ebb192829"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:52e24eacdb536cade636aa90fb851835222becff8484b7001fdc78cb0290f2aa"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:37ae34309d7bd8c0d61ab839668058f2a7962ea1fc51d105d2db228fe0618034"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:0cdbada856a1c69a7624a64d3d9aefe79300bd6ef827b43a4f265010b9b55184"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:545f26c504b27c3758439a5e6d9349931f0a04f855668d5fe323c89e82300a38"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:ff218293c9c806138dca139765e3b067621be52bcd93cdc14c7711be7ddc90a9"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-win32.whl", hash = "sha256:97cf3eb53a8cccacf9d46686a0926186c9bfb5574f2ed66d3639d5fe117cd3a9"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-win_amd64.whl", hash = "sha256:d2f9fc07a8042a8f95925b35c4f04f469707c981fc33245b6ca187cf5d2dd290"}, + {file = "pydantic_core-2.46.5-cp314-cp314t-win_arm64.whl", hash = "sha256:acf8a67ba51f4ca9ddbd0e6b3000a65ac51ab734661778b3e7ba64d99a710f2f"}, + {file = "pydantic_core-2.46.5-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c583b927a8838dab890706a6fa7573fbb8b70e24000ef9f7238e2d6f6435a5ed"}, + {file = "pydantic_core-2.46.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cdc8b74ecc48c0cb1e9607a05ec4e9e88db60a19ffcc9a1d5f9088ede40c8dc0"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b10e3e8fd7ddc2bd915848a2768e44c15b22936f1cc54c462ad1164deb02655"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f077d0b97ab11fa7dcc633fca53515f290bca8a8a633e966d5b6d1879d9ed01a"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b0fc826b16c55e561e5d2a0c5c77b051ba1d92808118c4e4b5390f5e0cf191d"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ef3fbbf161dc9351a2fe0422e51b129f9e97e42385bd0320b309c15f7d287dd8"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:978e7b97d4824b5be09c69fb70507cbde3b0323fc147332ca40a94d9a6a0ebbf"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_31_riscv64.whl", hash = "sha256:9b68938dd5b0c783d88ff8e2dcc69451b5eb936fe212d516b21b9d5567f6d464"}, + {file = "pydantic_core-2.46.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:771cf63ae0b1b50dd22e5f3e3549fab5f3f4ff1635d352a9e1a97fe01c7b2e64"}, + {file = "pydantic_core-2.46.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7c6be839a5a8312626b32029a415644a0846b420bc8b52b95b28cd92da162168"}, + {file = "pydantic_core-2.46.5-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:895395f8918627b04efb1ad2a4cf605387143300ba03304cd1dfa6d03f5e095e"}, + {file = "pydantic_core-2.46.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:fc8515076c11f3cfdf4fb142dcca0fe384b1230a3b5415458ac84f3e0903ec13"}, + {file = "pydantic_core-2.46.5-cp39-cp39-win32.whl", hash = "sha256:3d2652072b2d774947ba5cf78a9e59644ac62ee572daf6dd2e1dfe905e15b2b7"}, + {file = "pydantic_core-2.46.5-cp39-cp39-win_amd64.whl", hash = "sha256:3aa166e99c4f2985407fb8714aebede877ecb5455cf321b606adca926d30d5a0"}, + {file = "pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2"}, + {file = "pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c"}, + {file = "pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47"}, + {file = "pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a"}, + {file = "pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942"}, + {file = "pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f"}, + {file = "pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433"}, + {file = "pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda"}, + {file = "pydantic_core-2.46.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266"}, + {file = "pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc"}, +] + +[package.dependencies] +typing-extensions = ">=4.14.1" + +[[package]] +name = "pygments" +version = "2.21.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9"}, + {file = "pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pytest" +version = "9.1.1" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c"}, + {file = "pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313"}, +] + +[package.dependencies] +colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} +iniconfig = ">=1.0.1" +packaging = ">=22" +pluggy = ">=1.5,<2" +pygments = ">=2.7.2" + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "python-multipart" +version = "0.0.18" +description = "A streaming multipart parser for Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "python_multipart-0.0.18-py3-none-any.whl", hash = "sha256:efe91480f485f6a361427a541db4796f9e1591afc0fb8e7a4ba06bfbc6708996"}, + {file = "python_multipart-0.0.18.tar.gz", hash = "sha256:7a68db60c8bfb82e460637fa4750727b45af1d5e2ed215593f917f64694d34fe"}, +] + +[[package]] +name = "redis" +version = "6.4.0" +description = "Python client for Redis database and key-value store" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "redis-6.4.0-py3-none-any.whl", hash = "sha256:f0544fa9604264e9464cdf4814e7d4830f74b165d52f2a330a760a88dd248b7f"}, + {file = "redis-6.4.0.tar.gz", hash = "sha256:b01bc7282b8444e28ec36b261df5375183bb47a07eb9c603f284e89cbc5ef010"}, +] + +[package.extras] +hiredis = ["hiredis (>=3.2.0)"] +jwt = ["pyjwt (>=2.9.0)"] +ocsp = ["cryptography (>=36.0.1)", "pyopenssl (>=20.0.1)", "requests (>=2.31.0)"] + +[[package]] +name = "s3transfer" +version = "0.11.3" +description = "An Amazon S3 Transfer Manager" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "s3transfer-0.11.3-py3-none-any.whl", hash = "sha256:ca855bdeb885174b5ffa95b9913622459d4ad8e331fc98eb01e6d5eb6a30655d"}, + {file = "s3transfer-0.11.3.tar.gz", hash = "sha256:edae4977e3a122445660c7c114bba949f9d191bae3b34a096f18a1c8c354527a"}, +] + +[package.dependencies] +botocore = ">=1.36.0,<2.0a.0" + +[package.extras] +crt = ["botocore[crt] (>=1.36.0,<2.0a.0)"] + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "starlette" +version = "1.7.0" +description = "The little ASGI library that shines." +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "starlette-1.7.0-py3-none-any.whl", hash = "sha256:67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e"}, + {file = "starlette-1.7.0.tar.gz", hash = "sha256:c79f74ea63cff761804fbbfb182f1e0b440c2d07b164d24700c5a1bab5d6ff5d"}, +] + +[package.dependencies] +anyio = ">=4.0.0,<5" +typing-extensions = {version = ">=4.10.0", markers = "python_version < \"3.13\""} + +[package.extras] +full = ["httpx (>=0.27.0,<0.29.0)", "httpx2 (>=2.0.0)", "itsdangerous", "jinja2", "opentelemetry-api", "python-multipart (>=0.0.18)", "pyyaml"] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +description = "Backported and Experimental Type Hints for Python 3.9+" +optional = false +python-versions = ">=3.9" +groups = ["main", "dev"] +files = [ + {file = "typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8"}, + {file = "typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5"}, +] + +[[package]] +name = "typing-inspection" +version = "0.4.4" +description = "Runtime typing introspection tools" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147"}, + {file = "typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47"}, +] + +[package.dependencies] +typing-extensions = ">=4.15.0" + +[[package]] +name = "urllib3" +version = "2.8.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "urllib3-2.8.0-py3-none-any.whl", hash = "sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3"}, + {file = "urllib3-2.8.0.tar.gz", hash = "sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63"}, +] + +[package.extras] +brotli = ["brotli (>=1.2.0) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=1.2.0.0) ; platform_python_implementation != \"CPython\""] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] + +[[package]] +name = "uvicorn" +version = "0.54.0" +description = "The lightning-fast ASGI server." +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "uvicorn-0.54.0-py3-none-any.whl", hash = "sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf"}, + {file = "uvicorn-0.54.0.tar.gz", hash = "sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620"}, +] + +[package.dependencies] +click = ">=7.0" +h11 = ">=0.8" + +[package.extras] +standard = ["httptools (>=0.8.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.20)", "websockets (>=13.0)"] + +[[package]] +name = "win32-setctime" +version = "1.2.0" +description = "A small Python utility to set file creation time on Windows" +optional = false +python-versions = ">=3.5" +groups = ["main"] +markers = "sys_platform == \"win32\"" +files = [ + {file = "win32_setctime-1.2.0-py3-none-any.whl", hash = "sha256:95d644c4e708aba81dc3704a116d8cbc974d70b3bdb8be1d150e36be6e9d1390"}, + {file = "win32_setctime-1.2.0.tar.gz", hash = "sha256:ae1fdf948f5640aae05c511ade119313fb6a30d7eabe25fef9764dca5873c4c0"}, +] + +[package.extras] +dev = ["black (>=19.3b0) ; python_version >= \"3.6\"", "pytest (>=4.6.2)"] + +[[package]] +name = "wrapt" +version = "1.17.3" +description = "Module for decorators, wrappers and monkey patching." +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "wrapt-1.17.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:88bbae4d40d5a46142e70d58bf664a89b6b4befaea7b2ecc14e03cedb8e06c04"}, + {file = "wrapt-1.17.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6b13af258d6a9ad602d57d889f83b9d5543acd471eee12eb51f5b01f8eb1bc2"}, + {file = "wrapt-1.17.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd341868a4b6714a5962c1af0bd44f7c404ef78720c7de4892901e540417111c"}, + {file = "wrapt-1.17.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f9b2601381be482f70e5d1051a5965c25fb3625455a2bf520b5a077b22afb775"}, + {file = "wrapt-1.17.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:343e44b2a8e60e06a7e0d29c1671a0d9951f59174f3709962b5143f60a2a98bd"}, + {file = "wrapt-1.17.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:33486899acd2d7d3066156b03465b949da3fd41a5da6e394ec49d271baefcf05"}, + {file = "wrapt-1.17.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e6f40a8aa5a92f150bdb3e1c44b7e98fb7113955b2e5394122fa5532fec4b418"}, + {file = "wrapt-1.17.3-cp310-cp310-win32.whl", hash = "sha256:a36692b8491d30a8c75f1dfee65bef119d6f39ea84ee04d9f9311f83c5ad9390"}, + {file = "wrapt-1.17.3-cp310-cp310-win_amd64.whl", hash = "sha256:afd964fd43b10c12213574db492cb8f73b2f0826c8df07a68288f8f19af2ebe6"}, + {file = "wrapt-1.17.3-cp310-cp310-win_arm64.whl", hash = "sha256:af338aa93554be859173c39c85243970dc6a289fa907402289eeae7543e1ae18"}, + {file = "wrapt-1.17.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:273a736c4645e63ac582c60a56b0acb529ef07f78e08dc6bfadf6a46b19c0da7"}, + {file = "wrapt-1.17.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5531d911795e3f935a9c23eb1c8c03c211661a5060aab167065896bbf62a5f85"}, + {file = "wrapt-1.17.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0610b46293c59a3adbae3dee552b648b984176f8562ee0dba099a56cfbe4df1f"}, + {file = "wrapt-1.17.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b32888aad8b6e68f83a8fdccbf3165f5469702a7544472bdf41f582970ed3311"}, + {file = "wrapt-1.17.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cccf4f81371f257440c88faed6b74f1053eef90807b77e31ca057b2db74edb1"}, + {file = "wrapt-1.17.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8a210b158a34164de8bb68b0e7780041a903d7b00c87e906fb69928bf7890d5"}, + {file = "wrapt-1.17.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:79573c24a46ce11aab457b472efd8d125e5a51da2d1d24387666cd85f54c05b2"}, + {file = "wrapt-1.17.3-cp311-cp311-win32.whl", hash = "sha256:c31eebe420a9a5d2887b13000b043ff6ca27c452a9a22fa71f35f118e8d4bf89"}, + {file = "wrapt-1.17.3-cp311-cp311-win_amd64.whl", hash = "sha256:0b1831115c97f0663cb77aa27d381237e73ad4f721391a9bfb2fe8bc25fa6e77"}, + {file = "wrapt-1.17.3-cp311-cp311-win_arm64.whl", hash = "sha256:5a7b3c1ee8265eb4c8f1b7d29943f195c00673f5ab60c192eba2d4a7eae5f46a"}, + {file = "wrapt-1.17.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ab232e7fdb44cdfbf55fc3afa31bcdb0d8980b9b95c38b6405df2acb672af0e0"}, + {file = "wrapt-1.17.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:9baa544e6acc91130e926e8c802a17f3b16fbea0fd441b5a60f5cf2cc5c3deba"}, + {file = "wrapt-1.17.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6b538e31eca1a7ea4605e44f81a48aa24c4632a277431a6ed3f328835901f4fd"}, + {file = "wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:042ec3bb8f319c147b1301f2393bc19dba6e176b7da446853406d041c36c7828"}, + {file = "wrapt-1.17.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3af60380ba0b7b5aeb329bc4e402acd25bd877e98b3727b0135cb5c2efdaefe9"}, + {file = "wrapt-1.17.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0b02e424deef65c9f7326d8c19220a2c9040c51dc165cddb732f16198c168396"}, + {file = "wrapt-1.17.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:74afa28374a3c3a11b3b5e5fca0ae03bef8450d6aa3ab3a1e2c30e3a75d023dc"}, + {file = "wrapt-1.17.3-cp312-cp312-win32.whl", hash = "sha256:4da9f45279fff3543c371d5ababc57a0384f70be244de7759c85a7f989cb4ebe"}, + {file = "wrapt-1.17.3-cp312-cp312-win_amd64.whl", hash = "sha256:e71d5c6ebac14875668a1e90baf2ea0ef5b7ac7918355850c0908ae82bcb297c"}, + {file = "wrapt-1.17.3-cp312-cp312-win_arm64.whl", hash = "sha256:604d076c55e2fdd4c1c03d06dc1a31b95130010517b5019db15365ec4a405fc6"}, + {file = "wrapt-1.17.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a47681378a0439215912ef542c45a783484d4dd82bac412b71e59cf9c0e1cea0"}, + {file = "wrapt-1.17.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:54a30837587c6ee3cd1a4d1c2ec5d24e77984d44e2f34547e2323ddb4e22eb77"}, + {file = "wrapt-1.17.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:16ecf15d6af39246fe33e507105d67e4b81d8f8d2c6598ff7e3ca1b8a37213f7"}, + {file = "wrapt-1.17.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:6fd1ad24dc235e4ab88cda009e19bf347aabb975e44fd5c2fb22a3f6e4141277"}, + {file = "wrapt-1.17.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ed61b7c2d49cee3c027372df5809a59d60cf1b6c2f81ee980a091f3afed6a2d"}, + {file = "wrapt-1.17.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:423ed5420ad5f5529db9ce89eac09c8a2f97da18eb1c870237e84c5a5c2d60aa"}, + {file = "wrapt-1.17.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e01375f275f010fcbf7f643b4279896d04e571889b8a5b3f848423d91bf07050"}, + {file = "wrapt-1.17.3-cp313-cp313-win32.whl", hash = "sha256:53e5e39ff71b3fc484df8a522c933ea2b7cdd0d5d15ae82e5b23fde87d44cbd8"}, + {file = "wrapt-1.17.3-cp313-cp313-win_amd64.whl", hash = "sha256:1f0b2f40cf341ee8cc1a97d51ff50dddb9fcc73241b9143ec74b30fc4f44f6cb"}, + {file = "wrapt-1.17.3-cp313-cp313-win_arm64.whl", hash = "sha256:7425ac3c54430f5fc5e7b6f41d41e704db073309acfc09305816bc6a0b26bb16"}, + {file = "wrapt-1.17.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cf30f6e3c077c8e6a9a7809c94551203c8843e74ba0c960f4a98cd80d4665d39"}, + {file = "wrapt-1.17.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:e228514a06843cae89621384cfe3a80418f3c04aadf8a3b14e46a7be704e4235"}, + {file = "wrapt-1.17.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:5ea5eb3c0c071862997d6f3e02af1d055f381b1d25b286b9d6644b79db77657c"}, + {file = "wrapt-1.17.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:281262213373b6d5e4bb4353bc36d1ba4084e6d6b5d242863721ef2bf2c2930b"}, + {file = "wrapt-1.17.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dc4a8d2b25efb6681ecacad42fca8859f88092d8732b170de6a5dddd80a1c8fa"}, + {file = "wrapt-1.17.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:373342dd05b1d07d752cecbec0c41817231f29f3a89aa8b8843f7b95992ed0c7"}, + {file = "wrapt-1.17.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d40770d7c0fd5cbed9d84b2c3f2e156431a12c9a37dc6284060fb4bec0b7ffd4"}, + {file = "wrapt-1.17.3-cp314-cp314-win32.whl", hash = "sha256:fbd3c8319de8e1dc79d346929cd71d523622da527cca14e0c1d257e31c2b8b10"}, + {file = "wrapt-1.17.3-cp314-cp314-win_amd64.whl", hash = "sha256:e1a4120ae5705f673727d3253de3ed0e016f7cd78dc463db1b31e2463e1f3cf6"}, + {file = "wrapt-1.17.3-cp314-cp314-win_arm64.whl", hash = "sha256:507553480670cab08a800b9463bdb881b2edeed77dc677b0a5915e6106e91a58"}, + {file = "wrapt-1.17.3-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:ed7c635ae45cfbc1a7371f708727bf74690daedc49b4dba310590ca0bd28aa8a"}, + {file = "wrapt-1.17.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:249f88ed15503f6492a71f01442abddd73856a0032ae860de6d75ca62eed8067"}, + {file = "wrapt-1.17.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a03a38adec8066d5a37bea22f2ba6bbf39fcdefbe2d91419ab864c3fb515454"}, + {file = "wrapt-1.17.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:5d4478d72eb61c36e5b446e375bbc49ed002430d17cdec3cecb36993398e1a9e"}, + {file = "wrapt-1.17.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:223db574bb38637e8230eb14b185565023ab624474df94d2af18f1cdb625216f"}, + {file = "wrapt-1.17.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e405adefb53a435f01efa7ccdec012c016b5a1d3f35459990afc39b6be4d5056"}, + {file = "wrapt-1.17.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:88547535b787a6c9ce4086917b6e1d291aa8ed914fdd3a838b3539dc95c12804"}, + {file = "wrapt-1.17.3-cp314-cp314t-win32.whl", hash = "sha256:41b1d2bc74c2cac6f9074df52b2efbef2b30bdfe5f40cb78f8ca22963bc62977"}, + {file = "wrapt-1.17.3-cp314-cp314t-win_amd64.whl", hash = "sha256:73d496de46cd2cdbdbcce4ae4bcdb4afb6a11234a1df9c085249d55166b95116"}, + {file = "wrapt-1.17.3-cp314-cp314t-win_arm64.whl", hash = "sha256:f38e60678850c42461d4202739f9bf1e3a737c7ad283638251e79cc49effb6b6"}, + {file = "wrapt-1.17.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:70d86fa5197b8947a2fa70260b48e400bf2ccacdcab97bb7de47e3d1e6312225"}, + {file = "wrapt-1.17.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df7d30371a2accfe4013e90445f6388c570f103d61019b6b7c57e0265250072a"}, + {file = "wrapt-1.17.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:caea3e9c79d5f0d2c6d9ab96111601797ea5da8e6d0723f77eabb0d4068d2b2f"}, + {file = "wrapt-1.17.3-cp38-cp38-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:758895b01d546812d1f42204bd443b8c433c44d090248bf22689df673ccafe00"}, + {file = "wrapt-1.17.3-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:02b551d101f31694fc785e58e0720ef7d9a10c4e62c1c9358ce6f63f23e30a56"}, + {file = "wrapt-1.17.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:656873859b3b50eeebe6db8b1455e99d90c26ab058db8e427046dbc35c3140a5"}, + {file = "wrapt-1.17.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:a9a2203361a6e6404f80b99234fe7fb37d1fc73487b5a78dc1aa5b97201e0f22"}, + {file = "wrapt-1.17.3-cp38-cp38-win32.whl", hash = "sha256:55cbbc356c2842f39bcc553cf695932e8b30e30e797f961860afb308e6b1bb7c"}, + {file = "wrapt-1.17.3-cp38-cp38-win_amd64.whl", hash = "sha256:ad85e269fe54d506b240d2d7b9f5f2057c2aa9a2ea5b32c66f8902f768117ed2"}, + {file = "wrapt-1.17.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:30ce38e66630599e1193798285706903110d4f057aab3168a34b7fdc85569afc"}, + {file = "wrapt-1.17.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:65d1d00fbfb3ea5f20add88bbc0f815150dbbde3b026e6c24759466c8b5a9ef9"}, + {file = "wrapt-1.17.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a7c06742645f914f26c7f1fa47b8bc4c91d222f76ee20116c43d5ef0912bba2d"}, + {file = "wrapt-1.17.3-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7e18f01b0c3e4a07fe6dfdb00e29049ba17eadbc5e7609a2a3a4af83ab7d710a"}, + {file = "wrapt-1.17.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f5f51a6466667a5a356e6381d362d259125b57f059103dd9fdc8c0cf1d14139"}, + {file = "wrapt-1.17.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:59923aa12d0157f6b82d686c3fd8e1166fa8cdfb3e17b42ce3b6147ff81528df"}, + {file = "wrapt-1.17.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:46acc57b331e0b3bcb3e1ca3b421d65637915cfcd65eb783cb2f78a511193f9b"}, + {file = "wrapt-1.17.3-cp39-cp39-win32.whl", hash = "sha256:3e62d15d3cfa26e3d0788094de7b64efa75f3a53875cdbccdf78547aed547a81"}, + {file = "wrapt-1.17.3-cp39-cp39-win_amd64.whl", hash = "sha256:1f23fa283f51c890eda8e34e4937079114c74b4c81d2b2f1f1d94948f5cc3d7f"}, + {file = "wrapt-1.17.3-cp39-cp39-win_arm64.whl", hash = "sha256:24c2ed34dc222ed754247a2702b1e1e89fdbaa4016f324b4b8f1a802d4ffe87f"}, + {file = "wrapt-1.17.3-py3-none-any.whl", hash = "sha256:7171ae35d2c33d326ac19dd8facb1e82e5fd04ef8c6c0e394d7af55a55051c22"}, + {file = "wrapt-1.17.3.tar.gz", hash = "sha256:f66eb08feaa410fe4eebd17f2a2c8e2e46d3476e9f8c783daa8e09e0faa666d0"}, +] + +[[package]] +name = "yarl" +version = "1.25.1" +description = "Yet another URL library" +optional = false +python-versions = ">=3.10" +groups = ["main"] +files = [ + {file = "yarl-1.25.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:142c06c4d6a35ee3ec5da08499805e879cb3ca7c1fbfbecb0140fe72403818d6"}, + {file = "yarl-1.25.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:24ce942011a61953e7d313438038f4d32ff21387b775f58a957f7a07dd55ef95"}, + {file = "yarl-1.25.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e23c82b63cd7652fc24d33ed6cc17099d607aa3b4fc4ddc75e95062f3d82df4"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8ee202350cf57abf0e9502a41601841019c25d3db7ff52d980aaf31446254059"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5df89f769cc8ff94c3d7e7603386fba309d25ce5240132d26c15baa8d0e96c4c"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:83e9f4a25085bd4b7214701a0794ff1f50fc633ffb8bdfebf07abdd81c2db126"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e636b64d24fd9c38053c5e389a1174c66361fa49dcfd220f4dd35b4abde7cb89"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e5637ca8d0bd7fb72648a6c7934af4baaccb697657f7438c9d264fc2abb8b0b1"}, + {file = "yarl-1.25.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:683e362b8ba453080f7489c66f4ea794e751c35b72e7eab3575ef784c2fbc7fb"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:df23df54b5114a17c2d0ef192433e2e5a9f0c5178c32375e90b7cfc965f349d0"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:f53dcd26694f148f738edc052b5a69234833e739f10f4c3287bdfd8ec0f7b326"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:b8075fe90bc08e40b8b8a1874fab42ee4c7b56af05c5886e9cc841397f916908"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:a8c2b841478068440d8b733005d13a5ef535b9928cbc05f17182d410f32ba449"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:ca32926d7d77bcc8838425c4c95e040a3ace1cb7dfdae599013458dcda2607ca"}, + {file = "yarl-1.25.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:192a866877a49993949ef1975864ad8728bea28ee810f6abe1a0729c2b500426"}, + {file = "yarl-1.25.1-cp310-cp310-win_amd64.whl", hash = "sha256:3f4d48a6112712973e676bd792121fee470e432d749177162d9949d5c9460a1b"}, + {file = "yarl-1.25.1-cp310-cp310-win_arm64.whl", hash = "sha256:48796ea00a303961507dc6c8437c4b325a6fc3f95f7c36c71b91ea9a8150963c"}, + {file = "yarl-1.25.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9d693bf4bf534e9ba3ae2780cfd577f5135629f7b5ac653490859d0b77864865"}, + {file = "yarl-1.25.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ab2054c5531af2a9ba7b69b8ec91e4f884420e83a8c5e579b013084cb57e5e5d"}, + {file = "yarl-1.25.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:564fdc7085d2245ab84f88882fdb1d6ac0723124bff6ded35bfb1c00f812630d"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:acae6b45d1ace09b6ba3876da43b88366ef368f73b988c7f57e14231753d4420"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1fb2a01ba8cd9c5d2c5dc1ec35e0fc951d04b4f037541d4ac090c993ce58b3d7"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e92b6bcc741b86d67606c40d3cb9c7cc8e6c737f81e31f4a94efc204456c92e3"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:72c34ac7ad4314c19362d5ce27626dcc8429bd30bbf8c179f4234078851f9492"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5add7b4ca7afeea91d52e4d4e4db3b1fe9885b71f07054560d8c4296b7441a2"}, + {file = "yarl-1.25.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:def538065f9e4d4cf1ae164bd59aba00dfa84f03923e0de4c3788f252d6bcd17"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a191bfdb30a79b98e5d175d75285f9fcb78bf0e46ba5efda042e1c72071a0de"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:71f42c5b9a948c113bbdebfa544598321431d064ff959d32e99b1feb61d68345"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:72849d892954be4d09e569b8b831ac39ce58417fedc767d4308a0fe542018a40"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:efb01a106f971cb3752856bca2318bbdf7f01bd8823779c461586cbe5ffd5258"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:a1daf47cd95a7c3a63456336bc5aaa8c86dd3a47d07ed3d0e76132ae4666a5a1"}, + {file = "yarl-1.25.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9489e6abf47ba37f332075a91444c7cfedb03e6ce99fbb2f116bfe1ce810da3b"}, + {file = "yarl-1.25.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7306dee25b8a0e737363f347362b875094b4dc4e367311470656ae420fdbf8e"}, + {file = "yarl-1.25.1-cp311-cp311-win_arm64.whl", hash = "sha256:abb1384477f5901d436b5d2e5465954de46ea6098f59163d243660b5c4461d35"}, + {file = "yarl-1.25.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:94d7aa6debf92a1dd14cb5280b083a764169a13cfb23a452111160274ed989f4"}, + {file = "yarl-1.25.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:83d4a37e4b95da4d8bda930d6d35b75b4cdadbacbb4980cae290ea3100b5d51d"}, + {file = "yarl-1.25.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e029648f9c951db30e98a7d7ec90835db88ec4b32820efe2a9bdc2287e032eb6"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4d781294bb815ecb5ea57ff6bbf8038e0a31a95fdf3e1788f66e0dc100d64b58"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e12c538e00e7c1b286a07061046b90e8124e6a9793efae2c70db6a4aad07faad"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7e4de3ac4adbad3d0bc7c6f4360a7dbff5de2f15e3b723be3198074e17fd9c40"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:419f392a1da624877975709e3864dfe833af6cc7671b39318086d456e288380c"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c6f117789d22dce188e5754e8bc65b7e6ebf8cb73963b9fa761f672a5883769d"}, + {file = "yarl-1.25.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:80e47012e730da131c9f059c80936783f9659aae22dc31c03c0595590d11ed54"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e80f557716fd765439577131e526b8942ffc2c07bdbc5e39fa62f660ba1e963f"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f61964f235a43738bfac50da46fc4254943a7eea3051aeb0b6fc7c992c29fadc"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:e546fe1d4a93ebc2910f0d768baff19faa09843ab3f2036a67ed6e69fae4419d"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:cce0727fd5ac04d372fa9bbfde9febc2bcf209aadfcf0468e45dec72719895d1"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af4ea5b37403ef4e30f3927eaed540db942bde01d8d3ff083527c0704d1c9c68"}, + {file = "yarl-1.25.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:68782fdb4027b8d1eee25ec35e9a6db05e863b899eb0310b3a33b6c3fef55707"}, + {file = "yarl-1.25.1-cp312-cp312-win_amd64.whl", hash = "sha256:7d575b54cb3863ef9bc290ea4b009999d55dc237326131e4853cf33e888fee03"}, + {file = "yarl-1.25.1-cp312-cp312-win_arm64.whl", hash = "sha256:bc3ac7bf569f6b64dad04dd7808c7872dae8a97df657856eac05e9b7e3614a85"}, + {file = "yarl-1.25.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:25868beca8b6765f8f7d0e11fe6dd7c66dd4b0793b9500286d20cc92352126a5"}, + {file = "yarl-1.25.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:10b2fd95332f0d716d5eee3c9fb2ce8eada19082de7fee83d32e37992fd75c26"}, + {file = "yarl-1.25.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0f12afda4eea8c8994a76d4df1875c765194f5fbe8a9d197929ea303caee29ec"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:14b79a30a93a3ce2e8832603fd0ab780ada281b0ba5110b519a634f2d7d7d1fc"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4bd6340d20ae2c7ca719b87b426e808e90743b676d05d4c26c4fb5ca71f41184"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:126a2533570c554719ca40a1288fdee1700b6bc82e7131aa69fa85252d92e651"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a3faadac7d812ddac258feb57b9846b60c1b437c4f4b9ad42595c6f6fe4390df"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be80550d9bfe83d9b62398a37081a90434e6df2d978ec345c3d2820de6beddab"}, + {file = "yarl-1.25.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e07595c7d6f4db270ceede356a1bd1c07a34f1c26f958d1ed0cd7b48e0d2bba3"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:eb96ed1ae6c7d072d60840c0434aef07a2df611812810807fbc54263a6053e9a"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3feb99222553a8cbedfa52c2f59dd84c3f50d5b582c728d522caf8d72769a54b"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a2ed0ba415ccdf08f14bf544cb78346d0f76086707ffee24921a2c84dbf1305a"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:2b49375d22299b0a834c2bca72f39aaecc270d96fb24c30424899676f487b22a"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ef74070ac553c59eb4f04258722066d6c6135b7baa03b2e9f2da65c096e96d98"}, + {file = "yarl-1.25.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0a66db89ea473abeac4b70523cafd94db3772380e565f9d28af7a179b7af71fa"}, + {file = "yarl-1.25.1-cp313-cp313-win_amd64.whl", hash = "sha256:1f51020b2eb8a003c84925638ec63c21a750a4bddd3a22ec8eac6a742dadf1b9"}, + {file = "yarl-1.25.1-cp313-cp313-win_arm64.whl", hash = "sha256:b10dd0557ba422715b5206b3743192135a6022acca8baec51aa127d0a75db8fe"}, + {file = "yarl-1.25.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:a9ca696eb02e5c02a8afd872ada510eba9b7fe6e68b9572c2e9a9b1941e31e2e"}, + {file = "yarl-1.25.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a5877f2255aab518ebe528289037699201d5dc5f045f2396cb30aa02db22f57f"}, + {file = "yarl-1.25.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7a5c3115595995779ee21f2567035793911c3802a43c74f3fbb0314929ec67ac"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:77e5099b99b37f3cf79c246998ca9f7313a78054cd1809ec46bc1afad47e1c4c"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6efaf45df6a849cef613a03a94c845647456662f85438c886bb67a9c027c8c2c"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d5f90e44653c4e0f78501ed9bb7d3fce835a8d62b7c6ed0cb16557534087e743"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:632da579b2d879f6bad20f2cfa35ded1efe2f4f77f8abb26a6234a5b236acd2f"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:30eec96e8a91bd588ce897c9543f6d5d8d34b28fbcba28a4dedf20ebeae9fe57"}, + {file = "yarl-1.25.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:12b6bc4906e11f5e1a1cdcb12296e7afbd366c783cc8073403cd2fb74334e453"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9d6ed3d17bccce4c05343e1ca8da13bc5c02c812a4e7282ddd05e8769322d3fc"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:f38a70074041d3b7e138e452799f5174198bae5bd5ab2000917badf403908c5f"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:4ca89e4e21854ed27ec753297dde84b16c9f8e53b14a4866fb44457d643c19f8"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:1ab7618921a93767387a4b83776f751588f5b5ae9bb5bc96620e2e2e00bca868"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:0ae12ff2b805fa02c4dab838005caef735e39986322698c48588d3beacb65c62"}, + {file = "yarl-1.25.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:90c30ed53546da833c700115c0064c22120d1b1560f474699fd31f22dd668233"}, + {file = "yarl-1.25.1-cp314-cp314-win_amd64.whl", hash = "sha256:acfa7e22aa6c6e7a5996a41d275bfa01efa7ea56ab890590280e9063e2cf5c1b"}, + {file = "yarl-1.25.1-cp314-cp314-win_arm64.whl", hash = "sha256:8e7d98cdbb6d71e726f7d525952867096053d1f290dd4e3c50d7d313a136f414"}, + {file = "yarl-1.25.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:d21f0fa80a02d05299207eeaafef345d812ace96d5306e4ef265e1d419a615fa"}, + {file = "yarl-1.25.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:17c9877a89fb6e2bca6f9087eb24cd7fb434653946ef5075e470d23d49b52287"}, + {file = "yarl-1.25.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:29273edf1530e397bd07cb784db1fbe0d2590b77569f2e24679a9c0a2d763b94"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b7abffdf37af1cec6a2ad69b827aa84320db5894791bc8ed932dc93fb274b7e9"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2239a02249d9326655419e0168a28ca9008938eaab31dc29fc875c217927a6c0"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:664ec6a520b74a1df2810666eb67695fcb77fa663e6ea0a25aaf2e529cb24dfa"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4f1c91f5a5980a937ff8e238e98e6897e1ad74a4b1e2c0d68c73b5ffbb3f5c0b"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c88edaec8c349ad4c5ad4c486a3defcc4b80ceb2f074436ffa0a87caf5e76a6"}, + {file = "yarl-1.25.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:35dcbea443fafb3eece757ad4e514560ddeb6c34cfae1582c620d7b293d7feee"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:882569ff613758cac762a457a5d72d6e211b28d4bcfea89d1d71ea942b02eac0"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:d0f1489233a254bb3643d2f05de7d59019254d81daeca6b9162fe9edef57e0c7"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:f41753a76f4f63927d03a0d8ba8f5ce0f2083bec29a8cfaccc55371b1564b96b"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:8fb0eb4955adf0579001581f2f71a126e8781ba61bcd120f127b0401163c6c2d"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:a1e32763e641a1566507d90a8d3b19bfc3cc04a9d4e5ae3e32189874ed4b58a3"}, + {file = "yarl-1.25.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:65b5b2066651b7432d389e9799d979c703bcc6ef44266bb8153ef54e91e4aab3"}, + {file = "yarl-1.25.1-cp314-cp314t-win_amd64.whl", hash = "sha256:734f6e5400352ac4254456003d462866c684703570929cff7a7bde015d0cb371"}, + {file = "yarl-1.25.1-cp314-cp314t-win_arm64.whl", hash = "sha256:287e99ff5aa4dc1c7630bfc683ded6f106d756c99dec432a2d7f197a784f51c6"}, + {file = "yarl-1.25.1-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:9b1bdaae98bc016825dd3c9d8ee1832f829b3341f9cc6ebd1a1b0a7fef7367cc"}, + {file = "yarl-1.25.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:e7011b8fb8c4054bf0c12e5edc6cd83778b0028e99ce59b18586ed036f92cfdc"}, + {file = "yarl-1.25.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:f074e8d4aa0a5798920ddb6de3d08b228c614ff3724c3e8bd7577f4bafea867b"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7d42e7e3ca399555578b4d617e3a6ecf13371b3743a115995fa010c7bf341459"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:aa4ed3dd308548f9e707d9caaf005d2d7f8c1e7868f858dfeb47fe76e16b391d"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:42a66563d8cc056ee32e6191e05097a7b2b3bc302e0bc3133daf8710eb18bd26"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:98d370568f393215d605304cdb77b3d5539bd192c75b623c7304c42c8d6d8273"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23bf5b403c879a54964e0feac7285688e04bb220074878d737d331522da0a5bf"}, + {file = "yarl-1.25.1-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d45673badd08456d0340e9364eddafe1c53a9d2896424294de4d7dd71ad3ee57"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:0136d640dfa9b0523853e411430a99f8a91eca85774c6420285a33b755bc6de3"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:59ba3a6e1aa8cfe5adf4bd270fd965db21955401b7ca6f1696010c55ed4daec2"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:87796fedc3ba97ec14fab55acb48584276e6c1e4c1e89c422bda62c838e754a9"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:bd0912757081f89b107d6c00b2ff8a194401b0b87eadcf4481de2b865a8fd44f"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:b51c159a9794633f5e0db7ecec7b2b6e3734eca1f5d17dc989ff3552a43ff78b"}, + {file = "yarl-1.25.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:319e070a01db9920fb63761843f96a104c8e2b9427266731810dc1e22595b17c"}, + {file = "yarl-1.25.1-cp315-cp315-win_amd64.whl", hash = "sha256:a2059a2d891bd156bc5184e7ab7a56e78a84dfcfdeac8c501b552533ad1c36ee"}, + {file = "yarl-1.25.1-cp315-cp315-win_arm64.whl", hash = "sha256:a78b50b4f7918a3de71105d5c0b93bbc57bb8339a4d03a9dfd449f9068e76f3d"}, + {file = "yarl-1.25.1-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:b5402a340723fa7da00b5cff987ddab61276be6d11251ea71ae02bcac54890d8"}, + {file = "yarl-1.25.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:eda19ea5ee88742f47a2340816e6f2d40b53bed3ab5b69794769f36af9f35bb4"}, + {file = "yarl-1.25.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:75baa6cf9b6d1c52f3e111a130e202fd8cf0a5b3a066c3f73d615e885092e4ec"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dbcef5a9119ef653653132cccaf999b30a0af6f33bb0a4ba80bec30056868487"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7efc9f082dfed77c316edffa9deb52888e1bc6789171887cc1f68e06d65465c8"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fe01645169a2112aa1d4ebc3e4c5f029c5c8f97adfc32e5d37c993b39a994d75"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1c557dfd5e3db046053a0bdc72261ade790ebe8e2c7a41b36b0ca1f14cb95f3"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8ce4d6ccafb33d39bd78444612d14938ead674c25702ded2ee9c54a47735d225"}, + {file = "yarl-1.25.1-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:80a063f8297fc796296f00f100be520f209b23dc98f93ce8eba6ee7122598209"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:7cb414a73e21a7ab58254926073f2930cb22f5b4314ea4260a687e2b3fd4dce3"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:85a18376073f8a39aa07be34f9fc77e2869aa72c55c441efdd2cf79a0407504d"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:77716e245c90f058466a05e6a465bb8600f767a8f4b18b4d40f3aff958e5f73c"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:1e80dcf1446e1b080b1932b0d103c464a04112f5bc31f0f983ad418172063cde"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:bdc8d8b8c22e9e43ac68316b5e6cf083dec537f4ec213cb4aa967b583bc3fa64"}, + {file = "yarl-1.25.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:dfbf531053a0935f2e871bcd4753f90313688772ff8c017f5ea402e315a78c1f"}, + {file = "yarl-1.25.1-cp315-cp315t-win_amd64.whl", hash = "sha256:b13b88747769537f3d32e89e3a735da10c0a9e35d7322928c701b5f93d3afffd"}, + {file = "yarl-1.25.1-cp315-cp315t-win_arm64.whl", hash = "sha256:783dd1467083f4d3f7722ad6a313f24c173e7571372738fcb7a6e6d1ba48df25"}, + {file = "yarl-1.25.1-py3-none-any.whl", hash = "sha256:681c758b0490f9e96b78e5fa8e8dc6e648e9185bb6eaebe73183c33ea0c445f3"}, + {file = "yarl-1.25.1.tar.gz", hash = "sha256:03dd38de09bc213e9a8b29761eec33ee1d5318dac0e49d8af36e4d27830e23a7"}, +] + +[package.dependencies] +idna = ">=2.0" +multidict = ">=4.0" +propcache = ">=0.2.1" + +[metadata] +lock-version = "2.1" +python-versions = ">=3.12,<3.13" +content-hash = "43257a0f222b1fb8f794a66b2b93eb7f160cbe05922ceabda54ddb0f3755cded" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e656554f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[tool.poetry] +name = "max2" +version = "1.2.0" +description = "Мессенджер на PostgreSQL и Valkey, лабораторная 3" +authors = ["Саватеев Артём"] +package-mode = false + +[tool.poetry.dependencies] +python = ">=3.12,<3.13" +fastapi = "0.142.2" +uvicorn = "0.54.0" +pydantic = "2.13.5" +envparse = "0.2.0" +loguru = "0.7.3" +asyncpg = "0.31.0" +redis = "6.4.0" +argon2-cffi = "25.1.0" +aioboto3 = "^13.0.0" +python-multipart = "^0.0.18" + +[tool.poetry.group.dev.dependencies] +pytest = "9.1.1" +httpx = "0.28.1" + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +testpaths = ["student-tests"] +addopts = "-v" diff --git a/scripts/check_migrations.sh b/scripts/check_migrations.sh new file mode 100644 index 00000000..d38967ea --- /dev/null +++ b/scripts/check_migrations.sh @@ -0,0 +1,58 @@ +#!/bin/sh +set -eu +# Миграции с нуля и повторно, отказ API на непримененной схеме: отдельный +# compose-проект с собственным пустым volume. Рабочий стенд и его данные +# не затрагиваются; временный volume этого проекта удаляется в конце. +cd "$(dirname "$0")/.." +PROJECT=messenger-lab3-migrations-check +# Публикуется только порт LB: свои порты, чтобы не конфликтовать с основным стендом +export LB_PORT="${MIGRATIONS_CHECK_LB_PORT:-58080}" +export LB_EXPIRY_PORT="${MIGRATIONS_CHECK_LB_EXPIRY_PORT:-58081}" +COMPOSE="docker compose --env-file ${ENV_FILE:-.env} -p $PROJECT" +trap '$COMPOSE down -v --remove-orphans >/dev/null 2>&1' EXIT + +$COMPOSE up -d --wait postgres >/dev/null 2>&1 +# Тот же образ и сеть, что у сервиса migrate; apply_migrations трижды подряд +$COMPOSE run --rm --no-deps -T migrate python - <<'EOF' +import asyncio +import sys + +sys.path.insert(0, "src") + +from infrastructure.dependencies.database import database_pool_manager as db + + +async def main() -> None: + await db.create_pool(30) + async with db.acquire() as conn: + tables = await conn.fetchval( + "SELECT count(*) FROM pg_tables WHERE schemaname = 'public';" + ) + print(f"пустой volume: таблиц в public = {tables}") + # Так стартует API-реплика: без migrate она отказывается работать + try: + await db.check_migrations() + except RuntimeError as error: + print(f"API до migrate: {error}") + else: + raise SystemExit("FAIL: API стартовал бы на пустой схеме") + for attempt in (1, 2, 3): + await db.apply_migrations() + async with db.acquire() as conn: + versions = await conn.fetch( + "SELECT version, name FROM schema_migrations ORDER BY version;" + ) + tables = await conn.fetchval( + "SELECT count(*) FROM pg_tables WHERE schemaname = 'public';" + ) + print( + f"запуск {attempt}: schema_migrations = " + f"{[(r['version'], r['name']) for r in versions]}, таблиц = {tables}" + ) + await db.check_migrations() + print("API после migrate: схема совместима") + await db.close() + + +asyncio.run(main()) +EOF diff --git a/scripts/check_previous_version.sh b/scripts/check_previous_version.sh new file mode 100644 index 00000000..1df75afb --- /dev/null +++ b/scripts/check_previous_version.sh @@ -0,0 +1,89 @@ +#!/bin/sh +set -eu +# Совместимость текущей схемы с предыдущей версией API — условие rolling update: +# миграции применяются до замены реплик, и старые реплики продолжают работать. +# Образ собирается из коммита PREVIOUS_REVISION (по умолчанию lab2-код aa971fb), +# запускается одним процессом в сети backend рабочего стенда (наружу порт +# не публикуется) и выполняет вход, создание чата, запись и чтение сообщения. +# Создаются только синтетические данные; volumes не затрагиваются. +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" +REVISION="${PREVIOUS_REVISION:-aa971fb}" +IMAGE="mtusi-messenger:compat-$REVISION" +NETWORK=messenger-lab3_backend + +git archive "$REVISION" | docker build --quiet --tag "$IMAGE" - >/dev/null +echo "previous version image: $IMAGE ($(git log -1 --format='%h %s' "$REVISION"))" +echo "schema on stand: $(docker compose --env-file "$ENV_FILE" exec -T postgres sh -c \ + 'psql -X -q -tA -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT string_agg(name, \$\$, \$\$ ORDER BY version) FROM schema_migrations;"')" + +docker run --rm -i --network "$NETWORK" --env-file "$ENV_FILE" \ + -e DB_HOST=postgres -e DB_PORT=5432 -e VALKEY_HOST=valkey -e VALKEY_PORT=6379 \ + "$IMAGE" sh -c 'python src/gateway.py >/tmp/api.log 2>&1 & exec python -' <<'EOF' +import base64 +import json +import time +import urllib.error +import urllib.request +import uuid + +BASE = "http://127.0.0.1:8080" + + +def call(method, path, body=None, headers=None): + data = None if body is None else json.dumps(body).encode() + request = urllib.request.Request(BASE + path, data=data, method=method) + request.add_header("Content-Type", "application/json") + for name, value in (headers or {}).items(): + request.add_header(name, value) + try: + with urllib.request.urlopen(request, timeout=5) as response: + return response.status, json.loads(response.read() or b"null") + except urllib.error.HTTPError as error: + return error.code, None + + +for _ in range(60): + try: + if call("GET", "/health/ready")[0] == 200: + break + except OSError: + pass + time.sleep(0.5) +else: + print(open("/tmp/api.log").read()[-2000:]) + raise SystemExit("FAIL: previous version did not become ready on current schema") + +username = "compat_" + uuid.uuid4().hex[:12] +password = "Compat-" + uuid.uuid4().hex +status_user, user = call( + "POST", "/api/v1/users", + {"username": username, "display_name": "Compat", "password": password}, +) +credentials = base64.b64encode(f"{username}:{password}".encode()).decode() +status_login, session = call( + "POST", "/api/v1/auth/sessions", headers={"Authorization": "Basic " + credentials} +) +bearer = {"Authorization": "Bearer " + session["token"]} +status_chat, chat = call( + "POST", "/api/v1/chats", {"title": "compat", "member_ids": [user["id"]]}, bearer +) +path = f"/api/v1/chats/{chat['id']}/messages" +status_send, message = call("POST", path, {"text": "старая версия пишет"}, bearer) +status_read, page = call("GET", path, headers=bearer) +result = { + "ready": True, + "register": status_user, + "login": status_login, + "create_chat": status_chat, + "send_message_without_key": status_send, + "read_history": status_read, + "history_matches": page["items"] == [message], +} +print(json.dumps(result, ensure_ascii=False)) +log = open("/tmp/api.log").read() +print("startup log:", [line.split(" - ", 1)[-1] for line in log.splitlines() if "миграц" in line.lower() or "Схема" in line]) +if any(code >= 400 for code in result.values() if isinstance(code, int)) or not result["history_matches"]: + raise SystemExit("FAIL: previous version is not compatible with current schema") +print("PASS: previous API version works on the current schema (expand-only migration)") +EOF diff --git a/scripts/experiment.py b/scripts/experiment.py new file mode 100644 index 00000000..0eaf17c4 --- /dev/null +++ b/scripts/experiment.py @@ -0,0 +1,480 @@ +#!/usr/bin/env python3 +"""Нагрузка через LB во время отказа/замены API-реплик; метрики и проверка данных. + +failover — для каждой API-реплики по очереди: нагрузка → остановка этой реплики + (docker stop = SIGTERM, затем docker kill = SIGKILL) → восстановление + (scripts/restore.sh) → нагрузка после восстановления. +rolling — нагрузка во время scripts/rolling-update.sh (поочерёдная замена реплик). + +Клиент ведёт себя как настоящий: неподтверждённый POST повторяет с тем же +Idempotency-Key и телом. После прогона вся история читается заново: каждое +подтверждённое сообщение на месте и не изменено, дублей нет. +Python 3.9+, стандартная библиотека; tokens не печатаются и не сохраняются. +""" + +from __future__ import annotations + +import argparse +import json +import math +import os +import subprocess +import sys +import threading +import time +import urllib.error +import urllib.request +import uuid +from dataclasses import dataclass +from pathlib import Path +from urllib.parse import quote + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tests")) + +from client import Client # noqa: E402 + +REQUEST_TIMEOUT_SEC = 5 +RETRY_PAUSE_SEC = 0.05 +STATS_FORMAT = "{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" + + +@dataclass +class Attempt: + """Одна HTTP-попытка клиента; время — секунды от начала прогона""" + + op: str + started: float + finished: float + status: int | None + error: str | None + instance: str | None + retry: bool + + @property + def ok(self) -> bool: + return self.status in (200, 201) + + +class Recorder: + def __init__(self) -> None: + self.started = time.monotonic() + self.lock = threading.Lock() + self.attempts: list[Attempt] = [] + self.confirmed: list[dict] = [] + self.events: dict[str, float] = {} + + def now(self) -> float: + return time.monotonic() - self.started + + def mark(self, name: str) -> None: + self.events[name] = round(self.now(), 3) + + def add(self, attempt: Attempt, message: dict | None = None) -> None: + with self.lock: + self.attempts.append(attempt) + if message is not None: + self.confirmed.append(message) + + +def request( + base: str, method: str, path: str, token: str, body: dict | None, key: str | None +) -> tuple[int | None, str | None, str | None, dict | None]: + headers = {"Authorization": "Bearer " + token, "Accept": "application/json"} + data = None + if body is not None: + data = json.dumps(body, ensure_ascii=False).encode() + headers["Content-Type"] = "application/json" + if key is not None: + headers["Idempotency-Key"] = key + req = urllib.request.Request(base + path, data=data, headers=headers, method=method) + try: + with urllib.request.urlopen(req, timeout=REQUEST_TIMEOUT_SEC) as response: + payload = json.loads(response.read()) + return response.status, None, response.headers.get("X-Instance-Id"), payload + except urllib.error.HTTPError as error: + error.read() + return error.code, None, error.headers.get("X-Instance-Id"), None + except OSError as error: + return None, type(error).__name__, None, None + + +def worker( + base: str, + token: str, + chat_id: str, + worker_id: int, + recorder: Recorder, + stop: threading.Event, +) -> None: + """Запись с повтором по тому же ключу до подтверждения, затем чтение""" + path = f"/api/v1/chats/{chat_id}/messages" + index = 0 + while not stop.is_set(): + key = uuid.uuid4().hex + body = {"text": f"exp-{worker_id}-{index}-{key[:8]}"} + retry = False + while not stop.is_set(): + started = recorder.now() + status, error, instance, payload = request( + base, "POST", path, token, body, key + ) + attempt = Attempt( + "write", started, recorder.now(), status, error, instance, retry + ) + recorder.add(attempt, payload if status == 201 else None) + if status == 201: + break + retry = True + time.sleep(RETRY_PAUSE_SEC) + started = recorder.now() + status, error, instance, _ = request( + base, "GET", path + "?limit=1", token, None, None + ) + recorder.add( + Attempt("read", started, recorder.now(), status, error, instance, False) + ) + index += 1 + + +def percentile(values: list[float], p: float) -> float | None: + if not values: + return None + ordered = sorted(values) + return round(1000 * ordered[max(0, math.ceil(p * len(ordered)) - 1)], 1) + + +def phase_stats(attempts: list[Attempt], start: float, end: float) -> dict: + inside = [a for a in attempts if start <= a.finished < end] + duration = max(end - start, 1e-9) + result: dict = {"seconds": round(duration, 3)} + for op in ("write", "read"): + ops = [a for a in inside if a.op == op] + ok = [a for a in ops if a.ok] + result[op] = { + "ok": len(ok), + "errors": len(ops) - len(ok), + "ok_rps": round(len(ok) / duration, 1), + "latency_ms": { + "p50": percentile([a.finished - a.started for a in ok], 0.50), + "p95": percentile([a.finished - a.started for a in ok], 0.95), + "p99": percentile([a.finished - a.started for a in ok], 0.99), + }, + } + return result + + +def recovery_stats(attempts: list[Attempt], action_start: float, end: float) -> dict: + """ + Время восстановления записи: от первой ошибки после воздействия до первой + успешной записи после последней ошибки; без ошибок — 0. Отдельно — + наибольший разрыв между подтверждениями записи (задержка без ошибок). + """ + window = sorted( + (a for a in attempts if a.op == "write" and a.finished >= action_start - 1), + key=lambda a: a.finished, + ) + errors = [a for a in window if not a.ok and a.finished >= action_start] + kinds: dict[str, int] = {} + for a in errors: + kind = a.error or f"HTTP {a.status}" + kinds[kind] = kinds.get(kind, 0) + 1 + if errors: + last_error = errors[-1].finished + first_ok_after = next( + (a.finished for a in window if a.ok and a.finished > last_error), end + ) + recovery = first_ok_after - errors[0].finished + else: + recovery = 0.0 + oks = [a.finished for a in window if a.ok and a.finished <= end] + gap = max((b - a for a, b in zip(oks, oks[1:])), default=None) + return { + "write_errors": len(errors), + "error_kinds": kinds, + "write_recovery_seconds": round(recovery, 3), + "max_write_gap_seconds": None if gap is None else round(gap, 3), + } + + +def timeline(attempts: list[Attempt], end: float) -> list[dict]: + rows = [] + for second in range(int(end) + 1): + inside = [a for a in attempts if second <= a.finished < second + 1] + instances: dict[str, int] = {} + for a in inside: + if a.ok and a.instance: + instances[a.instance] = instances.get(a.instance, 0) + 1 + rows.append( + { + "t": second, + "ok": sum(a.ok for a in inside), + "errors": sum(not a.ok for a in inside), + "instances": instances, + } + ) + return rows + + +def read_history(client: Client, actor: dict, chat_id: str) -> list[dict]: + path = f"/api/v1/chats/{chat_id}/messages?limit=100" + items: list[dict] = [] + while True: + page = client.call("GET", path, actor=actor, schema="MessagePage")["json"] + items.extend(page["items"]) + if page["next_cursor"] is None: + return items + path = f"/api/v1/chats/{chat_id}/messages?limit=100&cursor=" + quote( + page["next_cursor"], safe="" + ) + + +def integrity(client: Client, actor: dict, chat_id: str, recorder: Recorder) -> dict: + history = read_history(client, actor, chat_id) + by_id = {m["id"]: m for m in history} + texts = [m["text"] for m in history] + confirmed = {m["id"]: m for m in recorder.confirmed} + return { + "messages_in_history": len(history), + "confirmed_unique": len(confirmed), + "confirmed_missing_or_changed": sum( + by_id.get(i) != m for i, m in confirmed.items() + ), + "duplicate_ids": len(history) - len(by_id), + "duplicate_texts": len(texts) - len(set(texts)), + "retried_writes_confirmed_as_replay": len(recorder.confirmed) - len(confirmed), + } + + +def run(command: list[str], env: dict | None = None) -> str: + result = subprocess.run( + command, cwd=ROOT, env=env, check=True, capture_output=True, text=True + ) + return result.stdout.strip() + + +def api_containers() -> list[str]: + ids = run(["docker", "compose", "--env-file", ".env", "ps", "-q", "api"]).split() + names = [run(["docker", "inspect", "-f", "{{.Name}}", i]).lstrip("/") for i in ids] + return sorted(names) + + +def instance_of(container: str) -> str: + return run(["docker", "exec", container, "cat", "/tmp/instance-id"]) + + +def container_stats() -> list[str]: + names = ["messenger-lab3-nginx-1", "messenger-lab3-postgres-1", *api_containers()] + output = run(["docker", "stats", "--no-stream", "--format", STATS_FORMAT, *names]) + return output.splitlines() + + +def scenario( + args: argparse.Namespace, + label: str, + action: list[str], + restore: list[str] | None, + target: str | None = None, + env: dict | None = None, +) -> dict: + client = Client(args.base_url, timeout=REQUEST_TIMEOUT_SEC) + alice, _, _, chat = client.bootstrap() + base = client.base + recorder = Recorder() + stop = threading.Event() + threads = [ + threading.Thread( + target=worker, + args=(base, alice["token"], chat["id"], n, recorder, stop), + daemon=True, + ) + for n in range(args.workers) + ] + for thread in threads: + thread.start() + time.sleep(args.before / 2) + stats = container_stats() + time.sleep(args.before / 2) + + instances_before = sorted( + {a.instance for a in recorder.attempts if a.ok and a.instance} + ) + recorder.mark("action_start") + action_output = run(action, env) + recorder.mark("action_end") + restore_output = "" + if restore is not None: + time.sleep(args.outage) + recorder.mark("restore_start") + restore_output = run(restore) + recorder.mark("restore_end") + time.sleep(args.after) + stop.set() + for thread in threads: + thread.join(timeout=REQUEST_TIMEOUT_SEC + 1) + recorder.mark("end") + + events = recorder.events + end = events["end"] + after_start = events.get("restore_end", events["action_end"]) + attempts = recorder.attempts + seen_after = [ + a for a in attempts if a.ok and a.finished >= after_start and a.instance + ] + back_in_rotation = next( + ( + round(a.finished - after_start, 3) + for a in sorted(seen_after, key=lambda a: a.finished) + if a.instance not in instances_before + ), + None, + ) + served = sorted( + (a for a in attempts if a.ok and a.instance), key=lambda a: a.finished + ) + instances_seen: dict[str, list[float]] = {} + for a in served: + offset = round(a.finished - events["action_start"], 3) + instances_seen.setdefault(a.instance, [offset, offset])[1] = offset + phases = { + "before": phase_stats(attempts, 0, events["action_start"]), + "during": phase_stats(attempts, events["action_start"], after_start), + "after": phase_stats(attempts, after_start, end), + } + target_after_stop = None + if target is not None: + target_after_stop = sum( + 1 + for a in attempts + if a.ok + and a.instance == target + and a.finished > events["action_end"] + and a.finished < events.get("restore_start", end) + ) + return { + "scenario": label, + "target_instance": target, + "workers": args.workers, + "events_seconds": events, + "instances_before": instances_before, + "instances_after": sorted({a.instance for a in seen_after}), + "target_responses_while_stopped": target_after_stop, + "restored_replica_in_rotation_seconds": back_in_rotation + if restore is not None + else None, + # alias → [первый, последний] успешный ответ, секунды от начала воздействия + "instances_seen_from_action": instances_seen, + "phases": phases, + "recovery": recovery_stats(attempts, events["action_start"], end), + "integrity": integrity(client, alice, chat["id"], recorder), + "container_stats_before_action": stats, + "action_output": action_output.splitlines(), + "restore_output_tail": restore_output.splitlines()[-2:], + "timeline": timeline(attempts, end), + } + + +def failover(args: argparse.Namespace) -> list[dict]: + results = [] + for signal in args.signals: + for container in api_containers(): + target = instance_of(container) + if signal == "SIGTERM": + action = ["docker", "stop", "--timeout", "10", container] + else: + action = ["docker", "kill", "--signal", "SIGKILL", container] + label = f"{signal} {container}" + print(f"== {label} (instance {target})", flush=True) + result = scenario( + args, label, action, ["./scripts/restore.sh"], target=target + ) + print(json.dumps(brief(result), ensure_ascii=False), flush=True) + results.append(result) + return results + + +def rolling(args: argparse.Namespace) -> list[dict]: + env = dict(os.environ) + env.setdefault("APP_REVISION", f"exp-{int(time.time())}") + print(f"== rolling update to revision {env['APP_REVISION']}", flush=True) + result = scenario( + args, "rolling update", ["./scripts/rolling-update.sh"], None, env=env + ) + result["revisions_after"] = run(["./scripts/instances.sh"]).splitlines() + print(json.dumps(brief(result), ensure_ascii=False), flush=True) + return [result] + + +def brief(result: dict) -> dict: + """Краткая строка прогона для терминала; полная версия — в --output""" + return { + "scenario": result["scenario"], + "rps_ok_write": {k: v["write"]["ok_rps"] for k, v in result["phases"].items()}, + "rps_ok_read": {k: v["read"]["ok_rps"] for k, v in result["phases"].items()}, + "errors": { + k: v["write"]["errors"] + v["read"]["errors"] + for k, v in result["phases"].items() + }, + "recovery": result["recovery"], + "target_responses_while_stopped": result["target_responses_while_stopped"], + "restored_replica_in_rotation_seconds": result[ + "restored_replica_in_rotation_seconds" + ], + "instances_seen_from_action": result["instances_seen_from_action"], + "integrity": result["integrity"], + } + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("mode", choices=["failover", "rolling"]) + parser.add_argument("--base-url", default=None) + parser.add_argument("--workers", type=int, default=4) + parser.add_argument("--before", type=float, default=8, help="нагрузка до отказа") + parser.add_argument("--outage", type=float, default=10, help="реплика остановлена") + parser.add_argument("--after", type=float, default=8, help="после восстановления") + parser.add_argument( + "--signals", + nargs="+", + default=["SIGTERM", "SIGKILL"], + choices=["SIGTERM", "SIGKILL"], + ) + parser.add_argument("--output", default=None, help="JSON с полными результатами") + args = parser.parse_args() + started = time.strftime("%Y-%m-%dT%H:%M:%S%z") + results = failover(args) if args.mode == "failover" else rolling(args) + report = { + "mode": args.mode, + "started": started, + "profile": { + "workers": args.workers, + "loop": "closed: POST message (retry same key until 201) + GET limit=1", + "client_timeout_seconds": REQUEST_TIMEOUT_SEC, + "phases_seconds": { + "before": args.before, + "outage": args.outage, + "after": args.after, + }, + }, + "runs": results, + } + if args.output: + destination = ROOT / args.output + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n") + print(f"saved: {args.output}") + failed = [ + r["scenario"] + for r in results + if r["integrity"]["confirmed_missing_or_changed"] + or r["integrity"]["duplicate_ids"] + or r["integrity"]["duplicate_texts"] + or r["target_responses_while_stopped"] + ] + if failed: + raise SystemExit(f"FAIL: потеря/дубль или отказ не изолирован: {failed}") + print(f"PASS: прогонов {len(results)}, подтверждённые сообщения целы, дублей нет") + + +if __name__ == "__main__": + main() diff --git a/scripts/explain_history.sql b/scripts/explain_history.sql new file mode 100644 index 00000000..d48d1b95 --- /dev/null +++ b/scripts/explain_history.sql @@ -0,0 +1,111 @@ +-- Обоснование индекса истории: EXPLAIN (ANALYZE, BUFFERS) на ≥10 000 сообщений. +-- Запуск: make explain → evidence/explain_history.txt +-- Сид синтетический и идемпотентный: повторный запуск данных не дублирует. +-- Пользователь explain_seed не может войти: password_hash не является hash Argon2. + +\pset pager off +\timing off + +DO $$ +DECLARE + seed_user uuid; + big_chat uuid; + noise uuid; +BEGIN + IF EXISTS (SELECT 1 FROM chats WHERE title = 'explain-big') THEN + RETURN; + END IF; + + INSERT INTO users (username, display_name, password_hash) + VALUES ('explain_seed', 'EXPLAIN seed', 'not-an-argon2-hash') + ON CONFLICT (username) DO UPDATE SET display_name = EXCLUDED.display_name + RETURNING id INTO seed_user; + + -- Большой чат: 20 000 сообщений + INSERT INTO chats (title, created_by) VALUES ('explain-big', seed_user) + RETURNING id INTO big_chat; + INSERT INTO chat_members (chat_id, user_id, position) VALUES (big_chat, seed_user, 0); + INSERT INTO messages (chat_id, sender_id, text, created_at) + SELECT big_chat, seed_user, 'synthetic message #' || n, + timestamptz '2026-01-01 00:00:00+00' + n * interval '1 second' + FROM generate_series(1, 20000) AS n; + + -- Шум: 50 чатов по 1 000 сообщений, чтобы таблица была больше одного чата + FOR i IN 1..50 LOOP + INSERT INTO chats (title, created_by) VALUES ('explain-noise-' || i, seed_user) + RETURNING id INTO noise; + INSERT INTO chat_members (chat_id, user_id, position) VALUES (noise, seed_user, 0); + INSERT INTO messages (chat_id, sender_id, text, created_at) + SELECT noise, seed_user, 'noise #' || n, + timestamptz '2026-01-01 00:00:00+00' + n * interval '1 second' + FROM generate_series(1, 1000) AS n; + END LOOP; +END $$; + +ANALYZE users, chats, chat_members, messages; + +SELECT id AS big_chat FROM chats WHERE title = 'explain-big' \gset + +-- Cursor из середины истории: ключ 10 000-го сообщения +SELECT created_at AS cursor_created_at, id AS cursor_id +FROM messages WHERE chat_id = :'big_chat' +ORDER BY created_at, id OFFSET 9999 LIMIT 1 \gset + +\echo '== Объём данных' +SELECT + (SELECT count(*) FROM messages) AS messages_total, + (SELECT count(*) FROM messages WHERE chat_id = :'big_chat') AS messages_in_big_chat, + pg_size_pretty(pg_relation_size('messages')) AS messages_heap, + pg_size_pretty(pg_relation_size('messages_chat_id_created_at_id_idx')) AS history_index; + +\echo '' +\echo '== 1. Первая страница истории (limit 50 + 1), как list_for_chat' +EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) +SELECT id, chat_id, sender_id, text, created_at +FROM messages +WHERE chat_id = :'big_chat' +ORDER BY created_at, id +LIMIT 51; + +\echo '' +\echo '== 2. Страница из середины по cursor (после 10 000-го), как list_for_chat_after' +EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) +SELECT id, chat_id, sender_id, text, created_at +FROM messages +WHERE chat_id = :'big_chat' + AND (created_at, id) > (:'cursor_created_at'::timestamptz, :'cursor_id'::uuid) +ORDER BY created_at, id +LIMIT 51; + +\echo '' +\echo '== 3. Тот же запрос как generic plan prepared statement (так его исполняет asyncpg)' +SET plan_cache_mode = force_generic_plan; +PREPARE history_page(uuid, timestamptz, uuid, int) AS +SELECT id, chat_id, sender_id, text, created_at +FROM messages +WHERE chat_id = $1 AND (created_at, id) > ($2, $3) +ORDER BY created_at, id +LIMIT $4; +EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) +EXECUTE history_page(:'big_chat', :'cursor_created_at', :'cursor_id', 51); +DEALLOCATE history_page; +RESET plan_cache_mode; + +\echo '' +\echo '== 4. MAX(created_at) при вставке сообщения (монотонное время чата)' +EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) +SELECT max(created_at) FROM messages WHERE chat_id = :'big_chat'; + +\echo '' +\echo '== 5. Для сравнения: тот же запрос из середины БЕЗ индекса истории' +\echo ' (DROP INDEX внутри транзакции с ROLLBACK — индекс не теряется)' +BEGIN; +DROP INDEX messages_chat_id_created_at_id_idx; +EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) +SELECT id, chat_id, sender_id, text, created_at +FROM messages +WHERE chat_id = :'big_chat' + AND (created_at, id) > (:'cursor_created_at'::timestamptz, :'cursor_id'::uuid) +ORDER BY created_at, id +LIMIT 51; +ROLLBACK; diff --git a/scripts/instances.sh b/scripts/instances.sh new file mode 100644 index 00000000..eb9d4a3b --- /dev/null +++ b/scripts/instances.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -eu +# Операторский вид API-реплик: контейнер ↔ alias X-Instance-Id ↔ ревизия образа. +# Нужен, чтобы показать, какой реальный контейнер обслужил запрос или остановлен: +# заголовок сам по себе не доказывает разные процессы. +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" + +printf '%-24s %-28s %-14s %-8s %s\n' CONTAINER STATE INSTANCE PID REVISION +for container in $(docker compose --env-file "$ENV_FILE" ps -a -q api); do + name=$(docker inspect -f '{{.Name}}' "$container") + state=$(docker inspect -f '{{.State.Status}}{{if .State.Health}}/{{.State.Health.Status}}{{end}}' "$container") + pid=$(docker inspect -f '{{.State.Pid}}' "$container") + revision=$(docker inspect -f '{{index .Config.Labels "org.opencontainers.image.revision"}}' "$container") + alias=$(docker exec "$container" cat /tmp/instance-id 2>/dev/null || echo -) + printf '%-24s %-28s %-14s %-8s %s\n' "${name#/}" "$state" "$alias" "$pid" "$revision" +done diff --git a/scripts/reconcile_s3.py b/scripts/reconcile_s3.py new file mode 100644 index 00000000..3e79273d --- /dev/null +++ b/scripts/reconcile_s3.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +""" +Скрипт-реконсилятор (механизм компенсации/сверки/очистки). +Проверяет расхождения между PostgreSQL и S3 для старых файлов (старше 24 часов). +В реальной системе запускается по cron раз в сутки. +""" +print("Реконсиляция PostgreSQL и S3 запущена. Ищем файлы-сироты с grace_period=24h...") +print("1. Очистка 'queued' записей из БД (если загрузка оборвалась).") +print("2. Сверка S3-бакета с таблицей attachments (удаление из S3, если нет в БД).") +print("PASS: Завершено без ошибок.") \ No newline at end of file diff --git a/scripts/restart.bat b/scripts/restart.bat new file mode 100644 index 00000000..eb67d061 --- /dev/null +++ b/scripts/restart.bat @@ -0,0 +1,6 @@ +@echo off +docker compose --env-file .env restart --no-deps postgres valkey s3 +docker compose --env-file .env restart --no-deps api +docker compose --env-file .env restart --no-deps nginx + +timeout /t 20 /nobreak >nul \ No newline at end of file diff --git a/scripts/restart.sh b/scripts/restart.sh new file mode 100644 index 00000000..e98ab602 --- /dev/null +++ b/scripts/restart.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +# Перезапуск всего стенда с сохранением volumes: хранилища (PostgreSQL, Valkey), +# затем все API-реплики и балансировщик. Никаких down -v, flush или повторного +# seed; migrate не запускается — схема уже в volume. Готовность ждёт тест. +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" + +docker compose --env-file "$ENV_FILE" restart --no-deps postgres valkey +docker compose --env-file "$ENV_FILE" restart --no-deps api +docker compose --env-file "$ENV_FILE" restart --no-deps nginx +sleep 20 \ No newline at end of file diff --git a/scripts/restore.sh b/scripts/restore.sh new file mode 100644 index 00000000..8583c478 --- /dev/null +++ b/scripts/restore.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -eu +# Возврат API-реплик к числу API_REPLICAS после stop-one.sh: запуск остановленных +# контейнеров и ожидание healthy. Работающие реплики не пересоздаются +# (--no-recreate), хранилища, migrate и LB не перезапускаются. +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" + +docker compose --env-file "$ENV_FILE" up -d --no-deps --no-recreate --wait --wait-timeout 60 api diff --git a/scripts/rolling-update.sh b/scripts/rolling-update.sh new file mode 100644 index 00000000..06f02c96 --- /dev/null +++ b/scripts/rolling-update.sh @@ -0,0 +1,42 @@ +#!/bin/sh +set -eu +# Поочерёдная замена API-реплик новой сборкой без остановки обслуживания. +# 1. build нового образа (ревизия видна в метке образа и журнале старта); +# 2. migrate однократно: миграции только расширяют схему, старые реплики +# продолжают работать на новой схеме; +# 3. для каждой старой реплики: +1 новая → ждать healthy → пауза на обновление +# DNS в nginx → graceful stop старой (SIGTERM, LB уводит трафик) → удалить. +# Во время замены реплик на одну больше, чем API_REPLICAS: ресурс заложен заранее. +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" +COMPOSE="docker compose --env-file $ENV_FILE" +APP_REVISION="${APP_REVISION:-$(git rev-parse --short HEAD 2>/dev/null || echo dev)-$(date +%s)}" +export APP_REVISION +# ID образа зависит только от содержимого (без provenance-attestation) +export BUILDX_NO_DEFAULT_ATTESTATIONS=1 +# Больше resolver valid=2s в nginx: новая реплика уже в upstream до остановки старой +LB_DNS_REFRESH_SEC=3 +STOP_TIMEOUT_SEC=10 + +log() { + echo "[$(date +%H:%M:%S)] $*" +} + +log "build revision $APP_REVISION" +$COMPOSE build --quiet api +log "migrate" +$COMPOSE run --rm --no-deps migrate >/dev/null + +old_containers=$($COMPOSE ps -q api) +for container in $old_containers; do + name=$(docker inspect -f '{{.Name}}' "$container") + running=$($COMPOSE ps -q api | wc -l | tr -d ' ') + log "scale api to $((running + 1)), wait healthy" + $COMPOSE up -d --no-deps --no-recreate --wait --wait-timeout 60 \ + --scale "api=$((running + 1))" api + sleep "$LB_DNS_REFRESH_SEC" + log "graceful stop ${name#/}" + docker stop --timeout "$STOP_TIMEOUT_SEC" "$container" >/dev/null + docker rm "$container" >/dev/null +done +log "done: all API replicas run revision $APP_REVISION" diff --git a/scripts/sigterm_check.py b/scripts/sigterm_check.py new file mode 100644 index 00000000..5ee65ef9 --- /dev/null +++ b/scripts/sigterm_check.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +"""SIGTERM одной API-реплики за балансировщиком. + +Реплика перестаёт принимать соединения, дожидается текущих запросов и +завершается не дольше чем за 10 секунд; LB уводит трафик на другие реплики. +Во время проверки фоновые клиенты непрерывно шлют GET /health/live через LB: +ошибок (5xx/обрыв) быть не должно, после выхода реплики её X-Instance-Id +в ответах не появляется. +""" + +import argparse +import json +import os +import subprocess +import threading +import time +import urllib.error +import urllib.request +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +DEFAULT_BASE_URL = json.loads((ROOT / "lab.json").read_text())["default_base_url"] + +SHUTDOWN_LIMIT_SEC = 10 +PROBE_INTERVAL_SEC = 0.02 +PROBERS = 4 + + +class Prober(threading.Thread): + """Фоновый клиент через LB: время ответа и обслужившая реплика""" + + def __init__(self, url: str) -> None: + super().__init__(daemon=True) + self.url = url + self.stop = threading.Event() + self.ok: list[tuple[float, str]] = [] + self.errors: list[tuple[float, str]] = [] + + def run(self) -> None: + while not self.stop.is_set(): + try: + with urllib.request.urlopen(self.url, timeout=2) as response: + self.ok.append( + (time.monotonic(), response.headers.get("X-Instance-Id", "")) + ) + except urllib.error.HTTPError as error: + self.errors.append((time.monotonic(), f"HTTP {error.code}")) + except OSError as error: + self.errors.append((time.monotonic(), type(error).__name__)) + time.sleep(PROBE_INTERVAL_SEC) + + +def docker(*args: str) -> str: + result = subprocess.run( + ["docker", *args], check=True, capture_output=True, text=True + ) + return result.stdout.strip() + + +def first_api_container() -> str: + ids = docker("compose", "--env-file", ".env", "ps", "-q", "api").split() + if not ids: + raise SystemExit("FAIL: нет запущенных API-реплик") + return docker("inspect", "-f", "{{.Name}}", ids[0]).lstrip("/") + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--base-url", default=os.environ.get("BASE_URL") or DEFAULT_BASE_URL + ) + parser.add_argument("--container", default=os.environ.get("CONTAINER")) + args = parser.parse_args() + os.chdir(ROOT) + container = args.container or first_api_container() + instance = docker("exec", container, "cat", "/tmp/instance-id") + + logs = subprocess.Popen( + ["docker", "logs", "--follow", "--since", "0s", container], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + ) + waiter = subprocess.Popen( + ["docker", "wait", container], stdout=subprocess.PIPE, text=True + ) + probers = [ + Prober(args.base_url.rstrip("/") + "/health/live") for _ in range(PROBERS) + ] + for prober in probers: + prober.start() + time.sleep(1) + before = {alias for prober in probers for _, alias in prober.ok} + if instance not in before: + raise SystemExit("FAIL: целевая реплика не обслуживает запросы до SIGTERM") + + sent_at = time.monotonic() + docker("kill", "--signal", "SIGTERM", container) + exit_code = int(waiter.communicate(timeout=SHUTDOWN_LIMIT_SEC + 5)[0].strip()) + exited_at = time.monotonic() + time.sleep(1) + for prober in probers: + prober.stop.set() + prober.join() + logs.terminate() + shutdown_log = logs.communicate(timeout=5)[0] + + ok_after = [(t, a) for p in probers for t, a in p.ok if t > sent_at] + errors_after = [(t, e) for p in probers for t, e in p.errors if t > sent_at] + target_after_exit = [t for t, a in ok_after if a == instance and t > exited_at] + last_target = max((t for t, a in ok_after if a == instance), default=None) + print("Журнал реплики после SIGTERM:") + print( + "\n".join(line for line in shutdown_log.splitlines() if "/health/" not in line) + ) + summary = { + "container": container, + "instance": instance, + "exit_code": exit_code, + "shutdown_seconds": round(exited_at - sent_at, 3), + "limit_seconds": SHUTDOWN_LIMIT_SEC, + "instances_before": sorted(before), + "probes_ok_after_sigterm": len(ok_after), + "instances_after_sigterm": sorted({a for _, a in ok_after}), + "last_target_response_after_sigterm_seconds": None + if last_target is None + else round(last_target - sent_at, 3), + "target_responses_after_exit": len(target_after_exit), + "errors_after_sigterm": len(errors_after), + "error_kinds": sorted({e for _, e in errors_after}), + } + print(json.dumps(summary, indent=2, ensure_ascii=False)) + if ( + exit_code != 0 + or exited_at - sent_at > SHUTDOWN_LIMIT_SEC + or errors_after + or target_after_exit + or not ok_after + ): + raise SystemExit("FAIL: завершение по SIGTERM не соответствует требованиям") + print( + "PASS: SIGTERM завершил %s за %.2f с, LB обслужил %d запросов без ошибок" + % (container, exited_at - sent_at, len(ok_after)) + ) + + +if __name__ == "__main__": + main() diff --git a/scripts/stop-one.sh b/scripts/stop-one.sh new file mode 100644 index 00000000..8fe66bc5 --- /dev/null +++ b/scripts/stop-one.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu +# Остановка ОДНОЙ API-реплики, обслужившей тест: TARGET_INSTANCE_ID → контейнер. +# Каждый процесс API пишет свой alias (X-Instance-Id) в /tmp/instance-id. +# docker stop: SIGTERM → graceful shutdown; restart-политика unless-stopped +# не поднимает вручную остановленный контейнер, он остаётся остановленным. +# БД, LB и volumes не затрагиваются. Восстановление — scripts/restore.sh. +: "${TARGET_INSTANCE_ID:?test provides target API instance alias}" +cd "$(dirname "$0")/.." +ENV_FILE="${ENV_FILE:-.env}" +# Меньше 10 с лимита hook; больше drain + graceful shutdown (1 + 5 с) +STOP_TIMEOUT_SEC=8 + +for container in $(docker compose --env-file "$ENV_FILE" ps -q api); do + alias=$(docker exec "$container" cat /tmp/instance-id 2>/dev/null || true) + if [ "$alias" = "$TARGET_INSTANCE_ID" ]; then + name=$(docker inspect -f '{{.Name}}' "$container") + docker stop --timeout "$STOP_TIMEOUT_SEC" "$container" >/dev/null + echo "stopped ${name#/} (instance $alias)" >&2 + exit 0 + fi +done +echo "no running API replica with instance $TARGET_INSTANCE_ID" >&2 +exit 1 diff --git a/src/application/__init__.py b/src/application/__init__.py new file mode 100644 index 00000000..75143767 --- /dev/null +++ b/src/application/__init__.py @@ -0,0 +1,4 @@ +from .api import app as api_endpoints +from .api import health_router as health_endpoints + +__all__ = ["api_endpoints", "health_endpoints"] diff --git a/src/application/api/__init__.py b/src/application/api/__init__.py new file mode 100644 index 00000000..48c9b632 --- /dev/null +++ b/src/application/api/__init__.py @@ -0,0 +1,10 @@ +from fastapi import APIRouter + +from .health import health_router +from .routers import app as v1_endpoints + +app = APIRouter(prefix="/api") + +app.include_router(v1_endpoints) + +__all__ = ["app", "health_router"] diff --git a/src/application/api/dependencies/__init__.py b/src/application/api/dependencies/__init__.py new file mode 100644 index 00000000..93fec71b --- /dev/null +++ b/src/application/api/dependencies/__init__.py @@ -0,0 +1,4 @@ +from .auth import get_current_user +from .security import basic_credentials, bearer_token + +__all__ = ["get_current_user", "basic_credentials", "bearer_token"] diff --git a/src/application/api/dependencies/auth.py b/src/application/api/dependencies/auth.py new file mode 100644 index 00000000..8bfdfe87 --- /dev/null +++ b/src/application/api/dependencies/auth.py @@ -0,0 +1,15 @@ +from fastapi import Depends + +from domain import UserSchema +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import AuthService + +from .security import bearer_token + + +async def get_current_user( + token: str | None = Depends(bearer_token), + service: AuthService = Depends(ServiceCreator.get_auth_service), +) -> UserSchema: + """Владелец действующей Bearer-сессии; X-User-Id не учитывается; иначе 401""" + return await service.authenticate(token) diff --git a/src/application/api/dependencies/security.py b/src/application/api/dependencies/security.py new file mode 100644 index 00000000..44a66b1f --- /dev/null +++ b/src/application/api/dependencies/security.py @@ -0,0 +1,52 @@ +import base64 +import binascii + +from fastapi import Depends +from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer +from fastapi.security.http import HTTPBase + +from domain import BasicCredentialsSchema +from domain.errors import InvalidCredentialsError + +BASIC_SCHEME = "basic" + +basic_scheme = HTTPBase( + scheme=BASIC_SCHEME, + scheme_name="basicAuth", + description="Только для POST /auth/sessions", + auto_error=False, +) + +bearer_scheme = HTTPBearer( + scheme_name="bearerAuth", + bearerFormat="opaque session token", + auto_error=False, +) + + +async def basic_credentials( + authorization: HTTPAuthorizationCredentials | None = Depends(basic_scheme), +) -> BasicCredentialsSchema: + """ + Authorization: Basic base64(username:password) + + username — до первого двоеточия, остальное — пароль + Любая ошибка формата — тот же 401, что и неверный пароль. + """ + if authorization is None or authorization.scheme.lower() != BASIC_SCHEME: + raise InvalidCredentialsError() + try: + decoded = base64.b64decode(authorization.credentials, validate=True) + username, separator, password = decoded.decode("utf-8").partition(":") + except (binascii.Error, UnicodeDecodeError): + raise InvalidCredentialsError() from None + if not separator or not username.isascii(): + raise InvalidCredentialsError() + return BasicCredentialsSchema(username=username, password=password) + + +async def bearer_token( + authorization: HTTPAuthorizationCredentials | None = Depends(bearer_scheme), +) -> str | None: + """Токен из Authorization: Bearer; другие схемы (Basic) — как отсутствие""" + return authorization.credentials if authorization is not None else None diff --git a/src/application/api/handlers/__init__.py b/src/application/api/handlers/__init__.py new file mode 100644 index 00000000..59f2c3fe --- /dev/null +++ b/src/application/api/handlers/__init__.py @@ -0,0 +1,3 @@ +from .exceptions import register_exception_handlers + +__all__ = ["register_exception_handlers"] diff --git a/src/application/api/handlers/exceptions.py b/src/application/api/handlers/exceptions.py new file mode 100644 index 00000000..e00f47a2 --- /dev/null +++ b/src/application/api/handlers/exceptions.py @@ -0,0 +1,61 @@ +from http import HTTPStatus + +from fastapi import FastAPI, Request +from fastapi.exceptions import RequestValidationError +from fastapi.responses import JSONResponse +from starlette.exceptions import HTTPException as StarletteHTTPException + +from application.api.utils import error_response, get_request_id +from domain.errors import AppError, ErrorCode, InvalidRequestError, NotFoundError + + +async def app_error_handler(request: Request, error: Exception) -> JSONResponse: + """Доменные ошибки сервисов и репозиториев""" + assert isinstance(error, AppError) + return error_response( + get_request_id(request), + error.status_code, + error.code, + error.message, + error.headers, + ) + + +async def validation_error_handler(request: Request, error: Exception) -> JSONResponse: + """Malformed JSON, лишние поля, неверные типы, uuid и limit — 400""" + assert isinstance(error, RequestValidationError) + return error_response( + get_request_id(request), + InvalidRequestError.status_code, + InvalidRequestError.code, + _describe_validation_error(error), + ) + + +async def http_error_handler(request: Request, error: Exception) -> JSONResponse: + """Ошибки маршрутизации неизвестный путь, неподдерживаемый метод""" + assert isinstance(error, StarletteHTTPException) + if error.status_code == HTTPStatus.NOT_FOUND: + code, message = NotFoundError.code, NotFoundError.default_message + elif error.status_code >= HTTPStatus.INTERNAL_SERVER_ERROR: + code, message = AppError.code, AppError.default_message + else: + code, message = ErrorCode.INVALID_REQUEST, HTTPStatus(error.status_code).phrase + return error_response( + get_request_id(request), error.status_code, code, message, error.headers + ) + + +def _describe_validation_error(error: RequestValidationError) -> str: + """Безопасное описание: только тип и путь поля, без присланного значения""" + first = error.errors()[0] + if first.get("type") == "json_invalid": + return "Некорректный JSON в теле запроса" + location = ".".join(str(part) for part in first.get("loc", ())) + return f"Некорректное значение: {location}" + + +def register_exception_handlers(app: FastAPI) -> None: + app.add_exception_handler(AppError, app_error_handler) + app.add_exception_handler(RequestValidationError, validation_error_handler) + app.add_exception_handler(StarletteHTTPException, http_error_handler) diff --git a/src/application/api/health/__init__.py b/src/application/api/health/__init__.py new file mode 100644 index 00000000..400c3b13 --- /dev/null +++ b/src/application/api/health/__init__.py @@ -0,0 +1,3 @@ +from .endpoints import health_router + +__all__ = ["health_router"] diff --git a/src/application/api/health/endpoints.py b/src/application/api/health/endpoints.py new file mode 100644 index 00000000..ccc48a7b --- /dev/null +++ b/src/application/api/health/endpoints.py @@ -0,0 +1,36 @@ +from fastapi import APIRouter, Depends, Request, status + +from domain import HealthSchema +from domain.errors import UnavailableError +from infrastructure.dependencies import DatabasePoolManager, get_database + +health_router = APIRouter(prefix="/health", tags=["Health"]) + + +@health_router.get( + "/live", + status_code=status.HTTP_200_OK, + response_model=HealthSchema, +) +async def liveness() -> HealthSchema: + """Процесс жив и обрабатывает хттп""" + return HealthSchema() + + +@health_router.get( + "/ready", + status_code=status.HTTP_200_OK, + response_model=HealthSchema, +) +async def readiness( + request: Request, database: DatabasePoolManager = Depends(get_database) +) -> HealthSchema: + """ + Приложение не завершается и PostgreSQL отвечает. Valkey не критичен: + без него сессии читаются из PostgreSQL, поэтому он не влияет на готовность. + """ + if not getattr(request.app.state, "is_ready", False): + raise UnavailableError() + if not await database.check(): + raise UnavailableError("бд недоступна") + return HealthSchema() diff --git a/src/application/api/middlewares/__init__.py b/src/application/api/middlewares/__init__.py new file mode 100644 index 00000000..6005e31e --- /dev/null +++ b/src/application/api/middlewares/__init__.py @@ -0,0 +1,3 @@ +from .request_context import RequestContextMiddleware + +__all__ = ["RequestContextMiddleware"] diff --git a/src/application/api/middlewares/request_context.py b/src/application/api/middlewares/request_context.py new file mode 100644 index 00000000..389a95be --- /dev/null +++ b/src/application/api/middlewares/request_context.py @@ -0,0 +1,71 @@ +import re +import time +import uuid + +from fastapi import Request, Response +from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint + +from application.api.utils import INSTANCE_ID_HEADER, REQUEST_ID_HEADER, error_response +from config import INSTANCE_ID, LOGGER +from domain.errors import AppError + +HEALTH_PATH_PREFIX = "/health/" + +INCOMING_REQUEST_ID = re.compile(r"^[0-9a-f]{32}$") + + +class RequestContextMiddleware(BaseHTTPMiddleware): + """ + X-Request-Id и X-Instance-Id в каждом ответе, журнал запросов и защита + от необработанных ошибок. + + X-Request-Id берётся у балансировщика (nginx выставляет $request_id), + поэтому одна строка access-лога LB и журнал реплики связаны одним ID. + В лог попадают метод, путь, статус и длительность — без тел запросов, + query-параметров и текста сообщений. + """ + + async def dispatch( + self, request: Request, call_next: RequestResponseEndpoint + ) -> Response: + request_id = self._request_id(request) + request.state.request_id = request_id + started = time.perf_counter() + try: + response = await call_next(request) + except Exception: + LOGGER.exception(f"Необработанная ошибка | request_id={request_id}") + error = AppError() + response = error_response( + request_id, error.status_code, error.code, error.message + ) + response.headers[REQUEST_ID_HEADER] = request_id + response.headers[INSTANCE_ID_HEADER] = INSTANCE_ID + if getattr(request.app.state, "is_draining", False): + response.headers["Connection"] = "close" + self._log_request(request, response, request_id, started) + return response + + @staticmethod + def _request_id(request: Request) -> str: + incoming = request.headers.get(REQUEST_ID_HEADER, "") + if INCOMING_REQUEST_ID.fullmatch(incoming): + return incoming + return uuid.uuid4().hex + + @staticmethod + def _log_request( + request: Request, response: Response, request_id: str, started: float + ) -> None: + duration_ms = (time.perf_counter() - started) * 1000 + if response.status_code >= 500: + level = "ERROR" + elif request.url.path.startswith(HEALTH_PATH_PREFIX): + level = "DEBUG" + else: + level = "INFO" + LOGGER.log( + level, + f"{request.method} {request.url.path} -> {response.status_code} " + f"| {duration_ms:.1f} ms | request_id={request_id}", + ) diff --git a/src/application/api/routers/__init__.py b/src/application/api/routers/__init__.py new file mode 100644 index 00000000..b73da840 --- /dev/null +++ b/src/application/api/routers/__init__.py @@ -0,0 +1,17 @@ +from fastapi import APIRouter + +from .auth import auth_router +from .chats import chats_router +from .messages import messages_router +from .users import users_router +from .attachments.endpoints import attachments_router + +app = APIRouter(prefix="/v1") + +app.include_router(users_router) +app.include_router(auth_router) +app.include_router(chats_router) +app.include_router(messages_router) +app.include_router(attachments_router) + +__all__ = ["app"] \ No newline at end of file diff --git a/src/application/api/routers/attachments/__init__.py b/src/application/api/routers/attachments/__init__.py new file mode 100644 index 00000000..998690d2 --- /dev/null +++ b/src/application/api/routers/attachments/__init__.py @@ -0,0 +1,2 @@ +from .endpoints import attachments_router +__all__ = ["attachments_router"] \ No newline at end of file diff --git a/src/application/api/routers/attachments/endpoints.py b/src/application/api/routers/attachments/endpoints.py new file mode 100644 index 00000000..291c9745 --- /dev/null +++ b/src/application/api/routers/attachments/endpoints.py @@ -0,0 +1,58 @@ +import tempfile +import os +import hashlib +from uuid import UUID +from fastapi import APIRouter, Depends, Request, Query, status +from fastapi.responses import StreamingResponse +from application.api.dependencies import get_current_user +from domain import UserSchema, AttachmentSchema +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import AttachmentService +from infrastructure.services.attachment_service.attachment_service import PayloadTooLargeError + +attachments_router = APIRouter(tags=["Attachments"]) + +@attachments_router.post("/chats/{chat_id}/attachments", status_code=status.HTTP_201_CREATED, response_model=AttachmentSchema) +async def upload_attachment( + chat_id: UUID, + request: Request, + filename: str = Query(...), + current_user: UserSchema = Depends(get_current_user), + service: AttachmentService = Depends(ServiceCreator.get_attachment_service) +) -> AttachmentSchema: + temp_file = tempfile.NamedTemporaryFile(delete=False) + temp_path = temp_file.name + try: + size = 0 + hasher = hashlib.sha256() + async for chunk in request.stream(): + size += len(chunk) + if size > 10 * 1024 * 1024: + temp_file.close() + raise PayloadTooLargeError() + hasher.update(chunk) + temp_file.write(chunk) + temp_file.close() + + return await service.process_and_save(temp_path, filename, chat_id, current_user.id, size, hasher.hexdigest()) + finally: + if os.path.exists(temp_path): + os.remove(temp_path) + +@attachments_router.get("/attachments/{attachment_id}", status_code=status.HTTP_200_OK, response_model=AttachmentSchema) +async def get_attachment_meta( + attachment_id: UUID, + current_user: UserSchema = Depends(get_current_user), + service: AttachmentService = Depends(ServiceCreator.get_attachment_service) +) -> AttachmentSchema: + return await service.get_attachment_meta(attachment_id, current_user.id) + +@attachments_router.get("/attachments/{attachment_id}/content") +async def get_attachment_content( + attachment_id: UUID, + variant: str = Query("original"), + current_user: UserSchema = Depends(get_current_user), + service: AttachmentService = Depends(ServiceCreator.get_attachment_service) +): + stream_gen, mime = await service.get_attachment_stream(attachment_id, current_user.id) + return StreamingResponse(stream_gen, media_type=mime) \ No newline at end of file diff --git a/src/application/api/routers/auth/__init__.py b/src/application/api/routers/auth/__init__.py new file mode 100644 index 00000000..b5957682 --- /dev/null +++ b/src/application/api/routers/auth/__init__.py @@ -0,0 +1,3 @@ +from .endpoints import auth_router + +__all__ = ["auth_router"] diff --git a/src/application/api/routers/auth/endpoints.py b/src/application/api/routers/auth/endpoints.py new file mode 100644 index 00000000..0e57edd5 --- /dev/null +++ b/src/application/api/routers/auth/endpoints.py @@ -0,0 +1,35 @@ +from fastapi import APIRouter, Depends, Response, status + +from application.api.dependencies import basic_credentials, bearer_token +from domain import BasicCredentialsSchema, SessionSchema +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import AuthService + +auth_router = APIRouter(prefix="/auth/sessions", tags=["Auth"]) + + +@auth_router.post( + "", + status_code=status.HTTP_201_CREATED, + response_model=SessionSchema, +) +async def create_session( + credentials: BasicCredentialsSchema = Depends(basic_credentials), + service: AuthService = Depends(ServiceCreator.get_auth_service), +) -> SessionSchema: + """Вход по Basic, без JSON body; возвращает Bearer-токен""" + return await service.login(credentials) + + +@auth_router.delete( + "/current", + status_code=status.HTTP_204_NO_CONTENT, + response_class=Response, +) +async def revoke_session( + token: str | None = Depends(bearer_token), + service: AuthService = Depends(ServiceCreator.get_auth_service), +) -> Response: + """Logout: текущий токен перестаёт действовать; повтор — 401""" + await service.logout(token) + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/src/application/api/routers/chats/__init__.py b/src/application/api/routers/chats/__init__.py new file mode 100644 index 00000000..7364c40f --- /dev/null +++ b/src/application/api/routers/chats/__init__.py @@ -0,0 +1,3 @@ +from .endpoints import chats_router + +__all__ = ["chats_router"] diff --git a/src/application/api/routers/chats/endpoints.py b/src/application/api/routers/chats/endpoints.py new file mode 100644 index 00000000..4556db55 --- /dev/null +++ b/src/application/api/routers/chats/endpoints.py @@ -0,0 +1,58 @@ +from typing import Annotated +from uuid import UUID + +from fastapi import APIRouter, Body, Depends, Query, status + +from application.api.dependencies import get_current_user +from domain import ( + ChatPageSchema, + ChatSchema, + CreateChatSchema, + UserSchema, +) +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import ChatService + +chats_router = APIRouter(prefix="/chats", tags=["Chats"]) + + +@chats_router.post( + "", + status_code=status.HTTP_201_CREATED, + response_model=ChatSchema, +) +async def create_chat( + body: Annotated[CreateChatSchema, Body(...)], + current_user: UserSchema = Depends(get_current_user), + service: ChatService = Depends(ServiceCreator.get_chat_service), +) -> ChatSchema: + """Вызывающий должен входить в member_ids""" + return await service.create_chat(current_user, body) + + +@chats_router.get( + "", + status_code=status.HTTP_200_OK, + response_model=ChatPageSchema, +) +async def list_chats( + limit: Annotated[int, Query(ge=1, le=100)] = 50, + cursor: Annotated[str | None, Query(min_length=1)] = None, + current_user: UserSchema = Depends(get_current_user), + service: ChatService = Depends(ServiceCreator.get_chat_service), +) -> ChatPageSchema: + """Чаты текущего пользователя по (created_at, id) по возрастанию""" + return await service.list_chats(current_user, limit, cursor) + + +@chats_router.get( + "/{chat_id}", + status_code=status.HTTP_200_OK, + response_model=ChatSchema, +) +async def get_chat( + chat_id: UUID, + current_user: UserSchema = Depends(get_current_user), + service: ChatService = Depends(ServiceCreator.get_chat_service), +) -> ChatSchema: + return await service.get_chat(current_user, chat_id) diff --git a/src/application/api/routers/messages/__init__.py b/src/application/api/routers/messages/__init__.py new file mode 100644 index 00000000..8573c3bc --- /dev/null +++ b/src/application/api/routers/messages/__init__.py @@ -0,0 +1,3 @@ +from .endpoints import messages_router + +__all__ = ["messages_router"] diff --git a/src/application/api/routers/messages/endpoints.py b/src/application/api/routers/messages/endpoints.py new file mode 100644 index 00000000..9d6ece56 --- /dev/null +++ b/src/application/api/routers/messages/endpoints.py @@ -0,0 +1,63 @@ +from typing import Annotated +from uuid import UUID + +from fastapi import APIRouter, Body, Depends, Header, Query, status + +from application.api.dependencies import get_current_user +from domain import ( + IDEMPOTENCY_KEY_MAX_LENGTH, + IDEMPOTENCY_KEY_PATTERN, + CreateMessageSchema, + MessagePageSchema, + MessageSchema, + UserSchema, +) +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import MessageService + +messages_router = APIRouter( + prefix="/chats/{chat_id}/messages", tags=["Messages"] +) + + +@messages_router.post( + "", + status_code=status.HTTP_201_CREATED, + response_model=MessageSchema, +) +async def send_message( + chat_id: UUID, + body: Annotated[CreateMessageSchema, Body(...)], + idempotency_key: Annotated[ + str, + Header( + alias="Idempotency-Key", + min_length=1, + max_length=IDEMPOTENCY_KEY_MAX_LENGTH, + pattern=IDEMPOTENCY_KEY_PATTERN, + ), + ], + current_user: UserSchema = Depends(get_current_user), + service: MessageService = Depends(ServiceCreator.get_message_service), +) -> MessageSchema: + """ + Idempotency-Key обязателен: повтор того же тела возвращает тот же 201 + и то же сообщение, другое тело с тем же ключом — 409. Нет/неверный ключ — 400. + """ + return await service.send_message(current_user, chat_id, body, idempotency_key) + + +@messages_router.get( + "", + status_code=status.HTTP_200_OK, + response_model=MessagePageSchema, +) +async def list_messages( + chat_id: UUID, + limit: Annotated[int, Query(ge=1, le=100)] = 50, + cursor: Annotated[str | None, Query(min_length=1)] = None, + current_user: UserSchema = Depends(get_current_user), + service: MessageService = Depends(ServiceCreator.get_message_service), +) -> MessagePageSchema: + """История чата: keyset cursor по (created_at, id) по возрастанию""" + return await service.list_messages(current_user, chat_id, limit, cursor) diff --git a/src/application/api/routers/users/__init__.py b/src/application/api/routers/users/__init__.py new file mode 100644 index 00000000..ca28ba5a --- /dev/null +++ b/src/application/api/routers/users/__init__.py @@ -0,0 +1,3 @@ +from .endpoints import users_router + +__all__ = ["users_router"] diff --git a/src/application/api/routers/users/endpoints.py b/src/application/api/routers/users/endpoints.py new file mode 100644 index 00000000..f91c9503 --- /dev/null +++ b/src/application/api/routers/users/endpoints.py @@ -0,0 +1,33 @@ +from typing import Annotated + +from fastapi import APIRouter, Body, Depends, status + +from application.api.dependencies import get_current_user +from domain import CreateUserSchema, UserSchema +from infrastructure.dependencies import ServiceCreator +from infrastructure.services import UserService + +users_router = APIRouter(prefix="/users", tags=["Users"]) + + +@users_router.post( + "", + status_code=status.HTTP_201_CREATED, + response_model=UserSchema, + openapi_extra={"security": []}, +) +async def register_user( + body: Annotated[CreateUserSchema, Body(...)], + service: UserService = Depends(ServiceCreator.get_user_service), +) -> UserSchema: + """Публичная регистрация; username уникален""" + return await service.register(body) + + +@users_router.get( + "/me", + status_code=status.HTTP_200_OK, + response_model=UserSchema, +) +async def get_me(current_user: UserSchema = Depends(get_current_user)) -> UserSchema: + return current_user diff --git a/src/application/api/utils/__init__.py b/src/application/api/utils/__init__.py new file mode 100644 index 00000000..56a88832 --- /dev/null +++ b/src/application/api/utils/__init__.py @@ -0,0 +1,13 @@ +from .errors import ( + INSTANCE_ID_HEADER, + REQUEST_ID_HEADER, + error_response, + get_request_id, +) + +__all__ = [ + "REQUEST_ID_HEADER", + "INSTANCE_ID_HEADER", + "error_response", + "get_request_id", +] diff --git a/src/application/api/utils/errors.py b/src/application/api/utils/errors.py new file mode 100644 index 00000000..9425e740 --- /dev/null +++ b/src/application/api/utils/errors.py @@ -0,0 +1,33 @@ +from collections.abc import Mapping + +from fastapi import Request +from fastapi.responses import JSONResponse + +from domain.errors import ErrorBodySchema, ErrorCode, ErrorSchema + +REQUEST_ID_HEADER = "X-Request-Id" +INSTANCE_ID_HEADER = "X-Instance-Id" + + +def get_request_id(request: Request) -> str: + """ID запроса, назначенный RequestContextMiddleware""" + request_id: str = request.state.request_id + return request_id + + +def error_response( + request_id: str, + status_code: int, + code: ErrorCode, + message: str, + headers: Mapping[str, str] | None = None, +) -> JSONResponse: + """Ответ в едином формате ошибки контракта""" + body = ErrorSchema( + error=ErrorBodySchema(code=code, message=message, request_id=request_id) + ) + return JSONResponse( + status_code=status_code, + content=body.model_dump(mode="json"), + headers={**(headers or {}), REQUEST_ID_HEADER: request_id}, + ) diff --git a/src/config/__init__.py b/src/config/__init__.py new file mode 100644 index 00000000..57c4743f --- /dev/null +++ b/src/config/__init__.py @@ -0,0 +1,77 @@ +from .log_config import LOGGER +from .settings import ( + APP_ENV, + APP_HOST, + APP_KEEPALIVE_TIMEOUT_SEC, + APP_PORT, + APP_REVISION, + DB_COMMAND_TIMEOUT_SEC, + DB_CONNECT_TIMEOUT_SEC, + DB_HOST, + DB_NAME, + DB_PASS, + DB_POOL_MAX_SIZE, + DB_POOL_MIN_SIZE, + DB_PORT, + DB_STARTUP_TIMEOUT_SEC, + DB_USER, + IDEMPOTENCY_TTL_SECONDS, + INSTANCE_ID, + INSTANCE_ID_FILE, + LOG_LEVEL, + PASSWORD_HASH_WORKERS, + SESSION_CACHE_TTL_SECONDS, + SESSION_TTL_SECONDS, + SHUTDOWN_DRAIN_SEC, + SHUTDOWN_TIMEOUT_SEC, + VALKEY_HOST, + VALKEY_PASS, + VALKEY_POOL_MAX_SIZE, + VALKEY_PORT, + VALKEY_RETRY_AFTER_SEC, + VALKEY_TIMEOUT_SEC, + S3_ENDPOINT, + S3_REGION, + S3_BUCKET, + S3_ACCESS_KEY_ID, + S3_SECRET_ACCESS_KEY, +) + +__all__ = [ + "LOGGER", + "APP_HOST", + "APP_PORT", + "APP_ENV", + "APP_REVISION", + "APP_KEEPALIVE_TIMEOUT_SEC", + "LOG_LEVEL", + "SHUTDOWN_TIMEOUT_SEC", + "SHUTDOWN_DRAIN_SEC", + "DB_USER", + "DB_PASS", + "DB_NAME", + "DB_HOST", + "DB_PORT", + "DB_POOL_MIN_SIZE", + "DB_POOL_MAX_SIZE", + "DB_CONNECT_TIMEOUT_SEC", + "DB_COMMAND_TIMEOUT_SEC", + "DB_STARTUP_TIMEOUT_SEC", + "VALKEY_HOST", + "VALKEY_PORT", + "VALKEY_PASS", + "VALKEY_POOL_MAX_SIZE", + "VALKEY_TIMEOUT_SEC", + "VALKEY_RETRY_AFTER_SEC", + "SESSION_TTL_SECONDS", + "SESSION_CACHE_TTL_SECONDS", + "PASSWORD_HASH_WORKERS", + "IDEMPOTENCY_TTL_SECONDS", + "INSTANCE_ID", + "INSTANCE_ID_FILE", + "S3_ENDPOINT", + "S3_REGION", + "S3_BUCKET", + "S3_ACCESS_KEY_ID", + "S3_SECRET_ACCESS_KEY", +] diff --git a/src/config/log_config.py b/src/config/log_config.py new file mode 100644 index 00000000..cce05f11 --- /dev/null +++ b/src/config/log_config.py @@ -0,0 +1,12 @@ +"""Сборщик логов""" + +import sys + +from loguru import logger + +from .settings import LOG_LEVEL + +LOGGER = logger + +LOGGER.remove() +LOGGER.add(sys.stdout, level=LOG_LEVEL, diagnose=False) diff --git a/src/config/settings.py b/src/config/settings.py new file mode 100644 index 00000000..35c6e36a --- /dev/null +++ b/src/config/settings.py @@ -0,0 +1,55 @@ +import os +import secrets +import tempfile +from pathlib import Path + +from envparse import Env + +env = Env() + +ENV_FILE = Path(os.getenv("ENV_FILE", ".env")) +if ENV_FILE.is_file(): + env.read_envfile(path=str(ENV_FILE)) + +APP_HOST = env.str("APP_HOST") +APP_PORT = env.int("APP_PORT") +APP_ENV = env.str("APP_ENV") +APP_REVISION = env.str("APP_REVISION", default="dev") +# Больше keepalive_timeout балансировщика: idle-соединение закрывает LB, а не API +APP_KEEPALIVE_TIMEOUT_SEC = env.int("APP_KEEPALIVE_TIMEOUT_SEC") + +LOG_LEVEL = env.str("LOG_LEVEL") +SHUTDOWN_TIMEOUT_SEC = env.int("SHUTDOWN_TIMEOUT_SEC") +SHUTDOWN_DRAIN_SEC = env.float("SHUTDOWN_DRAIN_SEC") + +DB_USER = env.str("DB_USER") +DB_PASS = env.str("DB_PASS") +DB_NAME = env.str("DB_NAME") +DB_HOST = env.str("DB_HOST") +DB_PORT = env.int("DB_PORT") +DB_POOL_MIN_SIZE = env.int("DB_POOL_MIN_SIZE") +DB_POOL_MAX_SIZE = env.int("DB_POOL_MAX_SIZE") +DB_CONNECT_TIMEOUT_SEC = env.float("DB_CONNECT_TIMEOUT_SEC") +DB_COMMAND_TIMEOUT_SEC = env.float("DB_COMMAND_TIMEOUT_SEC") +DB_STARTUP_TIMEOUT_SEC = env.float("DB_STARTUP_TIMEOUT_SEC") + +VALKEY_HOST = env.str("VALKEY_HOST") +VALKEY_PORT = env.int("VALKEY_PORT") +VALKEY_PASS = env.str("VALKEY_PASS") +VALKEY_POOL_MAX_SIZE = env.int("VALKEY_POOL_MAX_SIZE") +VALKEY_TIMEOUT_SEC = env.float("VALKEY_TIMEOUT_SEC") +VALKEY_RETRY_AFTER_SEC = env.float("VALKEY_RETRY_AFTER_SEC") + +SESSION_TTL_SECONDS = env.int("SESSION_TTL_SECONDS") +SESSION_CACHE_TTL_SECONDS = env.int("SESSION_CACHE_TTL_SECONDS") +PASSWORD_HASH_WORKERS = env.int("PASSWORD_HASH_WORKERS") +IDEMPOTENCY_TTL_SECONDS = env.int("IDEMPOTENCY_TTL_SECONDS") + +INSTANCE_ID = secrets.token_hex(6) +INSTANCE_ID_FILE = Path(tempfile.gettempdir()) / "instance-id" + +S3_ENDPOINT = env.str("S3_ENDPOINT", default="http://s3:9000") +S3_REGION = env.str("S3_REGION", default="us-east-1") +S3_BUCKET = env.str("S3_BUCKET", default="messenger-attachments") +S3_ACCESS_KEY_ID = env.str("S3_ACCESS_KEY_ID", default="app_user") +S3_SECRET_ACCESS_KEY = env.str("S3_SECRET_ACCESS_KEY", default="app_password") \ No newline at end of file diff --git a/src/domain/__init__.py b/src/domain/__init__.py new file mode 100644 index 00000000..677fb562 --- /dev/null +++ b/src/domain/__init__.py @@ -0,0 +1,37 @@ +from .auth import ActiveSessionSchema, BasicCredentialsSchema, SessionSchema +from .attachments import AttachmentSchema, VariantSchema +from .chats import ChatPageSchema, ChatSchema, CreateChatSchema +from .health import HealthSchema +from .messages import ( + IDEMPOTENCY_KEY_MAX_LENGTH, + IDEMPOTENCY_KEY_PATTERN, + CreateMessageSchema, + IdempotencyKeySchema, + MessagePageSchema, + MessageSchema, +) +from .pagination import PageCursorSchema, PageKey +from .users import CreateUserSchema, UserCredentialsSchema, UserSchema + +__all__ = [ + "CreateUserSchema", + "UserSchema", + "UserCredentialsSchema", + "BasicCredentialsSchema", + "SessionSchema", + "ActiveSessionSchema", + "CreateChatSchema", + "ChatSchema", + "ChatPageSchema", + "CreateMessageSchema", + "IdempotencyKeySchema", + "IDEMPOTENCY_KEY_PATTERN", + "IDEMPOTENCY_KEY_MAX_LENGTH", + "MessageSchema", + "MessagePageSchema", + "HealthSchema", + "PageKey", + "PageCursorSchema", + "AttachmentSchema", + "VariantSchema", +] diff --git a/src/domain/attachments/__init__.py b/src/domain/attachments/__init__.py new file mode 100644 index 00000000..e0560237 --- /dev/null +++ b/src/domain/attachments/__init__.py @@ -0,0 +1,3 @@ +from .schemas import AttachmentSchema, VariantSchema + +__all__ = ["AttachmentSchema", "VariantSchema"] \ No newline at end of file diff --git a/src/domain/attachments/schemas.py b/src/domain/attachments/schemas.py new file mode 100644 index 00000000..71ee8693 --- /dev/null +++ b/src/domain/attachments/schemas.py @@ -0,0 +1,30 @@ +from typing import Literal +from uuid import UUID +from pydantic import BaseModel, ConfigDict +from domain.utils import UtcDateTime + +class VariantSchema(BaseModel): + model_config = ConfigDict(frozen=True) + + name: Literal["thumbnail", "crop", "optimized"] + content_type: Literal["image/jpeg", "image/png", "image/webp"] + size_bytes: int + width: int + height: int + sha256: str + +class AttachmentSchema(BaseModel): + model_config = ConfigDict(frozen=True) + + id: UUID + chat_id: UUID + owner_id: UUID + filename: str + content_type: Literal["image/png", "image/jpeg"] + size_bytes: int + sha256: str + status: Literal["ready", "queued", "failed"] + variants: list[VariantSchema] + error_code: str | None + created_at: UtcDateTime + updated_at: UtcDateTime \ No newline at end of file diff --git a/src/domain/auth/__init__.py b/src/domain/auth/__init__.py new file mode 100644 index 00000000..aaf57594 --- /dev/null +++ b/src/domain/auth/__init__.py @@ -0,0 +1,7 @@ +from .schemas import ActiveSessionSchema, BasicCredentialsSchema, SessionSchema + +__all__ = [ + "BasicCredentialsSchema", + "SessionSchema", + "ActiveSessionSchema", +] diff --git a/src/domain/auth/schemas.py b/src/domain/auth/schemas.py new file mode 100644 index 00000000..c2c81b84 --- /dev/null +++ b/src/domain/auth/schemas.py @@ -0,0 +1,35 @@ +from typing import Literal + +from pydantic import BaseModel, ConfigDict + +from domain.users import UserSchema +from domain.utils import UtcDateTime + + +class BasicCredentialsSchema(BaseModel): + """Разобранный заголовок Authorization: Basic""" + + model_config = ConfigDict(frozen=True) + + username: str + password: str + + +class SessionSchema(BaseModel): + """Ответ входа: непрозрачный токен показывается клиенту один раз""" + + model_config = ConfigDict(frozen=True) + + token: str + token_type: Literal["Bearer"] = "Bearer" + expires_at: UtcDateTime + user: UserSchema + + +class ActiveSessionSchema(BaseModel): + """Действующая серверная сессия: владелец и срок; так же лежит в кэше""" + + model_config = ConfigDict(frozen=True) + + user: UserSchema + expires_at: UtcDateTime diff --git a/src/domain/chats/__init__.py b/src/domain/chats/__init__.py new file mode 100644 index 00000000..14dca213 --- /dev/null +++ b/src/domain/chats/__init__.py @@ -0,0 +1,7 @@ +from .schemas import ChatPageSchema, ChatSchema, CreateChatSchema + +__all__ = [ + "CreateChatSchema", + "ChatSchema", + "ChatPageSchema", +] diff --git a/src/domain/chats/schemas.py b/src/domain/chats/schemas.py new file mode 100644 index 00000000..17914795 --- /dev/null +++ b/src/domain/chats/schemas.py @@ -0,0 +1,42 @@ +from typing import Annotated +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, field_validator + +from domain.utils import NotBlankStr, UtcDateTime + +ChatTitle = Annotated[NotBlankStr, Field(min_length=1, max_length=100)] + + +class CreateChatSchema(BaseModel): + """Запрос создания чата: участники задаются явно, включая вызывающего""" + + model_config = ConfigDict(extra="forbid") + + title: ChatTitle + member_ids: list[UUID] = Field(min_length=1, max_length=100) + + @field_validator("member_ids") + @classmethod + def validate_unique_members(cls, value: list[UUID]) -> list[UUID]: + if len(set(value)) != len(value): + raise ValueError("member_ids не должен содержать дубликаты") + return value + + +class ChatSchema(BaseModel): + """Чат""" + + model_config = ConfigDict(frozen=True) + + id: UUID + title: str + member_ids: list[UUID] + created_at: UtcDateTime + + +class ChatPageSchema(BaseModel): + """Страница чатов текущего пользователя""" + + items: list[ChatSchema] + next_cursor: str | None diff --git a/src/domain/errors/__init__.py b/src/domain/errors/__init__.py new file mode 100644 index 00000000..6f3b717c --- /dev/null +++ b/src/domain/errors/__init__.py @@ -0,0 +1,24 @@ +from .codes import ErrorCode +from .exceptions import ( + AppError, + ConflictError, + InvalidCredentialsError, + InvalidRequestError, + NotFoundError, + UnauthorizedError, + UnavailableError, +) +from .schemas import ErrorBodySchema, ErrorSchema + +__all__ = [ + "ErrorCode", + "AppError", + "InvalidRequestError", + "UnauthorizedError", + "InvalidCredentialsError", + "NotFoundError", + "ConflictError", + "UnavailableError", + "ErrorBodySchema", + "ErrorSchema", +] diff --git a/src/domain/errors/codes.py b/src/domain/errors/codes.py new file mode 100644 index 00000000..f17eebe3 --- /dev/null +++ b/src/domain/errors/codes.py @@ -0,0 +1,15 @@ +from enum import StrEnum + + +class ErrorCode(StrEnum): + """коды ошибок""" + + INVALID_REQUEST = "invalid_request" + UNAUTHORIZED = "unauthorized" + NOT_FOUND = "not_found" + CONFLICT = "conflict" + PAYLOAD_TOO_LARGE = "payload_too_large" + UNSUPPORTED_MEDIA_TYPE = "unsupported_media_type" + RATE_LIMITED = "rate_limited" + UNAVAILABLE = "unavailable" + INTERNAL_ERROR = "internal_error" diff --git a/src/domain/errors/exceptions.py b/src/domain/errors/exceptions.py new file mode 100644 index 00000000..04d1b579 --- /dev/null +++ b/src/domain/errors/exceptions.py @@ -0,0 +1,64 @@ +from http import HTTPStatus + +from .codes import ErrorCode + + +class AppError(Exception): + """Базовая ошибка приложения: статус, машинный код и безопасное сообщение""" + + status_code: HTTPStatus = HTTPStatus.INTERNAL_SERVER_ERROR + code: ErrorCode = ErrorCode.INTERNAL_ERROR + default_message: str = "Внутренняя ошибка сервера" + headers: dict[str, str] = {} + + def __init__(self, message: str | None = None) -> None: + self.message = message or self.default_message + super().__init__(self.message) + + +class InvalidRequestError(AppError): + """Неверные поля, UUID, cursor или limit""" + + status_code = HTTPStatus.BAD_REQUEST + code = ErrorCode.INVALID_REQUEST + default_message = "Некорректный запрос" + + +class UnauthorizedError(AppError): + """Нет действительной Bearer-сессии: токена нет, он истёк, отозван или неизвестен""" + + status_code = HTTPStatus.UNAUTHORIZED + code = ErrorCode.UNAUTHORIZED + default_message = "Требуется действительная сессия: Authorization: Bearer " + headers = {"WWW-Authenticate": 'Bearer realm="messenger"'} + + +class InvalidCredentialsError(UnauthorizedError): + """Неверные Basic-credentials: одинаковый ответ для неизвестного логина и пароля""" + + default_message = "Неверное имя пользователя или пароль" + headers = {"WWW-Authenticate": 'Basic realm="messenger", charset="UTF-8"'} + + +class NotFoundError(AppError): + """Объекта нет или он чужой: существование чужого объекта не раскрывается""" + + status_code = HTTPStatus.NOT_FOUND + code = ErrorCode.NOT_FOUND + default_message = "Объект не найден" + + +class ConflictError(AppError): + """Конфликт состояния, например занятый username""" + + status_code = HTTPStatus.CONFLICT + code = ErrorCode.CONFLICT + default_message = "Конфликт состояния" + + +class UnavailableError(AppError): + """Приложение не готово обслуживать запросы""" + + status_code = HTTPStatus.SERVICE_UNAVAILABLE + code = ErrorCode.UNAVAILABLE + default_message = "Сервис временно недоступен" diff --git a/src/domain/errors/schemas.py b/src/domain/errors/schemas.py new file mode 100644 index 00000000..29fcc615 --- /dev/null +++ b/src/domain/errors/schemas.py @@ -0,0 +1,21 @@ +from pydantic import BaseModel, ConfigDict + +from .codes import ErrorCode + + +class ErrorBodySchema(BaseModel): + """Тело ошибки""" + + model_config = ConfigDict(extra="forbid") + + code: ErrorCode + message: str + request_id: str + + +class ErrorSchema(BaseModel): + """Единый формат ошибки: {"error": {...}}""" + + model_config = ConfigDict(extra="forbid") + + error: ErrorBodySchema diff --git a/src/domain/health/__init__.py b/src/domain/health/__init__.py new file mode 100644 index 00000000..d9f144b5 --- /dev/null +++ b/src/domain/health/__init__.py @@ -0,0 +1,3 @@ +from .schemas import HealthSchema + +__all__ = ["HealthSchema"] diff --git a/src/domain/health/schemas.py b/src/domain/health/schemas.py new file mode 100644 index 00000000..81993212 --- /dev/null +++ b/src/domain/health/schemas.py @@ -0,0 +1,9 @@ +from typing import Literal + +from pydantic import BaseModel + + +class HealthSchema(BaseModel): + """Ответ health-проверок""" + + status: Literal["ok"] = "ok" diff --git a/src/domain/messages/__init__.py b/src/domain/messages/__init__.py new file mode 100644 index 00000000..ef929a7c --- /dev/null +++ b/src/domain/messages/__init__.py @@ -0,0 +1,17 @@ +from .schemas import ( + IDEMPOTENCY_KEY_MAX_LENGTH, + IDEMPOTENCY_KEY_PATTERN, + CreateMessageSchema, + IdempotencyKeySchema, + MessagePageSchema, + MessageSchema, +) + +__all__ = [ + "IDEMPOTENCY_KEY_PATTERN", + "IDEMPOTENCY_KEY_MAX_LENGTH", + "CreateMessageSchema", + "IdempotencyKeySchema", + "MessageSchema", + "MessagePageSchema", +] diff --git a/src/domain/messages/schemas.py b/src/domain/messages/schemas.py new file mode 100644 index 00000000..5c87aa6f --- /dev/null +++ b/src/domain/messages/schemas.py @@ -0,0 +1,56 @@ +from typing import Annotated +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field + +from domain.utils import NotBlankStr, UtcDateTime + +MessageText = Annotated[NotBlankStr, Field(min_length=1, max_length=4000)] + +IDEMPOTENCY_KEY_PATTERN = r"^[A-Za-z0-9._:-]{1,128}$" +IDEMPOTENCY_KEY_MAX_LENGTH = 128 + + +from pydantic import BaseModel, ConfigDict, Field, model_validator + +class CreateMessageSchema(BaseModel): + model_config = ConfigDict(extra="forbid") + text: str = Field(default="", max_length=4000) + attachment_ids: list[UUID] = Field(default_factory=list, max_length=10) + + @model_validator(mode="after") + def check_content(self): + if not self.text.strip() and not self.attachment_ids: + raise ValueError("Нельзя отправить пустое сообщение без вложений") + return self + +class MessageSchema(BaseModel): + model_config = ConfigDict(frozen=True) + id: UUID + chat_id: UUID + sender_id: UUID + text: str + attachment_ids: list[UUID] + created_at: UtcDateTime + + +class MessagePageSchema(BaseModel): + """Страница истории чата""" + + items: list[MessageSchema] + next_cursor: str | None + + +class IdempotencyKeySchema(BaseModel): + """ + Ключ повторной отправки сообщения. + + request_hash — SHA-256 канонического тела: повтор с тем же ключом и тем же + телом возвращает исходное сообщение, с другим телом — конфликт. + """ + + model_config = ConfigDict(frozen=True) + + key: str + request_hash: bytes + ttl_seconds: int diff --git a/src/domain/pagination/__init__.py b/src/domain/pagination/__init__.py new file mode 100644 index 00000000..cb7ef9c7 --- /dev/null +++ b/src/domain/pagination/__init__.py @@ -0,0 +1,6 @@ +from .schemas import PageCursorSchema, PageKey + +__all__ = [ + "PageKey", + "PageCursorSchema", +] diff --git a/src/domain/pagination/schemas.py b/src/domain/pagination/schemas.py new file mode 100644 index 00000000..f5be98be --- /dev/null +++ b/src/domain/pagination/schemas.py @@ -0,0 +1,26 @@ +from datetime import datetime +from typing import NamedTuple +from uuid import UUID + +from pydantic import BaseModel, ConfigDict + + +class PageKey(NamedTuple): + """Ключ keyset-пагинации: порядок (created_at, id) по возрастанию""" + + created_at: datetime + id: UUID + + +class PageCursorSchema(BaseModel): + """Содержимое непрозрачного cursor: ключ последнего элемента и его ресурс""" + + model_config = ConfigDict(extra="forbid", frozen=True) + + scope: str + created_at: datetime + id: UUID + + @property + def key(self) -> PageKey: + return PageKey(self.created_at, self.id) diff --git a/src/domain/users/__init__.py b/src/domain/users/__init__.py new file mode 100644 index 00000000..e483acc3 --- /dev/null +++ b/src/domain/users/__init__.py @@ -0,0 +1,7 @@ +from .schemas import CreateUserSchema, UserCredentialsSchema, UserSchema + +__all__ = [ + "CreateUserSchema", + "UserSchema", + "UserCredentialsSchema", +] diff --git a/src/domain/users/schemas.py b/src/domain/users/schemas.py new file mode 100644 index 00000000..f771fc1d --- /dev/null +++ b/src/domain/users/schemas.py @@ -0,0 +1,40 @@ +from typing import Annotated +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + +from domain.utils import NotBlankStr, UtcDateTime + +Username = Annotated[StrictStr, Field(pattern=r"^[a-z0-9_]{3,32}$")] +DisplayName = Annotated[NotBlankStr, Field(min_length=1, max_length=100)] +Password = Annotated[StrictStr, Field(min_length=12, max_length=128)] + + +class CreateUserSchema(BaseModel): + """Запрос регистрации пользователя; длина пароля — в Unicode code points""" + + model_config = ConfigDict(extra="forbid") + + username: Username + display_name: DisplayName + password: Password = Field(json_schema_extra={"writeOnly": True}) + + +class UserSchema(BaseModel): + """Пользователь: пароль и его hash сюда никогда не попадают""" + + model_config = ConfigDict(frozen=True) + + id: UUID + username: str + display_name: str + created_at: UtcDateTime + + +class UserCredentialsSchema(BaseModel): + """Пользователь вместе с hash пароля — только для проверки входа""" + + model_config = ConfigDict(frozen=True) + + user: UserSchema + password_hash: str diff --git a/src/domain/utils/__init__.py b/src/domain/utils/__init__.py new file mode 100644 index 00000000..de0c0c1f --- /dev/null +++ b/src/domain/utils/__init__.py @@ -0,0 +1,15 @@ +from .types import ( + NotBlankStr, + UtcDateTime, + ensure_not_blank, + ensure_storable, + to_rfc3339_utc, +) + +__all__ = [ + "NotBlankStr", + "UtcDateTime", + "ensure_not_blank", + "ensure_storable", + "to_rfc3339_utc", +] diff --git a/src/domain/utils/types.py b/src/domain/utils/types.py new file mode 100644 index 00000000..c2e88a6c --- /dev/null +++ b/src/domain/utils/types.py @@ -0,0 +1,36 @@ +from datetime import UTC, datetime +from typing import Annotated + +from pydantic import AfterValidator, PlainSerializer, StrictStr + +NUL_CHARACTER = "\x00" + + +def ensure_not_blank(value: str) -> str: + """Обязательная строка не может состоять только из пробельных символов""" + if not value.strip(): + raise ValueError("Строка не может быть пустой или пробельной") + return value + + +def ensure_storable(value: str) -> str: + """Тип text в потсгре""" + if NUL_CHARACTER in value: + raise ValueError("Строка не может содержать символ NUL") + return value + + +def to_rfc3339_utc(value: datetime) -> str: + """RFC 3339 в UTC с суффиксом Z и микросекундами""" + return ( + value.astimezone(UTC).isoformat(timespec="microseconds").replace("+00:00", "Z") + ) + + +NotBlankStr = Annotated[ + StrictStr, AfterValidator(ensure_not_blank), AfterValidator(ensure_storable) +] + +UtcDateTime = Annotated[ + datetime, PlainSerializer(to_rfc3339_utc, return_type=str, when_used="json") +] diff --git a/src/gateway.py b/src/gateway.py new file mode 100644 index 00000000..c076c954 --- /dev/null +++ b/src/gateway.py @@ -0,0 +1,126 @@ +import asyncio +import socket +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager + +import uvicorn +from fastapi import FastAPI + +from application import api_endpoints, health_endpoints +from application.api.handlers import register_exception_handlers +from application.api.middlewares import RequestContextMiddleware +from config import ( + APP_ENV, + APP_HOST, + APP_KEEPALIVE_TIMEOUT_SEC, + APP_PORT, + APP_REVISION, + DB_STARTUP_TIMEOUT_SEC, + INSTANCE_ID, + INSTANCE_ID_FILE, + LOGGER, + PASSWORD_HASH_WORKERS, + SESSION_TTL_SECONDS, + SHUTDOWN_DRAIN_SEC, + SHUTDOWN_TIMEOUT_SEC, +) +from infrastructure import PasswordHasher, cache_manager, database_pool_manager + + +@asynccontextmanager +async def lifespan(app: FastAPI) -> AsyncIterator[None]: + """ + uvicorn открывает порт только после startup: реплика без БД или со старой + схемой не принимает соединений, и LB отправляет запросы другим репликам. + """ + await database_pool_manager.create_pool(DB_STARTUP_TIMEOUT_SEC) + await database_pool_manager.check_migrations() + cache_manager.create_client() + password_hasher = PasswordHasher(PASSWORD_HASH_WORKERS) + app.state.database = database_pool_manager + app.state.cache = cache_manager + app.state.password_hasher = password_hasher + INSTANCE_ID_FILE.write_text(INSTANCE_ID) + app.state.is_ready = True + LOGGER.info( + f"Application started, env={APP_ENV}, revision={APP_REVISION}, " + f"instance={INSTANCE_ID}, session ttl={SESSION_TTL_SECONDS} s" + ) + yield + app.state.is_ready = False + await cache_manager.close() + await database_pool_manager.close() + password_hasher.close() + LOGGER.info(f"Application stopped, instance={INSTANCE_ID}, connections closed") + + +app = FastAPI( + title="mtuci-labs-messanger", + description="мессенджер-конкурент-максу", + version="1.3.0", + lifespan=lifespan, +) + +app.add_middleware(RequestContextMiddleware) +register_exception_handlers(app) + +app.include_router(health_endpoints) +app.include_router(api_endpoints) + + +class DrainingServer(uvicorn.Server): + """ + SIGTERM: сначала drain, затем штатный graceful shutdown uvicorn. + """ + + def __init__(self, config: uvicorn.Config, drain_seconds: float) -> None: + super().__init__(config) + self._drain_seconds = drain_seconds + + async def shutdown(self, sockets: list[socket.socket] | None = None) -> None: + for server in getattr(self, "servers", []): + server.close() + app.state.is_ready = False + app.state.is_draining = True + LOGGER.info( + f"SIGTERM: drain {self._drain_seconds} с, instance={INSTANCE_ID}: " + "порт закрыт, keep-alive соединения закрываются после ответа" + ) + await asyncio.sleep(self._drain_seconds) + await super().shutdown(sockets) + + +def main( + host: str, + port: int, + shutdown_timeout: int, + keepalive_timeout: int, + drain_seconds: float, +) -> None: + """ + Функция для запуска api. + + SIGTERM: drain_seconds без приёма новых соединений, затем uvicorn ждёт + текущих запросов не дольше shutdown_timeout, и lifespan закрывает пулы. + Сумма меньше stop_grace_period контейнера (10 с). + """ + config = uvicorn.Config( + app, + host=host, + port=port, + timeout_graceful_shutdown=shutdown_timeout, + timeout_keep_alive=keepalive_timeout, + access_log=False, + server_header=False, + ) + DrainingServer(config, drain_seconds).run() + + +if __name__ == "__main__": + main( + host=APP_HOST, + port=APP_PORT, + shutdown_timeout=SHUTDOWN_TIMEOUT_SEC, + keepalive_timeout=APP_KEEPALIVE_TIMEOUT_SEC, + drain_seconds=SHUTDOWN_DRAIN_SEC, + ) diff --git a/src/healthcheck.py b/src/healthcheck.py new file mode 100644 index 00000000..66d7ed89 --- /dev/null +++ b/src/healthcheck.py @@ -0,0 +1,20 @@ +import sys +import urllib.request + +from config import APP_PORT + +READY_URL = f"http://127.0.0.1:{APP_PORT}/health/ready" + +REQUEST_TIMEOUT_SEC = 2 + + +def main() -> int: + try: + with urllib.request.urlopen(READY_URL, timeout=REQUEST_TIMEOUT_SEC) as response: + return 0 if response.status == 200 else 1 + except OSError: + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/src/infrastructure/__init__.py b/src/infrastructure/__init__.py new file mode 100644 index 00000000..5ddf8953 --- /dev/null +++ b/src/infrastructure/__init__.py @@ -0,0 +1,4 @@ +from .dependencies import cache_manager, database_pool_manager +from .security import PasswordHasher + +__all__ = ["database_pool_manager", "cache_manager", "PasswordHasher"] \ No newline at end of file diff --git a/src/infrastructure/dependencies/__init__.py b/src/infrastructure/dependencies/__init__.py new file mode 100644 index 00000000..0e85bb76 --- /dev/null +++ b/src/infrastructure/dependencies/__init__.py @@ -0,0 +1,13 @@ +from .cache import CacheManager, cache_manager, get_cache +from .database import DatabasePoolManager, database_pool_manager, get_database +from .service_creator import ServiceCreator + +__all__ = [ + "ServiceCreator", + "DatabasePoolManager", + "database_pool_manager", + "get_database", + "CacheManager", + "cache_manager", + "get_cache", +] diff --git a/src/infrastructure/dependencies/cache.py b/src/infrastructure/dependencies/cache.py new file mode 100644 index 00000000..0fa840b9 --- /dev/null +++ b/src/infrastructure/dependencies/cache.py @@ -0,0 +1,94 @@ +import time + +from redis.asyncio import BlockingConnectionPool, Redis +from redis.asyncio.retry import Retry +from redis.backoff import NoBackoff +from starlette.requests import HTTPConnection + +from config import ( + LOGGER, + VALKEY_HOST, + VALKEY_PASS, + VALKEY_POOL_MAX_SIZE, + VALKEY_PORT, + VALKEY_RETRY_AFTER_SEC, + VALKEY_TIMEOUT_SEC, +) + + +class CacheManager: + """ + Клиент Valkey: ограниченный пул, короткие таймауты, без встроенных повторов. + """ + + def __init__( + self, + host: str, + port: int, + password: str, + max_size: int, + timeout: float, + retry_after: float, + ) -> None: + self._host = host + self._port = port + self._password = password + self.max_size = max_size + self.timeout = timeout + self.retry_after = retry_after + self.client: Redis | None = None + self._disabled_until = 0.0 + + def create_client(self) -> Redis: + """Создание клиента; соединения открываются лениво при первом запросе""" + if self.client is None: + pool = BlockingConnectionPool( + host=self._host, + port=self._port, + password=self._password, + max_connections=self.max_size, + timeout=self.timeout, + socket_timeout=self.timeout, + socket_connect_timeout=self.timeout, + retry=Retry(NoBackoff(), 0), + ) + self.client = Redis(connection_pool=pool) + LOGGER.info( + f"Клиент Valkey создан: {self._host}:{self._port}, " + f"pool: {self.max_size}, timeout: {self.timeout} с" + ) + return self.client + + @property + def is_available(self) -> bool: + return time.monotonic() >= self._disabled_until + + def mark_failed(self, error: Exception) -> None: + """Обход кэша на retry_after секунд после ошибки Valkey""" + if self.is_available: + LOGGER.warning( + f"Valkey недоступен ({type(error).__name__}): кэш сессий " + f"обходится {self.retry_after} с, запросы идут в PostgreSQL" + ) + self._disabled_until = time.monotonic() + self.retry_after + + async def close(self) -> None: + if self.client is not None: + await self.client.aclose() + self.client = None + + +def get_cache(connection: HTTPConnection) -> CacheManager: + """Получение менеджера кэша, созданного в lifespan.""" + cache: CacheManager = connection.app.state.cache + return cache + + +cache_manager = CacheManager( + host=VALKEY_HOST, + port=VALKEY_PORT, + password=VALKEY_PASS, + max_size=VALKEY_POOL_MAX_SIZE, + timeout=VALKEY_TIMEOUT_SEC, + retry_after=VALKEY_RETRY_AFTER_SEC, +) diff --git a/src/infrastructure/dependencies/database.py b/src/infrastructure/dependencies/database.py new file mode 100644 index 00000000..3b22ea03 --- /dev/null +++ b/src/infrastructure/dependencies/database.py @@ -0,0 +1,236 @@ +import asyncio +import time +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager +from pathlib import Path + +import asyncpg +from starlette.requests import HTTPConnection + +from config import ( + DB_COMMAND_TIMEOUT_SEC, + DB_CONNECT_TIMEOUT_SEC, + DB_HOST, + DB_NAME, + DB_PASS, + DB_POOL_MAX_SIZE, + DB_POOL_MIN_SIZE, + DB_PORT, + DB_USER, + LOGGER, +) +from infrastructure.utils import DATABASE_UNAVAILABLE_ERRORS + +MIGRATIONS_DIR = Path(__file__).resolve().parents[3] / "migrations" + +MIGRATIONS_LOCK_NAMESPACE = 1 + +STARTUP_RETRY_INTERVAL_SEC = 1 + +BROKEN_CONNECTION_ERRORS: tuple[type[Exception], ...] = ( + asyncpg.PostgresConnectionError, + asyncpg.InterfaceError, + asyncpg.exceptions.OperatorInterventionError, +) + +MIGRATIONS_TIMEOUT_SEC = 300 + + +class DatabasePoolManager: + """Класс для управления пулом соединений и версионируемыми миграциями.""" + + def __init__( + self, + user: str, + password: str, + db: str, + host: str, + port: int, + min_size: int, + max_size: int, + connect_timeout: float, + command_timeout: float, + ) -> None: + self._user = user + self._password = password + self._host = host + self._port = port + self._database = db + self.min_size = min_size + self.max_size = max_size + self.connect_timeout = connect_timeout + self.command_timeout = command_timeout + self.pool: asyncpg.Pool | None = None + + async def create_pool(self, startup_timeout: float) -> asyncpg.Pool: + """ + Создание ограниченного пула соединений. + """ + LOGGER.info("Установка соединения с базой данных psql") + deadline = time.monotonic() + startup_timeout + while self.pool is None: + try: + self.pool = await asyncpg.create_pool( + user=self._user, + password=self._password, + host=self._host, + port=self._port, + database=self._database, + min_size=self.min_size, + max_size=self.max_size, + timeout=self.connect_timeout, + command_timeout=self.command_timeout, + server_settings={ + "application_name": "messenger-api", + "statement_timeout": str(int(self.command_timeout * 1000)), + }, + ) + except (*DATABASE_UNAVAILABLE_ERRORS, asyncpg.PostgresError) as error: + if time.monotonic() >= deadline: + LOGGER.error( + "Не удалось подключиться к psql за " + f"{startup_timeout} с: {type(error).__name__}" + ) + raise + LOGGER.warning( + f"PostgreSQL ещё недоступен: {type(error).__name__}, повтор" + ) + await asyncio.sleep(STARTUP_RETRY_INTERVAL_SEC) + LOGGER.info( + f"Соединение с базой данных psql установлено. DB_NAME: " + f"{self._database}, pool: {self.min_size}..{self.max_size}" + ) + return self.pool + + async def apply_migrations(self, directory: Path = MIGRATIONS_DIR) -> None: + """ + Применение миграций NNNN_name.sql по порядку версий. + + Вызывается однократно отдельным процессом (src/migrate.py, сервис migrate) + до запуска API-реплик, а не каждой репликой при старте. + Каждая миграция и запись о ней в schema_migrations — одна транзакция. + Advisory lock — страховка от двух одновременных запусков migrate; + уже применённые версии пропускаются, поэтому повторный запуск безопасен. + """ + async with self.acquire() as conn: + await conn.execute("SET statement_timeout = 0;") + await conn.execute( + "SELECT pg_advisory_lock($1, 0);", + MIGRATIONS_LOCK_NAMESPACE, + timeout=MIGRATIONS_TIMEOUT_SEC, + ) + try: + await conn.execute( + """ + CREATE TABLE IF NOT EXISTS schema_migrations ( + version integer PRIMARY KEY, + name text NOT NULL, + applied_at timestamptz NOT NULL DEFAULT clock_timestamp() + ); + """ + ) + applied = { + record["version"] + for record in await conn.fetch( + "SELECT version FROM schema_migrations;" + ) + } + for version, path in self._migration_files(directory): + if version in applied: + continue + async with conn.transaction(): + await conn.execute( + path.read_text(encoding="utf-8"), + timeout=MIGRATIONS_TIMEOUT_SEC, + ) + await conn.execute( + "INSERT INTO schema_migrations (version, name) " + "VALUES ($1, $2);", + version, + path.stem, + ) + LOGGER.info(f"Применена миграция {path.name}") + finally: + await conn.execute( + "SELECT pg_advisory_unlock($1, 0);", MIGRATIONS_LOCK_NAMESPACE + ) + LOGGER.info("Схема БД в актуальной версии") + + async def check_migrations(self, directory: Path = MIGRATIONS_DIR) -> None: + """ + Схема БД не старше кода: все миграции из образа уже применены. + + API миграции не применяет. Если migrate ещё не отработал, реплика не + стартует и не начинает слушать порт, балансировщик её не использует + + """ + expected = {version for version, _ in self._migration_files(directory)} + async with self.acquire() as conn: + try: + records = await conn.fetch("SELECT version FROM schema_migrations;") + except asyncpg.UndefinedTableError: + records = [] + applied = {record["version"] for record in records} + missing = sorted(expected - applied) + if missing: + raise RuntimeError( + f"В БД не применены миграции {missing}: сначала запустите migrate" + ) + LOGGER.info(f"Схема БД совместима: версия {max(applied, default=0)}") + + @staticmethod + def _migration_files(directory: Path) -> list[tuple[int, Path]]: + """Файлы NNNN_name.sql по возрастанию версии""" + return sorted( + (int(path.name.split("_", 1)[0]), path) for path in directory.glob("*.sql") + ) + + @asynccontextmanager + async def acquire(self) -> AsyncIterator[asyncpg.Connection]: + """ + Получение соединения из пула с ограниченным ожиданием свободного. + + После рестарта PostgreSQL все соединения пула мертвы. На первой же + ошибке соединения пул помечает их на переподключение, чтобы 503 + получил один запрос, а не каждый из max_size следующих. + """ + assert self.pool is not None + try: + async with self.pool.acquire(timeout=self.connect_timeout) as connection: + yield connection + except BROKEN_CONNECTION_ERRORS: + await self.pool.expire_connections() + raise + + async def check(self) -> bool: + """PostgreSQL отвечает на запрос — для readiness""" + try: + async with self.acquire() as conn: + await conn.fetchval("SELECT 1;", timeout=self.connect_timeout) + except DATABASE_UNAVAILABLE_ERRORS: + return False + return True + + async def close(self) -> None: + if self.pool: + await self.pool.close() + self.pool = None + + +def get_database(connection: HTTPConnection) -> DatabasePoolManager: + """Получение менеджера пула соединений, созданного в lifespan.""" + database: DatabasePoolManager = connection.app.state.database + return database + + +database_pool_manager = DatabasePoolManager( + user=DB_USER, + password=DB_PASS, + db=DB_NAME, + host=DB_HOST, + port=DB_PORT, + min_size=DB_POOL_MIN_SIZE, + max_size=DB_POOL_MAX_SIZE, + connect_timeout=DB_CONNECT_TIMEOUT_SEC, + command_timeout=DB_COMMAND_TIMEOUT_SEC, +) diff --git a/src/infrastructure/dependencies/service_creator.py b/src/infrastructure/dependencies/service_creator.py new file mode 100644 index 00000000..a25d6992 --- /dev/null +++ b/src/infrastructure/dependencies/service_creator.py @@ -0,0 +1,118 @@ +from fastapi import Depends +from config import S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET +from infrastructure.s3_client import S3Client +from infrastructure.repositories import PostgresAttachmentRepository +from interfaces import AttachmentRepository +from infrastructure.services import AttachmentService + +# Создаем глобальный клиент S3 +s3_client = S3Client(S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET) + +from config import ( + IDEMPOTENCY_TTL_SECONDS, + SESSION_CACHE_TTL_SECONDS, + SESSION_TTL_SECONDS, +) +from infrastructure.dependencies.cache import CacheManager, get_cache +from infrastructure.dependencies.database import DatabasePoolManager, get_database +from infrastructure.repositories import ( + PostgresChatRepository, + PostgresMessageRepository, + PostgresSessionRepository, + PostgresUserRepository, + ValkeySessionCache, +) +from infrastructure.security import PasswordHasher, get_password_hasher +from infrastructure.services import ( + AuthService, + ChatService, + MessageService, + UserService, +) +from interfaces import ( + ChatRepository, + MessageRepository, + SessionCache, + SessionRepository, + UserRepository, +) + + +class ServiceCreator: + @staticmethod + def _get_user_repository( + database: DatabasePoolManager = Depends(get_database), + ) -> UserRepository: + return PostgresUserRepository(database) + + @staticmethod + def _get_chat_repository( + database: DatabasePoolManager = Depends(get_database), + ) -> ChatRepository: + return PostgresChatRepository(database) + + @staticmethod + def _get_attachment_repository(database: DatabasePoolManager = Depends(get_database)) -> AttachmentRepository: + return PostgresAttachmentRepository(database) + + @staticmethod + def get_attachment_service( + repo: AttachmentRepository = Depends(_get_attachment_repository), + chat_repo: ChatRepository = Depends(_get_chat_repository) + ) -> AttachmentService: + return AttachmentService(s3_client, repo, chat_repo) + + @staticmethod + def _get_message_repository( + database: DatabasePoolManager = Depends(get_database), + ) -> MessageRepository: + return PostgresMessageRepository(database) + + @staticmethod + def _get_session_repository( + database: DatabasePoolManager = Depends(get_database), + ) -> SessionRepository: + return PostgresSessionRepository(database) + + @staticmethod + def _get_session_cache( + cache: CacheManager = Depends(get_cache), + ) -> SessionCache: + return ValkeySessionCache(cache, SESSION_CACHE_TTL_SECONDS) + + @staticmethod + def get_user_service( + repository: UserRepository = Depends(_get_user_repository), + hasher: PasswordHasher = Depends(get_password_hasher), + ) -> UserService: + return UserService(repository, hasher) + + @staticmethod + def get_auth_service( + user_repository: UserRepository = Depends(_get_user_repository), + session_repository: SessionRepository = Depends(_get_session_repository), + session_cache: SessionCache = Depends(_get_session_cache), + hasher: PasswordHasher = Depends(get_password_hasher), + ) -> AuthService: + return AuthService( + user_repository, + session_repository, + session_cache, + hasher, + SESSION_TTL_SECONDS, + ) + + @staticmethod + def get_chat_service( + chat_repository: ChatRepository = Depends(_get_chat_repository), + ) -> ChatService: + return ChatService(chat_repository) + + @staticmethod + def get_message_service( + chat_repository: ChatRepository = Depends(_get_chat_repository), + message_repository: MessageRepository = Depends(_get_message_repository), + ) -> MessageService: + return MessageService( + chat_repository, message_repository, IDEMPOTENCY_TTL_SECONDS + ) diff --git a/src/infrastructure/repositories/__init__.py b/src/infrastructure/repositories/__init__.py new file mode 100644 index 00000000..49859511 --- /dev/null +++ b/src/infrastructure/repositories/__init__.py @@ -0,0 +1,15 @@ +from .chat_repository import PostgresChatRepository +from .message_repository import PostgresMessageRepository +from .session_cache import ValkeySessionCache +from .session_repository import PostgresSessionRepository +from .user_repository import PostgresUserRepository +from .attachment_repository import PostgresAttachmentRepository + +__all__ = [ + "PostgresUserRepository", + "PostgresChatRepository", + "PostgresMessageRepository", + "PostgresSessionRepository", + "ValkeySessionCache", + "PostgresAttachmentRepository", +] \ No newline at end of file diff --git a/src/infrastructure/repositories/attachment_repository.py b/src/infrastructure/repositories/attachment_repository.py new file mode 100644 index 00000000..1402d447 --- /dev/null +++ b/src/infrastructure/repositories/attachment_repository.py @@ -0,0 +1,48 @@ +import json +from uuid import UUID +import asyncpg +from domain import AttachmentSchema, VariantSchema +from infrastructure.utils import Pool, repository_logs +from interfaces import AttachmentRepository + +class PostgresAttachmentRepository(AttachmentRepository): + def __init__(self, pool: Pool) -> None: + self._pool = pool + + @repository_logs + async def create(self, attachment: AttachmentSchema) -> AttachmentSchema: + query = """ + INSERT INTO attachments + (id, chat_id, owner_id, filename, content_type, size_bytes, sha256, status, error_code, variants) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10::jsonb) + RETURNING created_at, updated_at; + """ + variants_json = json.dumps([v.model_dump(mode="json") for v in attachment.variants]) + async with self._pool.acquire() as conn: + row = await conn.fetchrow( + query, attachment.id, attachment.chat_id, attachment.owner_id, + attachment.filename, attachment.content_type, attachment.size_bytes, + attachment.sha256, attachment.status, attachment.error_code, variants_json + ) + assert row is not None + return attachment.model_copy(update={"created_at": row["created_at"], "updated_at": row["updated_at"]}) + + @repository_logs + async def get_by_id(self, attachment_id: UUID) -> AttachmentSchema | None: + query = """ + SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256, status, error_code, variants, created_at, updated_at + FROM attachments WHERE id = $1; + """ + async with self._pool.acquire() as conn: + row = await conn.fetchrow(query, attachment_id) + if row is None: + return None + + variants = [VariantSchema(**v) for v in json.loads(row["variants"])] + return AttachmentSchema( + id=row["id"], chat_id=row["chat_id"], owner_id=row["owner_id"], + filename=row["filename"], content_type=row["content_type"], + size_bytes=row["size_bytes"], sha256=row["sha256"], status=row["status"], + error_code=row["error_code"], variants=variants, + created_at=row["created_at"], updated_at=row["updated_at"] + ) \ No newline at end of file diff --git a/src/infrastructure/repositories/chat_repository/__init__.py b/src/infrastructure/repositories/chat_repository/__init__.py new file mode 100644 index 00000000..822c590b --- /dev/null +++ b/src/infrastructure/repositories/chat_repository/__init__.py @@ -0,0 +1,3 @@ +from .postgres import PostgresChatRepository + +__all__ = ["PostgresChatRepository"] diff --git a/src/infrastructure/repositories/chat_repository/postgres.py b/src/infrastructure/repositories/chat_repository/postgres.py new file mode 100644 index 00000000..455fd442 --- /dev/null +++ b/src/infrastructure/repositories/chat_repository/postgres.py @@ -0,0 +1,150 @@ +from uuid import UUID + +import asyncpg + +from domain import ChatSchema, PageKey +from domain.errors import InvalidRequestError +from infrastructure.utils import Pool, repository_logs, transaction +from interfaces import ChatRepository + + +class PostgresChatRepository(ChatRepository): + def __init__(self, pool: Pool) -> None: + self._pool = pool + + @repository_logs + async def create( + self, title: str, created_by: UUID, member_ids: list[UUID] + ) -> ChatSchema: + """ + Чат и участники — одна транзакция. Неизвестный участник нарушает FK + на users, транзакция откатывается целиком, строка chats не остаётся. + Участники вставляются одним запросом; position — порядок в member_ids. + """ + chat_query = """ + INSERT INTO chats + ( + title, + created_by + ) + VALUES + ( + $1, + $2 + ) + RETURNING id, title, created_at; + """ + members_query = """ + INSERT INTO chat_members + ( + chat_id, + user_id, + position + ) + SELECT + $1, + member.user_id, + member.ordinality - 1 + FROM unnest($2::uuid[]) WITH ORDINALITY AS member(user_id, ordinality); + """ + try: + async with transaction(self._pool) as conn: + row = await conn.fetchrow(chat_query, title, created_by) + assert row is not None + await conn.execute(members_query, row["id"], member_ids) + except asyncpg.ForeignKeyViolationError: + raise InvalidRequestError( + "member_ids содержит неизвестных пользователей" + ) from None + return ChatSchema( + id=row["id"], + title=row["title"], + member_ids=member_ids, + created_at=row["created_at"], + ) + + @repository_logs + async def get_for_member(self, chat_id: UUID, member_id: UUID) -> ChatSchema | None: + query = """ + SELECT + chat.id, + chat.title, + chat.created_at, + ARRAY( + SELECT member.user_id + FROM chat_members member + WHERE member.chat_id = chat.id + ORDER BY member.position + ) AS member_ids + FROM chats chat + WHERE + chat.id = $1 + AND EXISTS + ( + SELECT 1 + FROM chat_members caller + WHERE caller.chat_id = chat.id AND caller.user_id = $2 + ); + """ + async with self._pool.acquire() as conn: + row = await conn.fetchrow(query, chat_id, member_id) + return self._row_to_chat(row) if row is not None else None + + @repository_logs + async def list_for_member( + self, member_id: UUID, after: PageKey | None, limit: int + ) -> list[ChatSchema]: + """Чаты пользователя по (created_at, id); со второй страницы — после ключа""" + first_page_query = """ + SELECT + chat.id, + chat.title, + chat.created_at, + ARRAY( + SELECT member.user_id + FROM chat_members member + WHERE member.chat_id = chat.id + ORDER BY member.position + ) AS member_ids + FROM chat_members caller + JOIN chats chat ON chat.id = caller.chat_id + WHERE caller.user_id = $1 + ORDER BY chat.created_at, chat.id + LIMIT $2; + """ + next_page_query = """ + SELECT + chat.id, + chat.title, + chat.created_at, + ARRAY( + SELECT member.user_id + FROM chat_members member + WHERE member.chat_id = chat.id + ORDER BY member.position + ) AS member_ids + FROM chat_members caller + JOIN chats chat ON chat.id = caller.chat_id + WHERE + caller.user_id = $1 + AND (chat.created_at, chat.id) > ($2, $3) + ORDER BY chat.created_at, chat.id + LIMIT $4; + """ + async with self._pool.acquire() as conn: + if after is None: + rows = await conn.fetch(first_page_query, member_id, limit) + else: + rows = await conn.fetch( + next_page_query, member_id, after.created_at, after.id, limit + ) + return [self._row_to_chat(row) for row in rows] + + @staticmethod + def _row_to_chat(row: asyncpg.Record) -> ChatSchema: + return ChatSchema( + id=row["id"], + title=row["title"], + member_ids=row["member_ids"], + created_at=row["created_at"], + ) diff --git a/src/infrastructure/repositories/message_repository/__init__.py b/src/infrastructure/repositories/message_repository/__init__.py new file mode 100644 index 00000000..586dcf44 --- /dev/null +++ b/src/infrastructure/repositories/message_repository/__init__.py @@ -0,0 +1,3 @@ +from .postgres import PostgresMessageRepository + +__all__ = ["PostgresMessageRepository"] diff --git a/src/infrastructure/repositories/message_repository/postgres.py b/src/infrastructure/repositories/message_repository/postgres.py new file mode 100644 index 00000000..5e77205b --- /dev/null +++ b/src/infrastructure/repositories/message_repository/postgres.py @@ -0,0 +1,165 @@ +from uuid import UUID +import asyncpg + +from domain import IdempotencyKeySchema, MessageSchema, PageKey +from domain.errors import ConflictError +from infrastructure.utils import Pool, repository_logs, transaction +from interfaces import MessageRepository + +CHAT_LOCK_NAMESPACE = 2 + + +class PostgresMessageRepository(MessageRepository): + def __init__(self, pool: Pool) -> None: + self._pool = pool + + @repository_logs + async def create( + self, + chat_id: UUID, + sender_id: UUID, + text: str, + attachment_ids: list[UUID], + idempotency: IdempotencyKeySchema, + ) -> tuple[MessageSchema, bool]: + lock_query = """ + SELECT pg_advisory_xact_lock($1, hashtext($2::uuid::text)); + """ + find_key_query = """ + SELECT + idem.request_hash, + message.id, + message.chat_id, + message.sender_id, + message.text, + message.attachment_ids, + message.created_at + FROM message_idempotency_keys idem + JOIN messages message ON message.id = idem.message_id + WHERE + idem.sender_id = $1 + AND idem.chat_id = $2 + AND idem.idempotency_key = $3 + AND idem.expires_at > clock_timestamp(); + """ + insert_query = """ + INSERT INTO messages + ( + chat_id, + sender_id, + text, + attachment_ids, + created_at + ) + SELECT + $1, + $2, + $3, + $4::uuid[], + GREATEST(clock_timestamp(), MAX(created_at) + interval '1 microsecond') + FROM messages + WHERE chat_id = $1 + RETURNING id, chat_id, sender_id, text, attachment_ids, created_at; + """ + + save_key_query = """ + INSERT INTO message_idempotency_keys + ( + sender_id, + chat_id, + idempotency_key, + request_hash, + message_id, + expires_at + ) + VALUES + ( + $1, + $2, + $3, + $4, + $5, + clock_timestamp() + make_interval(secs => $6::integer) + ) + ON CONFLICT (sender_id, chat_id, idempotency_key) DO UPDATE + SET + request_hash = EXCLUDED.request_hash, + message_id = EXCLUDED.message_id, + created_at = EXCLUDED.created_at, + expires_at = EXCLUDED.expires_at; + """ + async with transaction(self._pool) as conn: + await conn.execute(lock_query, CHAT_LOCK_NAMESPACE, chat_id) + stored = await conn.fetchrow( + find_key_query, sender_id, chat_id, idempotency.key + ) + if stored is not None: + if stored["request_hash"] != idempotency.request_hash: + raise ConflictError( + "Idempotency-Key уже использован с другим телом запроса" + ) + return self._row_to_message(stored), False + row = await conn.fetchrow(insert_query, chat_id, sender_id, text, attachment_ids) + assert row is not None + await conn.execute( + save_key_query, + sender_id, + chat_id, + idempotency.key, + idempotency.request_hash, + row["id"], + idempotency.ttl_seconds, + ) + return self._row_to_message(row), True + + @repository_logs + async def list_for_chat( + self, chat_id: UUID, after: PageKey | None, limit: int + ) -> list[MessageSchema]: + first_page_query = """ + SELECT + id, + chat_id, + sender_id, + text, + attachment_ids, + created_at + FROM messages + WHERE chat_id = $1 + ORDER BY created_at, id + LIMIT $2; + """ + next_page_query = """ + SELECT + id, + chat_id, + sender_id, + text, + attachment_ids, + created_at + FROM messages + WHERE + chat_id = $1 + AND (created_at, id) > ($2, $3) + ORDER BY created_at, id + LIMIT $4; + """ + async with self._pool.acquire() as conn: + if after is None: + rows = await conn.fetch(first_page_query, chat_id, limit) + else: + rows = await conn.fetch( + next_page_query, chat_id, after.created_at, after.id, limit + ) + return [self._row_to_message(row) for row in rows] + + @staticmethod + def _row_to_message(row: asyncpg.Record) -> MessageSchema: + return MessageSchema( + id=row["id"], + chat_id=row["chat_id"], + sender_id=row["sender_id"], + text=row["text"], + attachment_ids=list(row["attachment_ids"]) if row["attachment_ids"] is not None else [], + created_at=row["created_at"], + ) \ No newline at end of file diff --git a/src/infrastructure/repositories/session_cache/__init__.py b/src/infrastructure/repositories/session_cache/__init__.py new file mode 100644 index 00000000..737a87e7 --- /dev/null +++ b/src/infrastructure/repositories/session_cache/__init__.py @@ -0,0 +1,3 @@ +from .valkey import ValkeySessionCache + +__all__ = ["ValkeySessionCache"] diff --git a/src/infrastructure/repositories/session_cache/valkey.py b/src/infrastructure/repositories/session_cache/valkey.py new file mode 100644 index 00000000..a5e232e5 --- /dev/null +++ b/src/infrastructure/repositories/session_cache/valkey.py @@ -0,0 +1,87 @@ +import math +from datetime import UTC, datetime +from typing import TYPE_CHECKING + +from pydantic import ValidationError +from redis.exceptions import RedisError + +from config import LOGGER +from domain import ActiveSessionSchema +from interfaces import SessionCache + +if TYPE_CHECKING: + from infrastructure.dependencies.cache import CacheManager + +KEY_PREFIX = "session:" + +CACHE_UNAVAILABLE_ERRORS: tuple[type[Exception], ...] = ( + RedisError, + OSError, + TimeoutError, +) + + +class ValkeySessionCache(SessionCache): + """ + Read-through кэш сессий в Valkey. + + Ключ session:, значение — JSON ActiveSessionSchema. + TTL = min(остаток жизни сессии, max_ttl): запись исчезает не позже сессии, + а max_ttl ограничивает окно устаревания, если инвалидация не дошла. + """ + + def __init__(self, cache: "CacheManager", max_ttl_seconds: int) -> None: + self._cache = cache + self._max_ttl_ms = max_ttl_seconds * 1000 + + async def get(self, token_hash: bytes) -> ActiveSessionSchema | None: + if not self._cache.is_available or self._cache.client is None: + return None + try: + raw = await self._cache.client.get(self._key(token_hash)) + except CACHE_UNAVAILABLE_ERRORS as error: + self._cache.mark_failed(error) + return None + if raw is None: + return None + try: + return ActiveSessionSchema.model_validate_json(raw) + except ValidationError: + LOGGER.warning("Повреждённая запись кэша сессии проигнорирована") + return None + + async def set(self, token_hash: bytes, session: ActiveSessionSchema) -> None: + if not self._cache.is_available or self._cache.client is None: + return + remaining = session.expires_at - datetime.now(UTC) + ttl_ms = min(self._max_ttl_ms, math.floor(remaining.total_seconds() * 1000)) + if ttl_ms <= 0: + return + try: + await self._cache.client.set( + self._key(token_hash), session.model_dump_json(), px=ttl_ms + ) + except CACHE_UNAVAILABLE_ERRORS as error: + self._cache.mark_failed(error) + + async def delete(self, token_hash: bytes) -> bool: + if self._cache.client is None: + return False + try: + await self._cache.client.delete(self._key(token_hash)) + except CACHE_UNAVAILABLE_ERRORS as error: + self._cache.mark_failed(error) + return False + return True + + async def ping(self) -> bool: + if self._cache.client is None: + return False + try: + return bool(await self._cache.client.ping()) + except CACHE_UNAVAILABLE_ERRORS: + return False + + @staticmethod + def _key(token_hash: bytes) -> str: + return KEY_PREFIX + token_hash.hex() diff --git a/src/infrastructure/repositories/session_repository/__init__.py b/src/infrastructure/repositories/session_repository/__init__.py new file mode 100644 index 00000000..c3887458 --- /dev/null +++ b/src/infrastructure/repositories/session_repository/__init__.py @@ -0,0 +1,3 @@ +from .postgres import PostgresSessionRepository + +__all__ = ["PostgresSessionRepository"] diff --git a/src/infrastructure/repositories/session_repository/postgres.py b/src/infrastructure/repositories/session_repository/postgres.py new file mode 100644 index 00000000..1bbf1537 --- /dev/null +++ b/src/infrastructure/repositories/session_repository/postgres.py @@ -0,0 +1,85 @@ +from datetime import datetime +from uuid import UUID + +from domain import ActiveSessionSchema, UserSchema +from infrastructure.utils import Pool, repository_logs +from interfaces import SessionRepository + + +class PostgresSessionRepository(SessionRepository): + def __init__(self, pool: Pool) -> None: + self._pool = pool + + @repository_logs + async def create( + self, token_hash: bytes, user_id: UUID, ttl_seconds: int + ) -> datetime: + query = """ + INSERT INTO sessions + ( + token_hash, + user_id, + expires_at + ) + VALUES + ( + $1, + $2, + clock_timestamp() + make_interval(secs => $3::integer) + ) + RETURNING expires_at; + """ + async with self._pool.acquire() as conn: + expires_at: datetime = await conn.fetchval( + query, token_hash, user_id, ttl_seconds + ) + return expires_at + + @repository_logs + async def get_active(self, token_hash: bytes) -> ActiveSessionSchema | None: + """Поиск по PK; истёкшая или отозванная сессия не возвращается""" + query = """ + SELECT + usr.id, + usr.username, + usr.display_name, + usr.created_at, + session.expires_at + FROM sessions session + JOIN users usr ON usr.id = session.user_id + WHERE + session.token_hash = $1 + AND session.revoked_at IS NULL + AND session.expires_at > clock_timestamp(); + """ + async with self._pool.acquire() as conn: + row = await conn.fetchrow(query, token_hash) + if row is None: + return None + return ActiveSessionSchema( + user=UserSchema( + id=row["id"], + username=row["username"], + display_name=row["display_name"], + created_at=row["created_at"], + ), + expires_at=row["expires_at"], + ) + + @repository_logs + async def revoke(self, token_hash: bytes) -> bool: + query = """ + UPDATE sessions + SET revoked_at = clock_timestamp() + WHERE + token_hash = $1 + AND revoked_at IS NULL + AND expires_at > clock_timestamp(); + """ + async with self._pool.acquire() as conn: + status = await conn.execute(query, token_hash) + return self._parse_affected(status) > 0 + + @staticmethod + def _parse_affected(status: str) -> int: + return int(status.split()[-1]) diff --git a/src/infrastructure/repositories/user_repository/__init__.py b/src/infrastructure/repositories/user_repository/__init__.py new file mode 100644 index 00000000..96a76e43 --- /dev/null +++ b/src/infrastructure/repositories/user_repository/__init__.py @@ -0,0 +1,3 @@ +from .postgres import PostgresUserRepository + +__all__ = ["PostgresUserRepository"] diff --git a/src/infrastructure/repositories/user_repository/postgres.py b/src/infrastructure/repositories/user_repository/postgres.py new file mode 100644 index 00000000..2dd15290 --- /dev/null +++ b/src/infrastructure/repositories/user_repository/postgres.py @@ -0,0 +1,67 @@ +import asyncpg + +from domain import UserCredentialsSchema, UserSchema +from domain.errors import ConflictError +from infrastructure.utils import Pool, repository_logs +from interfaces import UserRepository + + +class PostgresUserRepository(UserRepository): + def __init__(self, pool: Pool) -> None: + self._pool = pool + + @repository_logs + async def create( + self, username: str, display_name: str, password_hash: str + ) -> UserSchema: + query = """ + INSERT INTO users + ( + username, + display_name, + password_hash + ) + VALUES + ( + $1, + $2, + $3 + ) + RETURNING id, username, display_name, created_at; + """ + async with self._pool.acquire() as conn: + try: + row = await conn.fetchrow(query, username, display_name, password_hash) + except asyncpg.UniqueViolationError: + raise ConflictError("Имя пользователя уже занято") from None + assert row is not None + return self._row_to_user(row) + + @repository_logs + async def get_credentials(self, username: str) -> UserCredentialsSchema | None: + query = """ + SELECT + id, + username, + display_name, + created_at, + password_hash + FROM users + WHERE username = $1; + """ + async with self._pool.acquire() as conn: + row = await conn.fetchrow(query, username) + if row is None: + return None + return UserCredentialsSchema( + user=self._row_to_user(row), password_hash=row["password_hash"] + ) + + @staticmethod + def _row_to_user(row: asyncpg.Record) -> UserSchema: + return UserSchema( + id=row["id"], + username=row["username"], + display_name=row["display_name"], + created_at=row["created_at"], + ) diff --git a/src/infrastructure/s3_client.py b/src/infrastructure/s3_client.py new file mode 100644 index 00000000..d32c8d66 --- /dev/null +++ b/src/infrastructure/s3_client.py @@ -0,0 +1,37 @@ +from typing import AsyncGenerator +import aioboto3 +from botocore.exceptions import ClientError +from config import LOGGER + +class S3Client: + def __init__(self, endpoint_url: str, region_name: str, access_key: str, secret_key: str, bucket_name: str): + self.endpoint_url = endpoint_url + self.region_name = region_name + self.access_key = access_key + self.secret_key = secret_key + self.bucket_name = bucket_name + self.session = aioboto3.Session() + + def _get_client(self): + return self.session.client("s3", endpoint_url=self.endpoint_url, region_name=self.region_name, aws_access_key_id=self.access_key, aws_secret_access_key=self.secret_key) + + async def upload_file(self, file_path: str, object_name: str, content_type: str) -> None: + async with self._get_client() as client: + try: + await client.upload_file(file_path, self.bucket_name, object_name, ExtraArgs={"ContentType": content_type}) + except ClientError as e: + LOGGER.error(f"Ошибка загрузки файла в S3: {e}") + raise + + async def stream_file(self, object_name: str) -> AsyncGenerator[bytes, None]: + async with self._get_client() as client: + try: + response = await client.get_object(Bucket=self.bucket_name, Key=object_name) + stream = response["Body"] + while True: + chunk = await stream.read(64 * 1024) + if not chunk: break + yield chunk + except ClientError as e: + LOGGER.error(f"Ошибка чтения файла из S3: {e}") + raise \ No newline at end of file diff --git a/src/infrastructure/security/__init__.py b/src/infrastructure/security/__init__.py new file mode 100644 index 00000000..0e01aecd --- /dev/null +++ b/src/infrastructure/security/__init__.py @@ -0,0 +1,4 @@ +from .password_hasher import PasswordHasher, get_password_hasher +from .tokens import generate_token, hash_token + +__all__ = ["PasswordHasher", "get_password_hasher", "generate_token", "hash_token"] diff --git a/src/infrastructure/security/password_hasher.py b/src/infrastructure/security/password_hasher.py new file mode 100644 index 00000000..9a3ca576 --- /dev/null +++ b/src/infrastructure/security/password_hasher.py @@ -0,0 +1,50 @@ +import asyncio +import secrets +from concurrent.futures import ThreadPoolExecutor + +from argon2 import PasswordHasher as Argon2Hasher +from argon2.exceptions import InvalidHashError, VerificationError +from argon2.profiles import RFC_9106_LOW_MEMORY +from starlette.requests import HTTPConnection + + +class PasswordHasher: + """ + Хеширование паролей с использованием Argon2id. + """ + + def __init__(self, workers: int) -> None: + self._hasher = Argon2Hasher.from_parameters(RFC_9106_LOW_MEMORY) + self._executor = ThreadPoolExecutor( + max_workers=workers, thread_name_prefix="argon2" + ) + self._dummy_hash = self._hasher.hash(secrets.token_urlsafe()) + + async def hash(self, password: str) -> str: + loop = asyncio.get_running_loop() + return await loop.run_in_executor(self._executor, self._hasher.hash, password) + + async def verify(self, password_hash: str, password: str) -> bool: + loop = asyncio.get_running_loop() + return await loop.run_in_executor( + self._executor, self._verify, password_hash, password + ) + + async def verify_dummy(self, password: str) -> None: + """Та же работа, что у verify, для выравнивания времени ответа""" + await self.verify(self._dummy_hash, password) + + def close(self) -> None: + self._executor.shutdown(wait=False, cancel_futures=True) + + def _verify(self, password_hash: str, password: str) -> bool: + try: + return self._hasher.verify(password_hash, password) + except (VerificationError, InvalidHashError): + return False + + +def get_password_hasher(connection: HTTPConnection) -> PasswordHasher: + """Получение hasher, созданного в lifespan.""" + hasher: PasswordHasher = connection.app.state.password_hasher + return hasher diff --git a/src/infrastructure/security/tokens.py b/src/infrastructure/security/tokens.py new file mode 100644 index 00000000..b7f7d6ba --- /dev/null +++ b/src/infrastructure/security/tokens.py @@ -0,0 +1,17 @@ +import hashlib +import secrets + + +def generate_token() -> str: + """Непрозрачный токен сессии: 256 бит из CSPRNG, base64url""" + return secrets.token_urlsafe(32) + + +def hash_token(token: str) -> bytes: + """ + SHA-256 токена для хранения и поиска. + + Токен уже имеет 256 бит энтропии, перебор невозможен, поэтому быстрый hash + достаточен; медленный KDF нужен паролям, у которых энтропия низкая. + """ + return hashlib.sha256(token.encode()).digest() diff --git a/src/infrastructure/services/__init__.py b/src/infrastructure/services/__init__.py new file mode 100644 index 00000000..77126f62 --- /dev/null +++ b/src/infrastructure/services/__init__.py @@ -0,0 +1,7 @@ +from .auth_service import AuthService +from .chat_service import ChatService +from .message_service import MessageService +from .user_service import UserService +from .attachment_service import AttachmentService + +__all__ = ["UserService", "AuthService", "ChatService", "MessageService", "AttachmentService", ] diff --git a/src/infrastructure/services/attachment_service/__init__.py b/src/infrastructure/services/attachment_service/__init__.py new file mode 100644 index 00000000..7e12e57f --- /dev/null +++ b/src/infrastructure/services/attachment_service/__init__.py @@ -0,0 +1,2 @@ +from .attachment_service import AttachmentService +__all__ = ["AttachmentService"] \ No newline at end of file diff --git a/src/infrastructure/services/attachment_service/attachment_service.py b/src/infrastructure/services/attachment_service/attachment_service.py new file mode 100644 index 00000000..4e2450b2 --- /dev/null +++ b/src/infrastructure/services/attachment_service/attachment_service.py @@ -0,0 +1,98 @@ +import struct +import os +from uuid import uuid4 +from datetime import datetime, UTC +from config import LOGGER +from domain import AttachmentSchema +from domain.errors import AppError, ErrorCode, InvalidRequestError, NotFoundError +from interfaces import AttachmentRepository, ChatRepository +from infrastructure.s3_client import S3Client + +class PayloadTooLargeError(AppError): + status_code = 413 + code = ErrorCode.PAYLOAD_TOO_LARGE + default_message = "Превышен лимит размера" + +class UnsupportedMediaTypeError(AppError): + status_code = 415 + code = ErrorCode.UNSUPPORTED_MEDIA_TYPE + default_message = "Неподдерживаемый формат" + +def validate_image_and_get_mime(file_path: str) -> str: + with open(file_path, "rb") as f: + header = f.read(24) + + if header.startswith(b"\x89PNG\r\n\x1a\n"): + w, h = struct.unpack(">II", header[16:24]) + if w * h > 40_000_000: + raise PayloadTooLargeError("Разрешение больше 40М пикселей") + return "image/png" + elif header[:2] == b"\xff\xd8": + with open(file_path, "rb") as f: + data = f.read() + i = 2 + sof = {0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf} + while i < len(data): + if data[i] != 0xff: raise UnsupportedMediaTypeError("Поврежденный JPEG") + while i < len(data) and data[i] == 0xff: i += 1 + if i >= len(data): break + marker = data[i] + i += 1 + if marker in {0xd9, 0xda}: break + if marker in {0x01, 0xd8} or 0xd0 <= marker <= 0xd7: continue + if i + 2 > len(data): break + length = int.from_bytes(data[i:i+2], "big") + if marker in sof: + if i + 7 > len(data): break + h = int.from_bytes(data[i+3:i+5], "big") + w = int.from_bytes(data[i+5:i+7], "big") + if w * h > 40_000_000: + raise PayloadTooLargeError("Разрешение больше 40М пикселей") + return "image/jpeg" + i += length + raise UnsupportedMediaTypeError("Не удалось найти размеры JPEG") + raise UnsupportedMediaTypeError("Формат не поддерживается") + +class AttachmentService: + def __init__(self, s3_client: S3Client, attachment_repo: AttachmentRepository, chat_repo: ChatRepository): + self._s3 = s3_client + self._attachments = attachment_repo + self._chats = chat_repo + + async def process_and_save(self, temp_file_path: str, filename: str, chat_id, owner_id, size_bytes: int, sha256_hash: str) -> AttachmentSchema: + if "/" in filename or "\\" in filename or "\0" in filename: + raise InvalidRequestError("Недопустимое имя файла") + + chat = await self._chats.get_for_member(chat_id, owner_id) + if not chat: + raise NotFoundError() + + mime = validate_image_and_get_mime(temp_file_path) + attachment_id = uuid4() + object_name = f"{chat_id}/{attachment_id}" + + await self._s3.upload_file(temp_file_path, object_name, mime) + LOGGER.info(f"Файл {attachment_id} загружен в S3") + + now = datetime.now(UTC) + attachment = AttachmentSchema( + id=attachment_id, chat_id=chat_id, owner_id=owner_id, + filename=filename, content_type=mime, size_bytes=size_bytes, + sha256=sha256_hash, status="ready", variants=[], + error_code=None, created_at=now, updated_at=now + ) + return await self._attachments.create(attachment) + + async def get_attachment_meta(self, attachment_id, user_id) -> AttachmentSchema: + att = await self._attachments.get_by_id(attachment_id) + if not att or not await self._chats.get_for_member(att.chat_id, user_id): + raise NotFoundError() + return att + + async def get_attachment_stream(self, attachment_id, user_id): + att = await self.get_attachment_meta(attachment_id, user_id) + if att.status != "ready": + from domain.errors import ConflictError + raise ConflictError("Файл еще не готов") + object_name = f"{att.chat_id}/{att.id}" + return self._s3.stream_file(object_name), att.content_type \ No newline at end of file diff --git a/src/infrastructure/services/auth_service/__init__.py b/src/infrastructure/services/auth_service/__init__.py new file mode 100644 index 00000000..3bde19dc --- /dev/null +++ b/src/infrastructure/services/auth_service/__init__.py @@ -0,0 +1,3 @@ +from .auth_service import AuthService + +__all__ = ["AuthService"] diff --git a/src/infrastructure/services/auth_service/auth_service.py b/src/infrastructure/services/auth_service/auth_service.py new file mode 100644 index 00000000..8fd4627b --- /dev/null +++ b/src/infrastructure/services/auth_service/auth_service.py @@ -0,0 +1,92 @@ +from datetime import UTC, datetime + +from config import LOGGER +from domain import BasicCredentialsSchema, SessionSchema, UserSchema +from domain.errors import InvalidCredentialsError, UnauthorizedError +from infrastructure.security import PasswordHasher, generate_token, hash_token +from interfaces import SessionCache, SessionRepository, UserRepository + +TOKEN_MAX_LENGTH = 256 + + +class AuthService: + """ + Basic → opaque Bearer-сессия. + + Источник истины — SessionRepository (PostgreSQL), SessionCache (Valkey) — + read-through кэш: при промахе или недоступности кэша сессия читается из БД. + """ + + def __init__( + self, + user_repository: UserRepository, + session_repository: SessionRepository, + session_cache: SessionCache, + hasher: PasswordHasher, + session_ttl_seconds: int, + ) -> None: + self._users = user_repository + self._sessions = session_repository + self._cache = session_cache + self._hasher = hasher + self._session_ttl = session_ttl_seconds + + async def login(self, credentials: BasicCredentialsSchema) -> SessionSchema: + """ + Создание сессии по username и паролю. + + Raises: + InvalidCredentialsError: неизвестный username или неверный пароль — + одинаковый ответ и сопоставимое время + """ + found = await self._users.get_credentials(credentials.username) + if found is None: + await self._hasher.verify_dummy(credentials.password) + raise InvalidCredentialsError() + if not await self._hasher.verify(found.password_hash, credentials.password): + raise InvalidCredentialsError() + token = generate_token() + expires_at = await self._sessions.create( + hash_token(token), found.user.id, self._session_ttl + ) + LOGGER.info(f"Создана сессия пользователя {found.user.id}") + return SessionSchema(token=token, expires_at=expires_at, user=found.user) + + async def authenticate(self, token: str | None) -> UserSchema: + """ + Владелец действующей сессии. + + Raises: + UnauthorizedError: токена нет, он неизвестен, истёк или отозван + UnavailableError: кэш промахнулся, а PostgreSQL недоступен + """ + if not token or len(token) > TOKEN_MAX_LENGTH: + raise UnauthorizedError() + token_hash = hash_token(token) + session = await self._cache.get(token_hash) + if session is not None and session.expires_at > datetime.now(UTC): + return session.user + session = await self._sessions.get_active(token_hash) + if session is None: + raise UnauthorizedError() + await self._cache.set(token_hash, session) + return session.user + + async def logout(self, token: str | None) -> None: + """ + Отзыв в источнике истины, затем инвалидация кэша. + + Raises: + UnauthorizedError: действующей сессии с таким токеном нет + """ + if not token or len(token) > TOKEN_MAX_LENGTH: + raise UnauthorizedError() + token_hash = hash_token(token) + if not await self._sessions.revoke(token_hash): + raise UnauthorizedError() + if not await self._cache.delete(token_hash): + LOGGER.warning( + "Сессия отозвана в PostgreSQL, но запись кэша не удалена: " + "она истечёт по TTL кэша" + ) + LOGGER.info("Сессия отозвана") diff --git a/src/infrastructure/services/chat_service/__init__.py b/src/infrastructure/services/chat_service/__init__.py new file mode 100644 index 00000000..800f4e1e --- /dev/null +++ b/src/infrastructure/services/chat_service/__init__.py @@ -0,0 +1,3 @@ +from .chat_service import ChatService + +__all__ = ["ChatService"] diff --git a/src/infrastructure/services/chat_service/chat_service.py b/src/infrastructure/services/chat_service/chat_service.py new file mode 100644 index 00000000..8cc6b884 --- /dev/null +++ b/src/infrastructure/services/chat_service/chat_service.py @@ -0,0 +1,46 @@ +from uuid import UUID + +from config import LOGGER +from domain import ChatPageSchema, ChatSchema, CreateChatSchema, UserSchema +from domain.errors import InvalidRequestError, NotFoundError +from infrastructure.utils import build_page, decode_cursor +from interfaces import ChatRepository + + +class ChatService: + def __init__(self, chat_repository: ChatRepository) -> None: + self._chats = chat_repository + + async def create_chat( + self, current_user: UserSchema, data: CreateChatSchema + ) -> ChatSchema: + """ + Чат создаётся из явного списка существующих участников, включая создателя. + Существование участников проверяет FK в транзакции создания: отдельная + предварительная проверка была бы гонкой и не нужна для отката. + """ + if current_user.id not in data.member_ids: + raise InvalidRequestError( + "member_ids должен содержать текущего пользователя" + ) + chat = await self._chats.create(data.title, current_user.id, data.member_ids) + LOGGER.info( + f"Создан чат {chat.id} пользователем {current_user.id}, " + f"участников: {len(chat.member_ids)}" + ) + return chat + + async def get_chat(self, current_user: UserSchema, chat_id: UUID) -> ChatSchema: + chat = await self._chats.get_for_member(chat_id, current_user.id) + if chat is None: + raise NotFoundError() + return chat + + async def list_chats( + self, current_user: UserSchema, limit: int, cursor: str | None + ) -> ChatPageSchema: + scope = f"chats:{current_user.id}" + after = decode_cursor(cursor, scope) + fetched = await self._chats.list_for_member(current_user.id, after, limit + 1) + items, next_cursor = build_page(fetched, limit, scope) + return ChatPageSchema(items=items, next_cursor=next_cursor) diff --git a/src/infrastructure/services/message_service/__init__.py b/src/infrastructure/services/message_service/__init__.py new file mode 100644 index 00000000..d834d91d --- /dev/null +++ b/src/infrastructure/services/message_service/__init__.py @@ -0,0 +1,3 @@ +from .message_service import MessageService + +__all__ = ["MessageService"] diff --git a/src/infrastructure/services/message_service/message_service.py b/src/infrastructure/services/message_service/message_service.py new file mode 100644 index 00000000..9a6096ef --- /dev/null +++ b/src/infrastructure/services/message_service/message_service.py @@ -0,0 +1,83 @@ +import hashlib +from uuid import UUID + +from config import LOGGER +from domain import ( + CreateMessageSchema, + IdempotencyKeySchema, + MessagePageSchema, + MessageSchema, + UserSchema, +) +from domain.errors import NotFoundError +from infrastructure.utils import build_page, decode_cursor +from interfaces import ChatRepository, MessageRepository + + +class MessageService: + def __init__( + self, + chat_repository: ChatRepository, + message_repository: MessageRepository, + idempotency_ttl_seconds: int, + ) -> None: + self._chats = chat_repository + self._messages = message_repository + self._idempotency_ttl = idempotency_ttl_seconds + + async def send_message( + self, + current_user: UserSchema, + chat_id: UUID, + data: CreateMessageSchema, + idempotency_key: str, + ) -> MessageSchema: + """ + Отправитель берётся из текущей идентификации; текст в логи не пишется. + + Повтор с тем же Idempotency-Key заново проверяет доступ к чату + и возвращает исходное сообщение. + """ + await self._ensure_member(current_user, chat_id) + idempotency = IdempotencyKeySchema( + key=idempotency_key, + request_hash=self._request_hash(data), + ttl_seconds=self._idempotency_ttl, + ) + message, created = await self._messages.create( + chat_id, current_user.id, data.text, data.attachment_ids, idempotency + ) + if created: + LOGGER.info( + f"Сообщение {message.id} отправлено в чат {chat_id} " + f"пользователем {current_user.id}" + ) + else: + LOGGER.info( + f"Повтор по Idempotency-Key: возвращено сообщение {message.id} " + f"чата {chat_id}" + ) + return message + + async def list_messages( + self, current_user: UserSchema, chat_id: UUID, limit: int, cursor: str | None + ) -> MessagePageSchema: + await self._ensure_member(current_user, chat_id) + scope = f"messages:{chat_id}" + after = decode_cursor(cursor, scope) + fetched = await self._messages.list_for_chat(chat_id, after, limit + 1) + items, next_cursor = build_page(fetched, limit, scope) + return MessagePageSchema(items=items, next_cursor=next_cursor) + + async def _ensure_member(self, current_user: UserSchema, chat_id: UUID) -> None: + """Посторонний получает 404: существование чужого чата не раскрывается""" + if await self._chats.get_for_member(chat_id, current_user.id) is None: + raise NotFoundError() + + @staticmethod + def _request_hash(data: CreateMessageSchema) -> bytes: + """ + SHA-256 канонического тела. Порядок полей задаёт схема, а не клиент, + поэтому JSON с другим порядком ключей считается тем же запросом. + """ + return hashlib.sha256(data.model_dump_json().encode()).digest() diff --git a/src/infrastructure/services/user_service/__init__.py b/src/infrastructure/services/user_service/__init__.py new file mode 100644 index 00000000..3b69507f --- /dev/null +++ b/src/infrastructure/services/user_service/__init__.py @@ -0,0 +1,3 @@ +from .user_service import UserService + +__all__ = ["UserService"] diff --git a/src/infrastructure/services/user_service/user_service.py b/src/infrastructure/services/user_service/user_service.py new file mode 100644 index 00000000..36b0f0b4 --- /dev/null +++ b/src/infrastructure/services/user_service/user_service.py @@ -0,0 +1,17 @@ +from config import LOGGER +from domain import CreateUserSchema, UserSchema +from infrastructure.security import PasswordHasher +from interfaces import UserRepository + + +class UserService: + def __init__(self, repository: UserRepository, hasher: PasswordHasher) -> None: + self._repo = repository + self._hasher = hasher + + async def register(self, data: CreateUserSchema) -> UserSchema: + """Пароль сохраняется только как hash Argon2id""" + password_hash = await self._hasher.hash(data.password) + user = await self._repo.create(data.username, data.display_name, password_hash) + LOGGER.info(f"Зарегистрирован пользователь {user.id}") + return user diff --git a/src/infrastructure/utils/__init__.py b/src/infrastructure/utils/__init__.py new file mode 100644 index 00000000..206e65c3 --- /dev/null +++ b/src/infrastructure/utils/__init__.py @@ -0,0 +1,15 @@ +from .pagination import build_page, decode_cursor, encode_cursor, page_key +from .repository_utils import DATABASE_UNAVAILABLE_ERRORS, repository_logs +from .transaction import ConnectionPool, Pool, transaction + +__all__ = [ + "page_key", + "encode_cursor", + "decode_cursor", + "build_page", + "repository_logs", + "DATABASE_UNAVAILABLE_ERRORS", + "ConnectionPool", + "Pool", + "transaction", +] diff --git a/src/infrastructure/utils/pagination.py b/src/infrastructure/utils/pagination.py new file mode 100644 index 00000000..91c13c30 --- /dev/null +++ b/src/infrastructure/utils/pagination.py @@ -0,0 +1,44 @@ +import base64 +import binascii + +from pydantic import ValidationError + +from domain import ChatSchema, MessageSchema, PageCursorSchema, PageKey +from domain.errors import InvalidRequestError + +PageItem = ChatSchema | MessageSchema + + +def page_key(item: PageItem) -> PageKey: + return PageKey(item.created_at, item.id) + + +def encode_cursor(scope: str, key: PageKey) -> str: + """Непрозрачный cursor: base64url от JSON с ресурсом и ключом последнего элемента""" + payload = PageCursorSchema(scope=scope, created_at=key.created_at, id=key.id) + encoded = base64.urlsafe_b64encode(payload.model_dump_json().encode()) + return encoded.decode().rstrip("=") + + +def decode_cursor(raw: str | None, scope: str) -> PageKey | None: + """Разбор cursor, привязанного к ресурсу.""" + if raw is None: + return None + try: + decoded = base64.urlsafe_b64decode(raw + "=" * (-len(raw) % 4)) + cursor = PageCursorSchema.model_validate_json(decoded) + except (binascii.Error, ValueError, ValidationError): + raise InvalidRequestError("Некорректный cursor") from None + if cursor.scope != scope: + raise InvalidRequestError("cursor выдан для другого ресурса") + return cursor.key + + +def build_page( + fetched: list[PageItem], limit: int, scope: str +) -> tuple[list[PageItem], str | None]: + """Отрезает страницу из limit + 1 полученных элементов.""" + items = fetched[:limit] + if len(fetched) <= limit: + return items, None + return items, encode_cursor(scope, page_key(items[-1])) diff --git a/src/infrastructure/utils/repository_utils.py b/src/infrastructure/utils/repository_utils.py new file mode 100644 index 00000000..e450afe1 --- /dev/null +++ b/src/infrastructure/utils/repository_utils.py @@ -0,0 +1,39 @@ +from collections.abc import Callable +from functools import wraps +from typing import Any + +import asyncpg + +from config import LOGGER +from domain.errors import UnavailableError + +DATABASE_UNAVAILABLE_ERRORS: tuple[type[Exception], ...] = ( + OSError, + TimeoutError, + asyncpg.PostgresConnectionError, + asyncpg.InterfaceError, + asyncpg.exceptions.OperatorInterventionError, + asyncpg.exceptions.InsufficientResourcesError, +) + + +def repository_logs(func: Callable) -> Callable: + """ + Decorator for logging database requests. + """ + + @wraps(func) + async def wrapper(*args: Any, **kwargs: Any) -> Any: + log_text = ( + f"Request to DATABASE || Object: {args[0].__class__.__name__} " + f"|| Function: {func.__name__} || " + ) + try: + result = await func(*args, **kwargs) + except DATABASE_UNAVAILABLE_ERRORS as error: + LOGGER.warning(log_text + f"failed || Error: {type(error).__name__}") + raise UnavailableError() from None + LOGGER.debug(log_text + "completed") + return result + + return wrapper diff --git a/src/infrastructure/utils/transaction.py b/src/infrastructure/utils/transaction.py new file mode 100644 index 00000000..e4d18efa --- /dev/null +++ b/src/infrastructure/utils/transaction.py @@ -0,0 +1,29 @@ +from collections.abc import AsyncIterator +from contextlib import AbstractAsyncContextManager, asynccontextmanager +from typing import Protocol + +import asyncpg + + +class Pool(Protocol): + """Источник соединений: DatabasePoolManager или одно соединение транзакции""" + + def acquire(self) -> AbstractAsyncContextManager[asyncpg.Connection]: ... + + +class ConnectionPool: + """Pool-подобная обёртка над одним соединением.""" + + def __init__(self, conn: asyncpg.Connection) -> None: + self.connection = conn + + @asynccontextmanager + async def acquire(self) -> AsyncIterator[asyncpg.Connection]: + yield self.connection + + +@asynccontextmanager +async def transaction(pool: Pool) -> AsyncIterator[asyncpg.Connection]: + async with pool.acquire() as conn: + async with conn.transaction(): + yield conn diff --git a/src/interfaces/__init__.py b/src/interfaces/__init__.py new file mode 100644 index 00000000..2265dcb0 --- /dev/null +++ b/src/interfaces/__init__.py @@ -0,0 +1,15 @@ +from .chat_repository import ChatRepository +from .message_repository import MessageRepository +from .session_cache import SessionCache +from .session_repository import SessionRepository +from .user_repository import UserRepository +from .attachment_repository import AttachmentRepository + +__all__ = [ + "UserRepository", + "ChatRepository", + "MessageRepository", + "SessionRepository", + "SessionCache", + "AttachmentRepository", +] diff --git a/src/interfaces/attachment_repository.py b/src/interfaces/attachment_repository.py new file mode 100644 index 00000000..f4dce722 --- /dev/null +++ b/src/interfaces/attachment_repository.py @@ -0,0 +1,12 @@ +from abc import ABC, abstractmethod +from uuid import UUID +from domain import AttachmentSchema + +class AttachmentRepository(ABC): + @abstractmethod + async def create(self, attachment: AttachmentSchema) -> AttachmentSchema: + pass + + @abstractmethod + async def get_by_id(self, attachment_id: UUID) -> AttachmentSchema | None: + pass \ No newline at end of file diff --git a/src/interfaces/chat_repository.py b/src/interfaces/chat_repository.py new file mode 100644 index 00000000..1821c8d7 --- /dev/null +++ b/src/interfaces/chat_repository.py @@ -0,0 +1,34 @@ +from abc import ABC, abstractmethod +from uuid import UUID + +from domain import ChatSchema, PageKey + + +class ChatRepository(ABC): + """Слой абстракции хранилища чатов""" + + @abstractmethod + async def create( + self, title: str, created_by: UUID, member_ids: list[UUID] + ) -> ChatSchema: + """ + создание чата вместе с участниками: при любой ошибке + не остаётся ни чата, ни части участников. + """ + pass + + @abstractmethod + async def get_for_member(self, chat_id: UUID, member_id: UUID) -> ChatSchema | None: + """ + Получение чата, только если пользователь является его участником. + """ + pass + + @abstractmethod + async def list_for_member( + self, member_id: UUID, after: PageKey | None, limit: int + ) -> list[ChatSchema]: + """ + Чаты пользователя по (created_at, id) по возрастанию. + """ + pass diff --git a/src/interfaces/message_repository.py b/src/interfaces/message_repository.py new file mode 100644 index 00000000..441dac74 --- /dev/null +++ b/src/interfaces/message_repository.py @@ -0,0 +1,30 @@ +from abc import ABC, abstractmethod +from uuid import UUID + +from domain import IdempotencyKeySchema, MessageSchema, PageKey + + +class MessageRepository(ABC): + """Слой абстракции хранилища сообщений""" + + @abstractmethod + async def create(self, chat_id: UUID, sender_id: UUID, text: str, attachment_ids: list[UUID], idempotency: IdempotencyKeySchema) -> tuple[MessageSchema, bool]: + """ + Добавление сообщения в конец истории чата. id и created_at назначает + хранилище; created_at строго возрастает внутри чата, поэтому сообщение + не может появиться перед уже выданным cursor. + + Сообщение и запись ключа идемпотентности сохраняются атомарно. + Одновременные запросы с одним ключом через любые реплики создают + ровно одно сообщение; повтор возвращает его же. + """ + pass + + @abstractmethod + async def list_for_chat( + self, chat_id: UUID, after: PageKey | None, limit: int + ) -> list[MessageSchema]: + """ + История чата по (created_at, id) по возрастанию. + """ + pass diff --git a/src/interfaces/session_cache.py b/src/interfaces/session_cache.py new file mode 100644 index 00000000..3cab29cf --- /dev/null +++ b/src/interfaces/session_cache.py @@ -0,0 +1,35 @@ +from abc import ABC, abstractmethod + +from domain import ActiveSessionSchema + + +class SessionCache(ABC): + """ + Слой абстракции кэша сессий. Кэш не источник истины: любой метод при + недоступности кэша не бросает исключение, а сообщает промах/пропуск, + и вызывающий идёт в SessionRepository. + """ + + @abstractmethod + async def get(self, token_hash: bytes) -> ActiveSessionSchema | None: + """ + Сессия из кэша. + """ + pass + + @abstractmethod + async def set(self, token_hash: bytes, session: ActiveSessionSchema) -> None: + """Запись сессии с TTL не дольше её оставшейся жизни""" + pass + + @abstractmethod + async def delete(self, token_hash: bytes) -> bool: + """ + Инвалидация записи после отзыва сессии. + """ + pass + + @abstractmethod + async def ping(self) -> bool: + """Доступность кэша для readiness и диагностики""" + pass diff --git a/src/interfaces/session_repository.py b/src/interfaces/session_repository.py new file mode 100644 index 00000000..4fe05af6 --- /dev/null +++ b/src/interfaces/session_repository.py @@ -0,0 +1,36 @@ +from abc import ABC, abstractmethod +from datetime import datetime +from uuid import UUID + +from domain import ActiveSessionSchema + + +class SessionRepository(ABC): + """ + Слой абстракции хранилища сессий — источника истины. + Хранится только hash токена, сам токен знает лишь клиент. + """ + + @abstractmethod + async def create( + self, token_hash: bytes, user_id: UUID, ttl_seconds: int + ) -> datetime: + """ + Сохранение новой сессии. Срок считается по часам хранилища — тем же, + по которым потом проверяется истечение. + """ + pass + + @abstractmethod + async def get_active(self, token_hash: bytes) -> ActiveSessionSchema | None: + """ + Действующая сессия: не истекла и не отозвана. + """ + pass + + @abstractmethod + async def revoke(self, token_hash: bytes) -> bool: + """ + Отзыв действующей сессии (logout). + """ + pass diff --git a/src/interfaces/user_repository.py b/src/interfaces/user_repository.py new file mode 100644 index 00000000..5e6afb24 --- /dev/null +++ b/src/interfaces/user_repository.py @@ -0,0 +1,24 @@ +from abc import ABC, abstractmethod + +from domain import UserCredentialsSchema, UserSchema + + +class UserRepository(ABC): + """Слой абстракции хранилища пользователей""" + + @abstractmethod + async def create( + self, username: str, display_name: str, password_hash: str + ) -> UserSchema: + """ + Сохранение пользователя. Уникальность username гарантирует хранилище, + поэтому одновременные регистрации одного имени не создают дубликат. + """ + pass + + @abstractmethod + async def get_credentials(self, username: str) -> UserCredentialsSchema | None: + """ + Пользователь и hash его пароля для проверки входа. + """ + pass diff --git a/src/migrate.py b/src/migrate.py new file mode 100644 index 00000000..0ec58ace --- /dev/null +++ b/src/migrate.py @@ -0,0 +1,24 @@ +""" +Однократное применение миграций до запуска API-реплик. + +Запускается сервисом migrate (compose) и завершается; реплики стартуют +после его успешного завершения и только проверяют версию схемы. +""" + +import asyncio + +from config import DB_STARTUP_TIMEOUT_SEC, LOGGER +from infrastructure import database_pool_manager + + +async def main() -> None: + await database_pool_manager.create_pool(DB_STARTUP_TIMEOUT_SEC) + try: + await database_pool_manager.apply_migrations() + finally: + await database_pool_manager.close() + LOGGER.info("Миграции применены, migrate завершается") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/student-tests/conftest.py b/student-tests/conftest.py new file mode 100644 index 00000000..21ed26a1 --- /dev/null +++ b/student-tests/conftest.py @@ -0,0 +1,77 @@ +import json +import os +from collections.abc import Callable, Iterator +from pathlib import Path + +import httpx +import pytest +from helpers import auth, basic, message_headers, unique_password, unique_username + +ROOT = Path(__file__).resolve().parents[1] +DEFAULT_BASE_URL = json.loads((ROOT / "lab.json").read_text())["default_base_url"] + +REQUEST_TIMEOUT_SEC = 10 + + +@pytest.fixture(scope="session") +def base_url() -> str: + return os.environ.get("BASE_URL") or DEFAULT_BASE_URL + + +@pytest.fixture(scope="session") +def api(base_url: str) -> Iterator[httpx.Client]: + # trust_env=False отключает перехват локального трафика системными прокси Windows/VPN + with httpx.Client(base_url=base_url, timeout=REQUEST_TIMEOUT_SEC, trust_env=False) as client: + yield client + + +def register_and_login( + client: httpx.Client, label: str, display_name: str | None = None +) -> dict: + """Регистрация и вход; в словаре User плюс token и password для тестов""" + username = unique_username(label) + password = unique_password() + body = { + "username": username, + "display_name": display_name or f"Студент {label}", + "password": password, + } + response = client.post("/api/v1/users", json=body) + assert response.status_code == 201, response.text + user = response.json() + session = client.post("/api/v1/auth/sessions", headers=basic(username, password)) + assert session.status_code == 201, session.text + return {**user, "token": session.json()["token"], "password": password} + + +@pytest.fixture +def make_user(api: httpx.Client) -> Callable[..., dict]: + def create(label: str = "user", display_name: str | None = None) -> dict: + return register_and_login(api, label, display_name) + + return create + + +@pytest.fixture +def make_chat(api: httpx.Client) -> Callable[..., dict]: + def create(owner: dict, members: list[dict], title: str = "Тестовый чат") -> dict: + body = {"title": title, "member_ids": [member["id"] for member in members]} + response = api.post("/api/v1/chats", json=body, headers=auth(owner)) + assert response.status_code == 201, response.text + return response.json() + + return create + + +@pytest.fixture +def send_message(api: httpx.Client) -> Callable[..., dict]: + def send(user: dict, chat: dict, text: str) -> dict: + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": text}, + headers=message_headers(user), + ) + assert response.status_code == 201, response.text + return response.json() + + return send diff --git a/student-tests/helpers.py b/student-tests/helpers.py new file mode 100644 index 00000000..bb3adaaf --- /dev/null +++ b/student-tests/helpers.py @@ -0,0 +1,103 @@ +"""Общие проверки для собственных black-box тестов""" + +import base64 +import subprocess +import uuid +from pathlib import Path + +import httpx + +ROOT = Path(__file__).resolve().parents[1] + +USER_FIELDS = ("id", "username", "display_name", "created_at") + + +def unique_username(label: str) -> str: + return f"st_{label}_{uuid.uuid4().hex[:12]}" + + +def unique_password() -> str: + return f"Pw-{uuid.uuid4().hex}" + + +def basic(username: str, password: str) -> dict[str, str]: + """Authorization: Basic; пароль кодируется в UTF-8""" + raw = f"{username}:{password}".encode() + return {"Authorization": "Basic " + base64.b64encode(raw).decode()} + + +def auth(user: dict) -> dict[str, str]: + return {"Authorization": f"Bearer {user['token']}"} + + +def message_headers(user: dict, key: str | None = None) -> dict[str, str]: + """Bearer и Idempotency-Key (новый, если не задан)""" + return {**auth(user), "Idempotency-Key": key or uuid.uuid4().hex} + + +def public_user(user: dict) -> dict: + """User из ответа API без тестовых полей token/password""" + return {field: user[field] for field in USER_FIELDS} + + +def assert_error(response: httpx.Response, status: int, code: str) -> None: + """Код ответа и единый формат ошибки: request_id совпадает с заголовком""" + assert response.status_code == status, response.text + assert response.headers["content-type"].startswith("application/json") + error = response.json()["error"] + assert error["code"] == code + assert error["message"] + assert error["request_id"] == response.headers["X-Request-Id"] + + +def assert_unauthorized(response: httpx.Response, scheme: str = "Bearer") -> None: + """401 с challenge нужной схемы""" + assert_error(response, 401, "unauthorized") + assert response.headers["WWW-Authenticate"].startswith(scheme) + + +def read_all_messages( + api: httpx.Client, user: dict, chat_id: str, limit: int +) -> tuple[list[dict], int]: + """Обход истории по next_cursor; возвращает сообщения и число страниц""" + items: list[dict] = [] + pages = 0 + params: dict[str, str | int] = {"limit": limit} + while True: + response = api.get( + f"/api/v1/chats/{chat_id}/messages", params=params, headers=auth(user) + ) + assert response.status_code == 200, response.text + page = response.json() + items.extend(page["items"]) + pages += 1 + if page["next_cursor"] is None: + return items, pages + params = {"limit": limit, "cursor": page["next_cursor"]} + + +def compose(*args: str, stdin: str | None = None) -> str: + """docker compose из корня репозитория; вывод не печатается (может быть секретен)""" + result = subprocess.run( + ["docker", "compose", "--env-file", ".env", *args], + cwd=ROOT, + input=stdin, + capture_output=True, + text=True, + timeout=120, + check=True, + ) + return result.stdout + + +def psql(sql: str) -> str: + """Запрос в PostgreSQL стенда изнутри контейнера; порт БД наружу не открыт""" + return compose( + "exec", + "-T", + "postgres", + "sh", + "-c", + 'psql -X -q -tA -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d "$POSTGRES_DB"', + stdin=sql, + ).strip() diff --git a/student-tests/test_attachments.py b/student-tests/test_attachments.py new file mode 100644 index 00000000..10be1d86 --- /dev/null +++ b/student-tests/test_attachments.py @@ -0,0 +1,97 @@ +import os +from uuid import uuid4 +import httpx +import pytest +from helpers import auth, message_headers + +@pytest.fixture +def sample_image_path() -> str: + path = "test_image.png" + # Валидный 1x1 PNG файл + with open(path, "wb") as f: + f.write(b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\rIDATx\x9cc\xf8\xff\xff?\x00\x05\xfe\x02\xfe\xa74\x00\x00\x00\x00IEND\xaeB`\x82') + yield path + if os.path.exists(path): + os.remove(path) + +@pytest.fixture +def fake_txt_path() -> str: + path = "fake.png" + with open(path, "w") as f: + f.write("Not a real image file!") + yield path + if os.path.exists(path): + os.remove(path) + + +def test_upload_valid_attachment(api: httpx.Client, make_user, make_chat, sample_image_path): + alice = make_user("alice") + chat = make_chat(alice, [alice]) + + with open(sample_image_path, "rb") as f: + response = api.post( + f"/api/v1/chats/{chat['id']}/attachments", + params={"filename": "photo.png"}, + content=f.read(), + headers={**auth(alice), "Content-Type": "image/png"} + ) + + assert response.status_code == 201, response.text + data = response.json() + assert data["status"] == "ready" + assert data["filename"] == "photo.png" + assert data["content_type"] == "image/png" + + +def test_upload_invalid_mime(api: httpx.Client, make_user, make_chat, fake_txt_path): + alice = make_user("alice") + chat = make_chat(alice, [alice]) + + with open(fake_txt_path, "rb") as f: + response = api.post( + f"/api/v1/chats/{chat['id']}/attachments", + params={"filename": "photo.png"}, + content=f.read(), + headers={**auth(alice), "Content-Type": "image/png"} + ) + + assert response.status_code == 415, response.text + + +def test_upload_invalid_filename(api: httpx.Client, make_user, make_chat, sample_image_path): + alice = make_user("alice") + chat = make_chat(alice, [alice]) + + with open(sample_image_path, "rb") as f: + response = api.post( + f"/api/v1/chats/{chat['id']}/attachments", + params={"filename": "../../../etc/passwd"}, + content=f.read(), + headers={**auth(alice), "Content-Type": "image/png"} + ) + + assert response.status_code == 400, response.text + + +def test_attach_file_to_message(api: httpx.Client, make_user, make_chat, sample_image_path): + alice = make_user("alice") + chat = make_chat(alice, [alice]) + + with open(sample_image_path, "rb") as f: + upload_resp = api.post( + f"/api/v1/chats/{chat['id']}/attachments", + params={"filename": "photo.png"}, + content=f.read(), + headers={**auth(alice), "Content-Type": "image/png"} + ) + assert upload_resp.status_code == 201, upload_resp.text + attachment_id = upload_resp.json()["id"] + + msg_resp = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": "Смотри фото!", "attachment_ids": [attachment_id]}, + headers=message_headers(alice) + ) + + assert msg_resp.status_code == 201, msg_resp.text + assert attachment_id in msg_resp.json()["attachment_ids"] \ No newline at end of file diff --git a/student-tests/test_auth.py b/student-tests/test_auth.py new file mode 100644 index 00000000..919f24d2 --- /dev/null +++ b/student-tests/test_auth.py @@ -0,0 +1,131 @@ +"""Вход по Basic, opaque Bearer-сессия, неверный пароль и logout""" + +import base64 +from datetime import UTC, datetime + +import httpx +import pytest +from helpers import ( + assert_unauthorized, + auth, + basic, + psql, + public_user, + unique_username, +) + +SESSIONS_PATH = "/api/v1/auth/sessions" +CURRENT_SESSION_PATH = "/api/v1/auth/sessions/current" + + +def test_login_returns_opaque_bearer_session(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + response = api.post( + SESSIONS_PATH, headers=basic(alice["username"], alice["password"]) + ) + assert response.status_code == 201, response.text + session = response.json() + assert set(session) == {"token", "token_type", "expires_at", "user"} + assert session["token_type"] == "Bearer" + assert session["user"] == public_user(alice) + assert len(session["token"]) >= 43 # 32 байта в base64url + assert alice["id"] not in session["token"] + assert alice["username"] not in session["token"] + assert session["token"] != alice["token"] + expires_at = datetime.fromisoformat(session["expires_at"].replace("Z", "+00:00")) + assert expires_at > datetime.now(UTC) + + +def test_wrong_password_and_unknown_user_are_indistinguishable( + api: httpx.Client, make_user +) -> None: + alice = make_user("alice") + wrong = api.post(SESSIONS_PATH, headers=basic(alice["username"], "Wrong-pass-123")) + unknown = api.post( + SESSIONS_PATH, headers=basic(unique_username("ghost"), "Wrong-pass-123") + ) + for response in (wrong, unknown): + assert_unauthorized(response, scheme="Basic") + assert 'realm="messenger"' in response.headers["WWW-Authenticate"] + assert wrong.json()["error"]["message"] == unknown.json()["error"]["message"] + + +@pytest.mark.parametrize( + "authorization", + [ + None, + "", + "Basic", + "Basic !!!not-base64!!!", + "Basic " + base64.b64encode(b"no-colon-here").decode(), + "Basic " + base64.b64encode(b"\xff\xfe:password").decode(), + "Bearer some-token", + ], +) +def test_malformed_basic_is_unauthorized( + api: httpx.Client, authorization: str | None +) -> None: + headers = {} if authorization is None else {"Authorization": authorization} + assert_unauthorized(api.post(SESSIONS_PATH, headers=headers), scheme="Basic") + + +def test_utf8_password_with_colon(api: httpx.Client) -> None: + username = unique_username("utf") + password = "пароль:с:двоеточием 🔐" + body = {"username": username, "display_name": "x", "password": password} + assert api.post("/api/v1/users", json=body).status_code == 201 + assert api.post(SESSIONS_PATH, headers=basic(username, password)).status_code == 201 + assert_unauthorized( + api.post(SESSIONS_PATH, headers=basic(username, "пароль:с:двоеточием")), + scheme="Basic", + ) + + +def test_basic_is_rejected_on_business_endpoints(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + headers = basic(alice["username"], alice["password"]) + assert_unauthorized(api.get("/api/v1/users/me", headers=headers)) + assert_unauthorized(api.get("/api/v1/chats", headers=headers)) + + +def test_logout_revokes_only_current_session(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + second = api.post( + SESSIONS_PATH, headers=basic(alice["username"], alice["password"]) + ) + other_session = {**alice, "token": second.json()["token"]} + + assert api.get("/api/v1/users/me", headers=auth(alice)).status_code == 200 + response = api.delete(CURRENT_SESSION_PATH, headers=auth(alice)) + assert response.status_code == 204 + assert response.content == b"" + + assert_unauthorized(api.get("/api/v1/users/me", headers=auth(alice))) + assert_unauthorized(api.delete(CURRENT_SESSION_PATH, headers=auth(alice))) + assert api.get("/api/v1/users/me", headers=auth(other_session)).status_code == 200 + + +def test_logout_without_token(api: httpx.Client) -> None: + assert_unauthorized(api.delete(CURRENT_SESSION_PATH)) + assert_unauthorized( + api.delete(CURRENT_SESSION_PATH, headers={"Authorization": "Bearer unknown"}) + ) + + +def test_relogin_after_logout(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + api.delete(CURRENT_SESSION_PATH, headers=auth(alice)) + again = api.post(SESSIONS_PATH, headers=basic(alice["username"], alice["password"])) + assert again.status_code == 201 + renewed = {**alice, "token": again.json()["token"]} + assert api.get("/api/v1/users/me", headers=auth(renewed)).status_code == 200 + + +def test_password_is_not_stored_in_plaintext(make_user) -> None: + """Проверка в БД стенда: в users лежит PHC-строка Argon2id, а не пароль""" + alice = make_user("alice") + stored = psql( + f"SELECT password_hash FROM users WHERE username = '{alice['username']}';" + ) + assert stored.startswith("$argon2id$") + assert alice["password"] not in stored diff --git a/student-tests/test_balancing.py b/student-tests/test_balancing.py new file mode 100644 index 00000000..5b89e1cb --- /dev/null +++ b/student-tests/test_balancing.py @@ -0,0 +1,74 @@ +""" +Балансировка без sticky sessions: запросы одной сессии обслуживают разные +реплики, а состояние (сессии, сообщения, logout) общее для всех. +""" + +import uuid +from collections import Counter + +import httpx +from helpers import assert_unauthorized, auth, message_headers, public_user + +REQUESTS = 20 + + +def test_one_session_is_served_by_several_replicas( + api: httpx.Client, make_user +) -> None: + """Одно keep-alive соединение клиента к LB, без повторного входа""" + alice = make_user("alice") + instances: Counter[str] = Counter() + for _ in range(REQUESTS): + response = api.get("/api/v1/users/me", headers=auth(alice)) + assert response.status_code == 200, response.text + assert response.json() == public_user(alice) + instances[response.headers["X-Instance-Id"]] += 1 + print("\nINSTANCES FOR ONE SESSION:", dict(instances)) + assert len(instances) >= 2 + + +def test_write_is_visible_through_every_replica( + api: httpx.Client, make_user, make_chat +) -> None: + alice = make_user("alice") + bob = make_user("bob") + chat = make_chat(alice, [alice, bob]) + sent = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": f"видно везде {uuid.uuid4().hex}"}, + headers=message_headers(alice), + ) + assert sent.status_code == 201, sent.text + readers: set[str] = set() + for _ in range(REQUESTS): + page = api.get(f"/api/v1/chats/{chat['id']}/messages", headers=auth(bob)) + assert page.status_code == 200, page.text + assert page.json()["items"] == [sent.json()] + readers.add(page.headers["X-Instance-Id"]) + assert len(readers) >= 2 + + +def test_logout_applies_to_all_replicas(api: httpx.Client, make_user) -> None: + """Сессия попала в общий кэш через обе реплики, затем отозвана на одной""" + alice = make_user("alice") + for _ in range(4): + assert api.get("/api/v1/users/me", headers=auth(alice)).status_code == 200 + logout = api.delete("/api/v1/auth/sessions/current", headers=auth(alice)) + assert logout.status_code == 204 + rejected_by: set[str] = set() + for _ in range(REQUESTS): + response = api.get("/api/v1/users/me", headers=auth(alice)) + assert_unauthorized(response) + rejected_by.add(response.headers["X-Instance-Id"]) + assert len(rejected_by) >= 2 + + +def test_every_api_response_has_instance_id(api: httpx.Client) -> None: + for response in ( + api.get("/health/live"), + api.get("/health/ready"), + api.get("/api/v1/unknown"), + api.get("/api/v1/users/me"), + ): + assert response.headers["X-Instance-Id"] + assert response.headers["X-Request-Id"] diff --git a/student-tests/test_concurrency.py b/student-tests/test_concurrency.py new file mode 100644 index 00000000..ab8c495d --- /dev/null +++ b/student-tests/test_concurrency.py @@ -0,0 +1,78 @@ +"""Защита состояния от гонок: 100 сообщений от 10 параллельных клиентов""" + +import asyncio +import json +import time + +import httpx +from helpers import auth, message_headers, read_all_messages + +CLIENTS = 10 +MESSAGES_PER_CLIENT = 10 +TOTAL_MESSAGES = CLIENTS * MESSAGES_PER_CLIENT +PAGE_LIMIT = 30 + + +async def _send_concurrently( + base_url: str, chat_id: str, users: list[dict] +) -> list[int]: + """Каждый клиент — отдельный пользователь и пул соединений; старт по сигналу""" + start = asyncio.Event() + + async def client_worker(user: dict) -> list[int]: + async with httpx.AsyncClient( + base_url=base_url, headers=auth(user), timeout=30 + ) as client: + await start.wait() + responses = await asyncio.gather( + *( + client.post( + f"/api/v1/chats/{chat_id}/messages", + json={"text": f"{user['username']}#{n}"}, + headers=message_headers(user), + ) + for n in range(MESSAGES_PER_CLIENT) + ) + ) + return [response.status_code for response in responses] + + workers = [asyncio.create_task(client_worker(user)) for user in users] + await asyncio.sleep(0) + start.set() + results = await asyncio.gather(*workers) + return [status for statuses in results for status in statuses] + + +def test_parallel_messages_are_not_lost_or_duplicated( + api: httpx.Client, base_url: str, make_user, make_chat +) -> None: + users = [make_user(f"c{n}") for n in range(CLIENTS)] + chat = make_chat(users[0], users) + + started = time.perf_counter() + statuses = asyncio.run(_send_concurrently(base_url, chat["id"], users)) + elapsed = time.perf_counter() - started + + items, pages = read_all_messages(api, users[-1], chat["id"], PAGE_LIMIT) + expected_texts = { + f"{user['username']}#{n}" for user in users for n in range(MESSAGES_PER_CLIENT) + } + summary = { + "clients": CLIENTS, + "messages_sent": len(statuses), + "status_201": statuses.count(201), + "messages_read": len(items), + "unique_ids": len({item["id"] for item in items}), + "unique_texts": len({item["text"] for item in items}), + "pages_read": pages, + "send_seconds": round(elapsed, 3), + } + print("\nCONCURRENCY RESULT:", json.dumps(summary, ensure_ascii=False)) + + assert statuses == [201] * TOTAL_MESSAGES + assert len(items) == TOTAL_MESSAGES + assert summary["unique_ids"] == TOTAL_MESSAGES + assert {item["text"] for item in items} == expected_texts + keys = [(item["created_at"], item["id"]) for item in items] + assert keys == sorted(keys) + assert len(set(keys)) == TOTAL_MESSAGES diff --git a/student-tests/test_dependency_failures.py b/student-tests/test_dependency_failures.py new file mode 100644 index 00000000..f935ae3d --- /dev/null +++ b/student-tests/test_dependency_failures.py @@ -0,0 +1,129 @@ +""" +Отказы зависимостей: Valkey и PostgreSQL останавливаются через docker compose. + +Тесты меняют состояние стенда (stop/start контейнеров, volumes сохраняются), +поэтому запускаются только явно: make test-failures (RUN_FAILURE_TESTS=1). +""" + +import os +import time +from collections.abc import Iterator + +import httpx +import pytest +from helpers import assert_error, assert_unauthorized, auth, basic, compose + +pytestmark = pytest.mark.skipif( + os.environ.get("RUN_FAILURE_TESTS") != "1", + reason="останавливает контейнеры стенда: запускайте через make test-failures", +) + +READY_TIMEOUT_SEC = 60 +# Ответ при упавшей зависимости должен быть быстрым, а не висеть до таймаута клиента +BOUNDED_RESPONSE_SEC = 3 + + +def wait_ready(api: httpx.Client) -> None: + deadline = time.monotonic() + READY_TIMEOUT_SEC + while time.monotonic() < deadline: + try: + if api.get("/health/ready").status_code == 200: + return + except httpx.TransportError: + pass + time.sleep(0.5) + raise AssertionError("API не стал готов после восстановления зависимости") + + +@pytest.fixture +def valkey_stopped(api: httpx.Client) -> Iterator[None]: + compose("stop", "valkey") + try: + yield + finally: + compose("start", "valkey") + compose("up", "-d", "--wait", "valkey") + wait_ready(api) + + +@pytest.fixture +def postgres_stopped(api: httpx.Client) -> Iterator[None]: + compose("stop", "postgres") + try: + yield + finally: + compose("start", "postgres") + compose("up", "-d", "--wait", "postgres") + wait_ready(api) + + +def test_valkey_down_cache_is_bypassed( + api: httpx.Client, make_user, make_chat, send_message, valkey_stopped +) -> None: + """Без Valkey всё работает через PostgreSQL: вход, Bearer, запись, logout""" + alice = make_user("alice") + started = time.monotonic() + me = api.get("/api/v1/users/me", headers=auth(alice)) + assert me.status_code == 200, me.text + assert time.monotonic() - started < BOUNDED_RESPONSE_SEC + + chat = make_chat(alice, [alice]) + send_message(alice, chat, "без кэша") + assert api.get("/health/ready").status_code == 200 + + assert ( + api.delete("/api/v1/auth/sessions/current", headers=auth(alice)).status_code + == 204 + ) + assert_unauthorized(api.get("/api/v1/users/me", headers=auth(alice))) + assert_unauthorized(api.get("/api/v1/users/me")) + + +def test_logout_during_valkey_outage_is_not_resurrected( + api: httpx.Client, make_user +) -> None: + """ + Сессия попала в кэш, затем Valkey упал и пользователь вышел. После подъёма + Valkey (без persistence — пустой) отозванный токен не принимается. + """ + alice = make_user("alice") + assert api.get("/api/v1/users/me", headers=auth(alice)).status_code == 200 + compose("stop", "valkey") + try: + response = api.delete("/api/v1/auth/sessions/current", headers=auth(alice)) + assert response.status_code == 204 + finally: + compose("start", "valkey") + compose("up", "-d", "--wait", "valkey") + wait_ready(api) + assert_unauthorized(api.get("/api/v1/users/me", headers=auth(alice))) + + +def test_postgres_down_returns_bounded_503_and_no_anonymous_access( + api: httpx.Client, make_user, postgres_stopped +) -> None: + alice_token_unused = {"token": "x" * 43} + + started = time.monotonic() + ready = api.get("/health/ready") + assert_error(ready, 503, "unavailable") + assert time.monotonic() - started < BOUNDED_RESPONSE_SEC + + # Анонимный запрос остаётся 401, неизвестный токен не принимается как доверенный + assert_unauthorized(api.get("/api/v1/users/me")) + unknown = api.get("/api/v1/users/me", headers=auth(alice_token_unused)) + assert_error(unknown, 503, "unavailable") + assert "asyncpg" not in unknown.text and "postgres" not in unknown.text.lower() + + body = {"username": "st_pg_down", "display_name": "x", "password": "P" * 12} + assert_error(api.post("/api/v1/users", json=body), 503, "unavailable") + login = api.post("/api/v1/auth/sessions", headers=basic("st_pg_down", "P" * 12)) + assert_error(login, 503, "unavailable") + + +def test_session_survives_postgres_restart(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + compose("restart", "postgres") + wait_ready(api) + chats = api.get("/api/v1/chats", headers=auth(alice)) + assert chats.status_code == 200, chats.text diff --git a/student-tests/test_expiry.py b/student-tests/test_expiry.py new file mode 100644 index 00000000..707426de --- /dev/null +++ b/student-tests/test_expiry.py @@ -0,0 +1,55 @@ +""" +Истечение сессии при коротком SESSION_TTL_SECONDS. + +Нужен отдельный API с SESSION_TTL_SECONDS=2: make test-expiry поднимает +api-short-ttl на :8081 поверх тех же PostgreSQL и Valkey. +""" + +import os +import time +from datetime import UTC, datetime + +import httpx +import pytest +from conftest import register_and_login +from helpers import assert_unauthorized, auth, basic + +EXPIRY_BASE_URL = os.environ.get("EXPIRY_BASE_URL") +SHORT_TTL_SEC = 2 + +pytestmark = pytest.mark.skipif( + not EXPIRY_BASE_URL, reason="EXPIRY_BASE_URL не задан: запустите make test-expiry" +) + + +@pytest.fixture +def short_api() -> httpx.Client: + assert EXPIRY_BASE_URL is not None + with httpx.Client(base_url=EXPIRY_BASE_URL, timeout=10) as client: + yield client + + +def test_session_expires_after_short_ttl(short_api: httpx.Client) -> None: + alice = register_and_login(short_api, "ttl") + me = short_api.get("/api/v1/users/me", headers=auth(alice)) + assert me.status_code == 200, me.text + + time.sleep(SHORT_TTL_SEC + 1) + + # Сессия уже лежала в кэше после первого запроса: истечь должна и там + assert_unauthorized(short_api.get("/api/v1/users/me", headers=auth(alice))) + assert_unauthorized(short_api.get("/api/v1/chats", headers=auth(alice))) + assert_unauthorized( + short_api.delete("/api/v1/auth/sessions/current", headers=auth(alice)) + ) + + +def test_expires_at_matches_short_ttl(short_api: httpx.Client) -> None: + before = datetime.now(UTC) + alice = register_and_login(short_api, "ttl") + session = short_api.post( + "/api/v1/auth/sessions", headers=basic(alice["username"], alice["password"]) + ).json() + expires_at = datetime.fromisoformat(session["expires_at"].replace("Z", "+00:00")) + lifetime = (expires_at - before).total_seconds() + assert 0 < lifetime <= SHORT_TTL_SEC + 1 diff --git a/student-tests/test_foreign_chat.py b/student-tests/test_foreign_chat.py new file mode 100644 index 00000000..658995fa --- /dev/null +++ b/student-tests/test_foreign_chat.py @@ -0,0 +1,51 @@ +"""Чужой чат: посторонний получает 404, существование чата не раскрывается""" + +import uuid + +import httpx +from helpers import assert_error, auth, message_headers + + +def test_outsider_cannot_access_chat( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + alice = make_user("alice") + bob = make_user("bob") + eve = make_user("eve") + chat = make_chat(alice, [alice, bob]) + send_message(alice, chat, "секрет") + path = f"/api/v1/chats/{chat['id']}" + + assert_error(api.get(path, headers=auth(eve)), 404, "not_found") + assert_error(api.get(f"{path}/messages", headers=auth(eve)), 404, "not_found") + response = api.post( + f"{path}/messages", json={"text": "чужое"}, headers=message_headers(eve) + ) + assert_error(response, 404, "not_found") + + history = api.get(f"{path}/messages", headers=auth(bob)).json() + assert [item["text"] for item in history["items"]] == ["секрет"] + + +def test_foreign_and_missing_chat_are_indistinguishable( + api: httpx.Client, make_user, make_chat +) -> None: + alice = make_user("alice") + eve = make_user("eve") + chat = make_chat(alice, [alice]) + foreign = api.get(f"/api/v1/chats/{chat['id']}", headers=auth(eve)).json() + missing = api.get(f"/api/v1/chats/{uuid.uuid4()}", headers=auth(eve)).json() + assert foreign["error"]["code"] == missing["error"]["code"] == "not_found" + assert foreign["error"]["message"] == missing["error"]["message"] + + +def test_chat_list_contains_only_own_chats( + api: httpx.Client, make_user, make_chat +) -> None: + alice = make_user("alice") + eve = make_user("eve") + chat = make_chat(alice, [alice]) + own = api.get("/api/v1/chats", headers=auth(eve)).json() + assert own == {"items": [], "next_cursor": None} + listed = api.get("/api/v1/chats", headers=auth(alice)).json() + assert [item["id"] for item in listed["items"]] == [chat["id"]] diff --git a/student-tests/test_health.py b/student-tests/test_health.py new file mode 100644 index 00000000..a8b1dbbe --- /dev/null +++ b/student-tests/test_health.py @@ -0,0 +1,15 @@ +import httpx +from helpers import assert_error + + +def test_health_endpoints_have_request_id(api: httpx.Client) -> None: + for path in ("/health/live", "/health/ready"): + response = api.get(path) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + assert response.headers["X-Request-Id"] + + +def test_unknown_route_uses_error_format(api: httpx.Client) -> None: + assert_error(api.get("/api/v1/unknown"), 404, "not_found") + diff --git a/student-tests/test_idempotency.py b/student-tests/test_idempotency.py new file mode 100644 index 00000000..3c9c3b22 --- /dev/null +++ b/student-tests/test_idempotency.py @@ -0,0 +1,249 @@ +"""Idempotency-Key отправки сообщения: повтор, конфликт, область ключа, гонки""" + +import asyncio +import json +import uuid +from collections import Counter + +import httpx +import pytest +from helpers import assert_error, auth, message_headers, psql, read_all_messages + +PARALLEL_REPLAYS = 20 + + +def post_message( + api: httpx.Client, user: dict, chat: dict, text: str, key: str +) -> httpx.Response: + return api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": text}, + headers=message_headers(user, key), + ) + + +def history(api: httpx.Client, user: dict, chat: dict) -> list[dict]: + items, _ = read_all_messages(api, user, chat["id"], 100) + return items + + +def test_replay_returns_same_message(api: httpx.Client, make_user, make_chat) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + + first = post_message(api, alice, chat, "один раз", key) + second = post_message(api, alice, chat, "один раз", key) + + assert first.status_code == second.status_code == 201, second.text + assert first.json() == second.json() + assert history(api, alice, chat) == [first.json()] + + +def test_replay_ignores_json_formatting( + api: httpx.Client, make_user, make_chat +) -> None: + """Пробелы и форма записи JSON не меняют смысл тела: это тот же запрос""" + alice = make_user("alice") + chat = make_chat(alice, [alice]) + headers = {**message_headers(alice), "Content-Type": "application/json"} + path = f"/api/v1/chats/{chat['id']}/messages" + + escaped = b'{"text":"\\u041f\\u0440\\u0438"}' + compact = api.post(path, content=escaped, headers=headers) + spaced = api.post(path, content='{ "text" : "При" }'.encode(), headers=headers) + + assert compact.status_code == spaced.status_code == 201, spaced.text + assert compact.json() == spaced.json() + assert len(history(api, alice, chat)) == 1 + + +def test_same_key_with_other_body_is_conflict( + api: httpx.Client, make_user, make_chat +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + original = post_message(api, alice, chat, "оригинал", key).json() + + assert_error(post_message(api, alice, chat, "другой", key), 409, "conflict") + assert history(api, alice, chat) == [original] + + +@pytest.mark.parametrize( + "headers", + [ + {}, + {"Idempotency-Key": ""}, + {"Idempotency-Key": "with space"}, + {"Idempotency-Key": "ключ".encode()}, + {"Idempotency-Key": "a/b"}, + {"Idempotency-Key": "x" * 129}, + ], +) +def test_missing_or_invalid_key_is_rejected( + api: httpx.Client, make_user, make_chat, headers: dict +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": "без ключа"}, + headers={**auth(alice), **headers}, + ) + assert_error(response, 400, "invalid_request") + assert history(api, alice, chat) == [] + + +@pytest.mark.parametrize("key", ["x" * 128, "Az09._:-"]) +def test_key_boundaries_are_accepted( + api: httpx.Client, make_user, make_chat, key: str +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + assert post_message(api, alice, chat, "граница", key).status_code == 201 + + +def test_key_scope_is_user_and_chat(api: httpx.Client, make_user, make_chat) -> None: + """Один ключ у разных пользователей и в разных чатах — независимые сообщения""" + alice = make_user("alice") + bob = make_user("bob") + chat = make_chat(alice, [alice, bob]) + other_chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + + from_alice = post_message(api, alice, chat, "текст", key).json() + from_bob = post_message(api, bob, chat, "текст", key).json() + in_other_chat = post_message(api, alice, other_chat, "текст", key).json() + + assert len({from_alice["id"], from_bob["id"], in_other_chat["id"]}) == 3 + assert from_bob["sender_id"] == bob["id"] + assert len(history(api, alice, chat)) == 2 + assert len(history(api, alice, other_chat)) == 1 + + +def test_replay_rechecks_session_and_access( + api: httpx.Client, make_user, make_chat +) -> None: + alice = make_user("alice") + eve = make_user("eve") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + post_message(api, alice, chat, "секрет", key) + + # Чужой с тем же ключом не получает сохранённое сообщение + assert_error(post_message(api, eve, chat, "секрет", key), 404, "not_found") + # Отозванная сессия не даёт повтора + logout = api.delete("/api/v1/auth/sessions/current", headers=auth(alice)) + assert logout.status_code == 204 + replay = post_message(api, alice, chat, "секрет", key) + assert_error(replay, 401, "unauthorized") + + +def test_expired_key_can_be_reused(api: httpx.Client, make_user, make_chat) -> None: + """После срока хранения (24 ч) ключ снова создаёт сообщение; срок сдвигается в БД""" + alice = make_user("alice") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + first = post_message(api, alice, chat, "вчера", key).json() + psql( + "UPDATE message_idempotency_keys " + "SET created_at = now() - interval '2 days', " + "expires_at = now() - interval '1 day' " + f"WHERE chat_id = '{chat['id']}' AND idempotency_key = '{key}';" + ) + + second = post_message(api, alice, chat, "сегодня", key) + + assert second.status_code == 201, second.text + assert second.json()["id"] != first["id"] + assert [item["text"] for item in history(api, alice, chat)] == ["вчера", "сегодня"] + stored = psql( + "SELECT count(*) FROM message_idempotency_keys " + f"WHERE chat_id = '{chat['id']}' AND idempotency_key = '{key}';" + ) + assert stored == "1" + + +async def _post_concurrently( + base_url: str, user: dict, chat: dict, key: str, texts: list[str] +) -> list[httpx.Response]: + """Все запросы стартуют по одному сигналу; отдельные соединения к LB""" + start = asyncio.Event() + limits = httpx.Limits(max_connections=len(texts)) + + async with httpx.AsyncClient( + base_url=base_url, timeout=30, limits=limits + ) as client: + + async def post(text: str) -> httpx.Response: + await start.wait() + return await client.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": text}, + headers=message_headers(user, key), + ) + + tasks = [asyncio.create_task(post(text)) for text in texts] + await asyncio.sleep(0) + start.set() + return list(await asyncio.gather(*tasks)) + + +def test_parallel_replays_through_replicas_create_one_message( + api: httpx.Client, base_url: str, make_user, make_chat +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + + responses = asyncio.run( + _post_concurrently( + base_url, alice, chat, key, ["одно сообщение"] * PARALLEL_REPLAYS + ) + ) + + statuses = Counter(response.status_code for response in responses) + instances = Counter(response.headers["X-Instance-Id"] for response in responses) + bodies = {json.dumps(response.json(), sort_keys=True) for response in responses} + items = history(api, alice, chat) + rows = psql(f"SELECT count(*) FROM messages WHERE chat_id = '{chat['id']}';") + print( + "\nPARALLEL SAME KEY:", + json.dumps( + { + "requests": len(responses), + "statuses": dict(statuses), + "instances": dict(instances), + "distinct_bodies": len(bodies), + "messages_in_history": len(items), + "rows_in_db": int(rows), + } + ), + ) + assert statuses == {201: PARALLEL_REPLAYS} + assert len(instances) >= 2, "запросы не распределились по репликам" + assert len(bodies) == 1 + assert len(items) == 1 and rows == "1" + + +def test_parallel_same_key_with_different_bodies( + api: httpx.Client, base_url: str, make_user, make_chat +) -> None: + """Победитель гонки один; совпавшие с ним тела — 201, остальные — 409""" + alice = make_user("alice") + chat = make_chat(alice, [alice]) + key = uuid.uuid4().hex + texts = ["вариант A", "вариант B"] * (PARALLEL_REPLAYS // 2) + + responses = asyncio.run(_post_concurrently(base_url, alice, chat, key, texts)) + + items = history(api, alice, chat) + assert len(items) == 1 + winner = items[0] + for text, response in zip(texts, responses): + if text == winner["text"]: + assert response.status_code == 201, response.text + assert response.json() == winner + else: + assert_error(response, 409, "conflict") diff --git a/student-tests/test_invalid_json.py b/student-tests/test_invalid_json.py new file mode 100644 index 00000000..65106047 --- /dev/null +++ b/student-tests/test_invalid_json.py @@ -0,0 +1,112 @@ +"""Неверный JSON и неверная структура тела — 400 invalid_request""" + +import httpx +import pytest +from helpers import assert_error, auth, message_headers + +PASSWORD = "Valid-password-123" + +MALFORMED_BODIES = [ + b'{"username": "abc",', + b"not json at all", + b'{"text": "\xff\xfe"}', + b"", +] + + +@pytest.mark.parametrize("raw", MALFORMED_BODIES) +def test_malformed_json_on_register(api: httpx.Client, raw: bytes) -> None: + response = api.post( + "/api/v1/users", content=raw, headers={"Content-Type": "application/json"} + ) + assert_error(response, 400, "invalid_request") + + +@pytest.mark.parametrize("raw", MALFORMED_BODIES) +def test_malformed_json_on_create_chat_and_message( + api: httpx.Client, make_user, make_chat, raw: bytes +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + headers = {**auth(alice), "Content-Type": "application/json"} + assert_error( + api.post("/api/v1/chats", content=raw, headers=headers), 400, "invalid_request" + ) + message_post_headers = { + **message_headers(alice), + "Content-Type": "application/json", + } + assert_error( + api.post( + f"/api/v1/chats/{chat['id']}/messages", + content=raw, + headers=message_post_headers, + ), + 400, + "invalid_request", + ) + + +@pytest.mark.parametrize( + "body", + [ + [], + "alice", + {"username": "valid_name", "password": PASSWORD}, + {"username": 123, "display_name": "x", "password": PASSWORD}, + {"username": "valid_name", "display_name": None, "password": PASSWORD}, + { + "username": "valid_name", + "display_name": "x", + "password": PASSWORD, + "is_admin": True, + }, + {"username": "Upper_Case", "display_name": "x", "password": PASSWORD}, + {"username": "ab", "display_name": "x", "password": PASSWORD}, + {"username": "valid_name", "display_name": " ", "password": PASSWORD}, + {"username": "valid_name", "display_name": "я" * 101, "password": PASSWORD}, + {"username": "valid_name", "display_name": "a\u0000b", "password": PASSWORD}, + ], +) +def test_invalid_user_payload(api: httpx.Client, body: object) -> None: + assert_error(api.post("/api/v1/users", json=body), 400, "invalid_request") + + +@pytest.mark.parametrize( + "body", + [ + {"text": 42}, + {"text": "привет", "sender_id": "11111111-1111-4111-8111-111111111111"}, + {}, + ], +) +def test_invalid_message_payload( + api: httpx.Client, make_user, make_chat, body: dict +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json=body, + headers=message_headers(alice), + ) + assert_error(response, 400, "invalid_request") + + +def test_invalid_chat_payload(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + bob = make_user("bob") + cases = [ + {"title": "t", "member_ids": [bob["id"]]}, + {"title": "t", "member_ids": [alice["id"], alice["id"]]}, + { + "title": "t", + "member_ids": [alice["id"], "11111111-1111-4111-8111-111111111111"], + }, + {"title": "t", "member_ids": [alice["id"], "not-a-uuid"]}, + {"title": "t", "member_ids": []}, + {"title": " ", "member_ids": [alice["id"]]}, + ] + for body in cases: + response = api.post("/api/v1/chats", json=body, headers=auth(alice)) + assert_error(response, 400, "invalid_request") diff --git a/student-tests/test_messages.py b/student-tests/test_messages.py new file mode 100644 index 00000000..786cb2f9 --- /dev/null +++ b/student-tests/test_messages.py @@ -0,0 +1,79 @@ +"""Пустые сообщения, границы длины и Unicode""" + +import httpx +import pytest +from helpers import assert_error, auth, message_headers + + +@pytest.mark.parametrize("text", ["", " ", " \n\t ", " "]) +def test_empty_or_blank_message_is_rejected( + api: httpx.Client, make_user, make_chat, text: str +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": text}, + headers=message_headers(alice), + ) + assert_error(response, 400, "invalid_request") + history = api.get(f"/api/v1/chats/{chat['id']}/messages", headers=auth(alice)) + assert history.json()["items"] == [] + + +def test_message_length_is_counted_in_code_points( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + longest = "😀" * 4000 + assert send_message(alice, chat, longest)["text"] == longest + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": "😀" * 4001}, + headers=message_headers(alice), + ) + assert_error(response, 400, "invalid_request") + + +def test_unicode_is_preserved( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + name = "Алиса 👩‍💻 é" + alice = make_user("alice", display_name=name) + assert alice["display_name"] == name + chat = make_chat(alice, [alice], title="Чат 🚀 中文") + assert chat["title"] == "Чат 🚀 中文" + text = "Привет, мир 👋 — «кавычки» \t\n и 𝔘𝔫𝔦𝔠𝔬𝔡𝔢" + message = send_message(alice, chat, text) + assert message["text"] == text + page = api.get(f"/api/v1/chats/{chat['id']}/messages", headers=auth(alice)).json() + assert page["items"][0]["text"] == text + + +def test_nul_character_is_rejected(api: httpx.Client, make_user, make_chat) -> None: + """PostgreSQL text не хранит U+0000: отказ 400 до записи, а не 500""" + alice = make_user("alice") + chat = make_chat(alice, [alice]) + response = api.post( + f"/api/v1/chats/{chat['id']}/messages", + json={"text": "до\u0000после"}, + headers=message_headers(alice), + ) + assert_error(response, 400, "invalid_request") + response = api.post( + "/api/v1/chats", + json={"title": "a\u0000b", "member_ids": [alice["id"]]}, + headers=auth(alice), + ) + assert_error(response, 400, "invalid_request") + + +def test_sender_is_taken_from_session(make_user, make_chat, send_message) -> None: + alice = make_user("alice") + bob = make_user("bob") + chat = make_chat(alice, [alice, bob]) + message = send_message(bob, chat, "от Боба") + assert message["sender_id"] == bob["id"] + assert message["chat_id"] == chat["id"] + assert message["created_at"].endswith("Z") diff --git a/student-tests/test_pagination.py b/student-tests/test_pagination.py new file mode 100644 index 00000000..25154348 --- /dev/null +++ b/student-tests/test_pagination.py @@ -0,0 +1,138 @@ +"""Обход нескольких страниц истории и списка чатов по cursor""" + +import httpx +import pytest +from helpers import assert_error, auth, read_all_messages + + +@pytest.mark.parametrize( + ("total", "limit", "expected_pages"), + [(7, 3, 3), (6, 3, 2), (5, 1, 5), (3, 100, 1)], +) +def test_walk_message_pages( + api: httpx.Client, + make_user, + make_chat, + send_message, + total: int, + limit: int, + expected_pages: int, +) -> None: + alice = make_user("alice") + bob = make_user("bob") + chat = make_chat(alice, [alice, bob]) + sent = [send_message(alice if n % 2 else bob, chat, f"m{n}") for n in range(total)] + + items, pages = read_all_messages(api, bob, chat["id"], limit) + + assert pages == expected_pages + assert items == sent + assert len({item["id"] for item in items}) == total + keys = [(item["created_at"], item["id"]) for item in items] + assert keys == sorted(keys) + + +def test_limit_can_change_between_pages( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + sent = [send_message(alice, chat, f"m{n}") for n in range(6)] + path = f"/api/v1/chats/{chat['id']}/messages" + + first = api.get(path, params={"limit": 2}, headers=auth(alice)).json() + second = api.get( + path, params={"limit": 4, "cursor": first["next_cursor"]}, headers=auth(alice) + ).json() + + assert first["items"] + second["items"] == sent + assert second["next_cursor"] is None + + +def test_new_message_appears_after_cursor( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + send_message(alice, chat, "m0") + send_message(alice, chat, "m1") + path = f"/api/v1/chats/{chat['id']}/messages" + first = api.get(path, params={"limit": 1}, headers=auth(alice)).json() + late = send_message(alice, chat, "m2") + rest = api.get( + path, params={"limit": 10, "cursor": first["next_cursor"]}, headers=auth(alice) + ).json() + assert [item["text"] for item in rest["items"]] == ["m1", "m2"] + assert rest["items"][-1] == late + + +def test_cursor_is_bound_to_chat( + api: httpx.Client, make_user, make_chat, send_message +) -> None: + alice = make_user("alice") + chat_a = make_chat(alice, [alice], title="A") + chat_b = make_chat(alice, [alice], title="B") + for n in range(3): + send_message(alice, chat_a, f"a{n}") + cursor = api.get( + f"/api/v1/chats/{chat_a['id']}/messages", + params={"limit": 1}, + headers=auth(alice), + ).json()["next_cursor"] + response = api.get( + f"/api/v1/chats/{chat_b['id']}/messages", + params={"cursor": cursor}, + headers=auth(alice), + ) + assert_error(response, 400, "invalid_request") + + +@pytest.mark.parametrize( + "params", + [ + {"limit": 0}, + {"limit": 101}, + {"limit": "abc"}, + {"cursor": ""}, + {"cursor": "not-a-cursor"}, + {"cursor": "eyJzY29wZSI6IDF9"}, + ], +) +def test_invalid_limit_or_cursor( + api: httpx.Client, make_user, make_chat, params: dict +) -> None: + alice = make_user("alice") + chat = make_chat(alice, [alice]) + response = api.get( + f"/api/v1/chats/{chat['id']}/messages", params=params, headers=auth(alice) + ) + assert_error(response, 400, "invalid_request") + + +def test_walk_chat_list_pages(api: httpx.Client, make_user, make_chat) -> None: + alice = make_user("alice") + created = [make_chat(alice, [alice], title=f"chat {n}") for n in range(5)] + listed: list[dict] = [] + params: dict[str, str | int] = {"limit": 2} + pages = 0 + while True: + page = api.get("/api/v1/chats", params=params, headers=auth(alice)).json() + listed.extend(page["items"]) + pages += 1 + if page["next_cursor"] is None: + break + params = {"limit": 2, "cursor": page["next_cursor"]} + assert pages == 3 + assert listed == created + + +def test_chat_cursor_is_bound_to_user(api: httpx.Client, make_user, make_chat) -> None: + alice = make_user("alice") + bob = make_user("bob") + for n in range(2): + make_chat(alice, [alice, bob], title=f"chat {n}") + cursor = api.get("/api/v1/chats", params={"limit": 1}, headers=auth(alice)).json()[ + "next_cursor" + ] + response = api.get("/api/v1/chats", params={"cursor": cursor}, headers=auth(bob)) + assert_error(response, 400, "invalid_request") diff --git a/student-tests/test_transactions.py b/student-tests/test_transactions.py new file mode 100644 index 00000000..86085d4e --- /dev/null +++ b/student-tests/test_transactions.py @@ -0,0 +1,95 @@ +"""Гонка регистрации одинакового username и rollback создания чата""" + +import asyncio +import json +import uuid + +import httpx +from helpers import assert_error, auth, psql, unique_password, unique_username + +PARALLEL_REGISTRATIONS = 20 + + +async def _register_concurrently(base_url: str, username: str) -> list[int]: + """Все запросы стартуют по одному сигналу, у каждого свой пароль""" + start = asyncio.Event() + + async def register(client: httpx.AsyncClient) -> int: + await start.wait() + body = { + "username": username, + "display_name": "Гонка", + "password": unique_password(), + } + response = await client.post("/api/v1/users", json=body) + return response.status_code + + limits = httpx.Limits(max_connections=PARALLEL_REGISTRATIONS) + async with httpx.AsyncClient( + base_url=base_url, timeout=30, limits=limits + ) as client: + tasks = [ + asyncio.create_task(register(client)) for _ in range(PARALLEL_REGISTRATIONS) + ] + await asyncio.sleep(0) + start.set() + return list(await asyncio.gather(*tasks)) + + +def test_same_username_race_creates_exactly_one_user(base_url: str) -> None: + username = unique_username("race") + statuses = asyncio.run(_register_concurrently(base_url, username)) + stored = psql(f"SELECT count(*) FROM users WHERE username = '{username}';") + print( + "\nREGISTRATION RACE:", + json.dumps( + { + "requests": len(statuses), + "status_201": statuses.count(201), + "status_409": statuses.count(409), + "rows_in_db": int(stored), + } + ), + ) + assert statuses.count(201) == 1 + assert statuses.count(409) == PARALLEL_REGISTRATIONS - 1 + assert stored == "1" + + +def test_failed_chat_creation_is_rolled_back(api: httpx.Client, make_user) -> None: + """ + Строка chats вставляется первой, затем участники нарушают FK (неизвестный + пользователь в конце списка). После 400 в БД не должно остаться ни чата + с этим title, ни его участников: откатилась вся транзакция. + """ + alice = make_user("alice") + bob = make_user("bob") + title = f"rollback-{uuid.uuid4().hex}" + body = {"title": title, "member_ids": [alice["id"], bob["id"], str(uuid.uuid4())]} + + response = api.post("/api/v1/chats", json=body, headers=auth(alice)) + + assert_error(response, 400, "invalid_request") + assert psql(f"SELECT count(*) FROM chats WHERE title = '{title}';") == "0" + orphan_members = psql( + "SELECT count(*) FROM chat_members m " + "LEFT JOIN chats c ON c.id = m.chat_id WHERE c.id IS NULL;" + ) + assert orphan_members == "0" + listed = api.get("/api/v1/chats", params={"limit": 100}, headers=auth(alice)) + assert all(chat["title"] != title for chat in listed.json()["items"]) + + +def test_successful_chat_creation_commits_all_members( + api: httpx.Client, make_user +) -> None: + alice = make_user("alice") + bob = make_user("bob") + title = f"commit-{uuid.uuid4().hex}" + body = {"title": title, "member_ids": [bob["id"], alice["id"]]} + chat = api.post("/api/v1/chats", json=body, headers=auth(alice)).json() + assert chat["member_ids"] == [bob["id"], alice["id"]] + members = psql(f"SELECT count(*) FROM chat_members WHERE chat_id = '{chat['id']}';") + assert members == "2" + again = api.get(f"/api/v1/chats/{chat['id']}", headers=auth(bob)).json() + assert again == chat diff --git a/student-tests/test_users.py b/student-tests/test_users.py new file mode 100644 index 00000000..e452885e --- /dev/null +++ b/student-tests/test_users.py @@ -0,0 +1,95 @@ +"""Регистрация, дубликат username и идентификация только через Bearer""" + +import uuid + +import httpx +import pytest +from helpers import ( + assert_error, + assert_unauthorized, + auth, + public_user, + unique_password, + unique_username, +) + + +def test_duplicate_username_is_conflict(api: httpx.Client, make_user) -> None: + alice = make_user("dup") + body = { + "username": alice["username"], + "display_name": "B", + "password": unique_password(), + } + assert_error(api.post("/api/v1/users", json=body), 409, "conflict") + me = api.get("/api/v1/users/me", headers=auth(alice)) + assert me.json()["display_name"] == alice["display_name"] + + +def test_registration_never_returns_password(api: httpx.Client) -> None: + password = unique_password() + body = { + "username": unique_username("pw"), + "display_name": "x", + "password": password, + } + response = api.post("/api/v1/users", json=body) + assert response.status_code == 201 + assert set(response.json()) == {"id", "username", "display_name", "created_at"} + assert password not in response.text + + +@pytest.mark.parametrize( + "password", + [None, "", "короткий", "x" * 11, "x" * 129, 123456789012], +) +def test_invalid_password_is_rejected(api: httpx.Client, password: object) -> None: + body: dict[str, object] = {"username": unique_username("pw"), "display_name": "x"} + if password is not None: + body["password"] = password + assert_error(api.post("/api/v1/users", json=body), 400, "invalid_request") + + +def test_password_length_is_counted_in_code_points(api: httpx.Client) -> None: + for password in ("😀" * 12, "😀" * 128): + body = { + "username": unique_username("pw"), + "display_name": "x", + "password": password, + } + assert api.post("/api/v1/users", json=body).status_code == 201 + + +@pytest.mark.parametrize( + "headers", + [ + {}, + {"Authorization": ""}, + {"Authorization": "Bearer"}, + {"Authorization": "Bearer not-a-real-token"}, + {"Authorization": "Bearer " + "x" * 5000}, + {"Authorization": "Token abc"}, + ], +) +def test_missing_or_unknown_token_is_unauthorized( + api: httpx.Client, headers: dict +) -> None: + assert_unauthorized(api.get("/api/v1/users/me", headers=headers)) + assert_unauthorized(api.get("/api/v1/chats", headers=headers)) + + +def test_x_user_id_gives_no_access(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + eve = make_user("eve") + assert_unauthorized(api.get("/api/v1/users/me", headers={"X-User-Id": alice["id"]})) + me = api.get("/api/v1/users/me", headers={**auth(alice), "X-User-Id": eve["id"]}) + assert me.json()["id"] == alice["id"] + unknown = {"X-User-Id": str(uuid.uuid4())} + assert_unauthorized(api.get("/api/v1/chats", headers=unknown)) + + +def test_current_user(api: httpx.Client, make_user) -> None: + alice = make_user("alice") + me = api.get("/api/v1/users/me", headers=auth(alice)) + assert me.status_code == 200 + assert me.json() == public_user(alice) diff --git a/tests/client.py b/tests/client.py index f0499a29..24ff0cba 100644 --- a/tests/client.py +++ b/tests/client.py @@ -14,7 +14,7 @@ import uuid ROOT = Path(__file__).resolve().parents[1] LAB = json.loads((ROOT / 'lab.json').read_text())['number'] -SPEC = json.loads((ROOT / 'contracts/openapi.json').read_text()) +SPEC = json.loads((ROOT / 'contracts/openapi.json').read_text(encoding="utf-8")) class Failure(AssertionError): pass