swiftpy-framework 0.2.2__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/.env.example +8 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/.github/workflows/ci.yml +0 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/CHANGELOG.md +41 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/PKG-INFO +23 -12
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/README.md +22 -11
- swiftpy_framework-0.3.1/app/ai/agents/assistant_agent.py +43 -0
- swiftpy_framework-0.3.1/app/ai/pipelines/.gitkeep +1 -0
- swiftpy_framework-0.3.1/app/ai/providers/.gitkeep +1 -0
- swiftpy_framework-0.3.1/app/ai/tools/system_status_tool.py +33 -0
- swiftpy_framework-0.3.1/app/ai/vectorstores/.gitkeep +1 -0
- swiftpy_framework-0.3.1/app/http/controllers/user_controller.py +23 -0
- swiftpy_framework-0.3.1/app/http/middleware/admin_middleware.py +67 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/http/middleware/auth_middleware.py +4 -0
- swiftpy_framework-0.3.1/app/http/resources/user_resource.py +32 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/models/user.py +2 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/schemas/user_schema.py +10 -1
- swiftpy_framework-0.3.1/app/services/user_service.py +44 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/ai.py +5 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/auth.py +11 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/database/migrations/2026_01_01_000000_create_users_table.py +1 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-14-installation-quick-start.md +21 -9
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-ai-subsystem.md +36 -20
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-authentication-and-security.md +95 -3
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-filesystem-storage-and-mail.md +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +10 -5
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-orm-models-and-relationships.md +24 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-websockets-and-admin.md +3 -111
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-19-application-schemas.md +2 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-19-cli-and-testing.md +3 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-19-database-schema-and-blueprint.md +1 -0
- swiftpy_framework-0.3.1/documentations/2026-11-21-application-architecture-and-project-structure.md +397 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-21-cors.md +2 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/main.py +2 -6
- swiftpy_framework-0.3.1/prompts/classify.py +17 -0
- swiftpy_framework-0.3.1/prompts/summarise.py +17 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/pyproject.toml +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/routes/api.py +2 -11
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/__init__.py +26 -12
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/__init__.py +4 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/client.py +57 -8
- swiftpy_framework-0.3.1/swiftpy/ai/prompts/__init__.py +6 -0
- swiftpy_framework-0.3.1/swiftpy/ai/prompts/loader.py +617 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/__init__.py +24 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/api_key_guard.py +6 -0
- swiftpy_framework-0.3.1/swiftpy/auth/auth_manager.py +1741 -0
- swiftpy_framework-0.3.1/swiftpy/auth/events.py +90 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/exceptions.py +2 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/jwt_guard.py +12 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/jwt_issuer.py +106 -2
- swiftpy_framework-0.3.1/swiftpy/auth/throttle.py +340 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth/token_blacklist.py +21 -6
- swiftpy_framework-0.3.1/swiftpy/auth/user_context.py +796 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/auth_manager.py +4 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/make.py +256 -27
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/new.py +305 -220
- swiftpy_framework-0.3.1/swiftpy/console/stubs/agent.stub +40 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/controller.stub +3 -1
- swiftpy_framework-0.3.1/swiftpy/console/stubs/prompt.stub +14 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/repository.stub +0 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/resource.stub +7 -4
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/schema.stub +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/service.stub +1 -3
- swiftpy_framework-0.3.1/swiftpy/console/stubs/tool.stub +35 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/application.py +379 -25
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/exceptions.py +2 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/blueprint.py +4 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/orm/model.py +358 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/http/exceptions.py +22 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/http/request.py +38 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/http/router.py +755 -117
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_observability.py +11 -51
- swiftpy_framework-0.3.1/tests/ai/test_prompts.py +413 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_prompts_security.py +56 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/app/test_application_providers.py +13 -5
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/app/test_starter_auth.py +78 -1
- swiftpy_framework-0.3.1/tests/auth/test_auth_attempt.py +863 -0
- swiftpy_framework-0.3.1/tests/auth/test_auth_throttle.py +389 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_refresh_and_logout.py +269 -25
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_new_command.py +114 -59
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_phase9_cli_remediation.py +1 -13
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_stubs_and_make.py +66 -4
- swiftpy_framework-0.3.1/tests/http/test_controller_routing.py +416 -0
- swiftpy_framework-0.3.1/tests/logging/__init__.py +1 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/migrations/test_migrations.py +2 -0
- swiftpy_framework-0.3.1/tests/orm/test_where_has.py +368 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/uv.lock +1 -1
- swiftpy_framework-0.2.2/app/http/middleware/admin_middleware.py +0 -45
- swiftpy_framework-0.2.2/app/services/user_service.py +0 -27
- swiftpy_framework-0.2.2/swiftpy/admin/__init__.py +0 -50
- swiftpy_framework-0.2.2/swiftpy/admin/auth.py +0 -538
- swiftpy_framework-0.2.2/swiftpy/admin/registry.py +0 -567
- swiftpy_framework-0.2.2/swiftpy/admin/views.py +0 -1583
- swiftpy_framework-0.2.2/swiftpy/ai/prompts/__init__.py +0 -6
- swiftpy_framework-0.2.2/swiftpy/ai/prompts/loader.py +0 -343
- swiftpy_framework-0.2.2/swiftpy/auth/auth_manager.py +0 -821
- swiftpy_framework-0.2.2/swiftpy/auth/user_context.py +0 -348
- swiftpy_framework-0.2.2/tests/admin/test_admin.py +0 -899
- swiftpy_framework-0.2.2/tests/ai/test_prompts.py +0 -147
- swiftpy_framework-0.2.2/tests/websockets/__init__.py +0 -0
- swiftpy_framework-0.2.2/views/admin/dashboard.html +0 -102
- swiftpy_framework-0.2.2/views/admin/login.html +0 -87
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/.dockerignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/.gitignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/Dockerfile +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/LICENSE +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/__init__.py +0 -0
- /swiftpy_framework-0.2.2/tests/logging/__init__.py → /swiftpy_framework-0.3.1/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/app.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/cors.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/database.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/filesystems.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/logging.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/mail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/config/queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/docker-compose.yml +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-cache-events-and-queues.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-database-query-builder-and-migrations.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-15-validation-and-form-requests.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/documentations/2026-11-20-request-and-responses.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/red-black.png +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/routes/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/schema.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/form_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/validation/validator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/__init__.py +0 -0
- {swiftpy_framework-0.2.2/tests/admin → swiftpy_framework-0.3.1/tests/ai}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.2.2/tests/ai → swiftpy_framework-0.3.1/tests/app}/__init__.py +0 -0
- {swiftpy_framework-0.2.2/tests/app → swiftpy_framework-0.3.1/tests/auth}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_auth_proxy.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.2.2/tests/auth → swiftpy_framework-0.3.1/tests/cache}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.2.2/tests/cache → swiftpy_framework-0.3.1/tests/concurrency}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/conftest.py +0 -0
- {swiftpy_framework-0.2.2/tests/concurrency → swiftpy_framework-0.3.1/tests/console}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.2.2/tests/console → swiftpy_framework-0.3.1/tests/core}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_helpers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.2.2/tests/core → swiftpy_framework-0.3.1/tests/database}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.2.2/tests/database → swiftpy_framework-0.3.1/tests/db}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.2.2/tests/db → swiftpy_framework-0.3.1/tests/docs}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.2.2/tests/docs → swiftpy_framework-0.3.1/tests/e2e}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.2.2/tests/e2e → swiftpy_framework-0.3.1/tests/events}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.2.2/tests/events → swiftpy_framework-0.3.1/tests/filesystem}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.2.2/tests/filesystem → swiftpy_framework-0.3.1/tests/http}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.2.2/tests/http → swiftpy_framework-0.3.1/tests/integration}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.2.2/tests/integration → swiftpy_framework-0.3.1/tests/mail}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.2.2/tests/mail → swiftpy_framework-0.3.1/tests/migrations}/__init__.py +0 -0
- {swiftpy_framework-0.2.2/tests/migrations → swiftpy_framework-0.3.1/tests/orm}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.2.2/tests/orm → swiftpy_framework-0.3.1/tests/queue}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.2.2/tests/queue → swiftpy_framework-0.3.1/tests/security}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.2.2/tests/security → swiftpy_framework-0.3.1/tests/stress}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.2.2/tests/stress → swiftpy_framework-0.3.1/tests/support}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.2.2/tests/support → swiftpy_framework-0.3.1/tests/testing}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.2.2/tests/testing → swiftpy_framework-0.3.1/tests/typing}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/typing/test_orm_typing.py +0 -0
- {swiftpy_framework-0.2.2/tests/typing → swiftpy_framework-0.3.1/tests/validation}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_validation_ergonomics.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.2.2/tests/validation → swiftpy_framework-0.3.1/tests/websockets}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.1}/views/mail/template.html +0 -0
|
@@ -85,6 +85,12 @@ JWT_ALGORITHM=HS256
|
|
|
85
85
|
JWT_ACCESS_TTL=3600
|
|
86
86
|
JWT_REFRESH_TTL=604800
|
|
87
87
|
AUTH_KEY_PEPPER=
|
|
88
|
+
AUTH_REMEMBER_COOKIE=swiftpy_remember
|
|
89
|
+
AUTH_REMEMBER_TTL=2592000
|
|
90
|
+
AUTH_THROTTLE_ENABLED=true
|
|
91
|
+
AUTH_THROTTLE_MAX_ATTEMPTS=5
|
|
92
|
+
AUTH_THROTTLE_DECAY_SECONDS=60
|
|
93
|
+
AUTH_THROTTLE_LOCKOUT_SECONDS=60
|
|
88
94
|
|
|
89
95
|
# CORS (use explicit comma-separated origins; never pair '*' with CORS_ALLOW_CREDENTIALS=true)
|
|
90
96
|
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
|
|
@@ -98,6 +104,8 @@ LOG_LEVEL=info
|
|
|
98
104
|
# AI Subsystem
|
|
99
105
|
AI_ENABLED=true
|
|
100
106
|
AI_DEFAULT_PROVIDER=openai
|
|
107
|
+
AI_PROMPTS_PATH=prompts
|
|
108
|
+
AI_PROMPTS_CACHE=false
|
|
101
109
|
OPENAI_API_KEY=
|
|
102
110
|
OPENAI_MODEL=gpt-4o
|
|
103
111
|
ANTHROPIC_API_KEY=
|
|
@@ -102,7 +102,6 @@ jobs:
|
|
|
102
102
|
cd /tmp && /tmp/swiftpy-wheel-smoke/bin/python -c '
|
|
103
103
|
import asyncio
|
|
104
104
|
import swiftpy
|
|
105
|
-
import swiftpy.admin
|
|
106
105
|
import swiftpy.testing
|
|
107
106
|
from swiftpy import Application, Request, json_response
|
|
108
107
|
from swiftpy.ai.client import AI, AIClient
|
|
@@ -4,6 +4,47 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.3.1] - 2026-11-22
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Credential Authentication Facade (`swiftpy.auth.auth_manager.Auth` & `AuthProxy`):**
|
|
11
|
+
- Added `Auth.attempt(credentials, remember=False)` verifying non-password column conditions against the resolved `User` model (`auth.model` / `app.models.user.User`) with non-blocking `Hash.check_async()` (and constant-time dummy bcrypt execution when no user matches), automatically coercing `1`/`0` integers to Python `bool` for PostgreSQL `BOOLEAN` fields (e.g., `{"email": email, "password": password, "active": 1}`), issuing JWT pairs when configured, and binding task-scoped `Context` / `CurrentUser`.
|
|
12
|
+
- Added `Callback` wrapper supporting closure conditions inside credentials dictionaries (`Callback(lambda q: q.has("activeSubscription"))` as key or callable value) and post-lookup inspection via `Auth.attempt_when(credentials, callback, remember=False)` / `attemptWhen(...)` for sync or async predicates.
|
|
13
|
+
- Added persistent "Remember Me" cookie sessions (`remember=True` on `attempt`, `attempt_when`, `login`, `login_using_id`): `Blueprint.remember_token()` (`VARCHAR(100) NULL`), `User.remember_token: str | None = None` (`__hidden__` & `SENSITIVE_USER_KEYS`), HMAC-SHA256 signed `HttpOnly` `swiftpy_remember` cookies queued onto HTTP responses via `Application`, `require_jwt()` / passive cookie authentication, `Auth.via_remember()` / `viaRemember()`, and DB/cookie invalidation in `AuthProxy.logout()` / `logout_all()`.
|
|
14
|
+
- Added `Auth.login(user, remember=False)`, `Auth.login_using_id(user_id, remember=False)` (plus `loginUsingId` and `login_sing_id` aliases), `Auth.once(credentials)`, and `Auth.once_using_id(user_id)` / `onceUsingId` (authenticating current task `Context` only with no cookies, no `remember_token` mutation, and no `Login` event).
|
|
15
|
+
- Added `Request.cookies` and `Request.cookie(name, default=None)` in `swiftpy.http.request`.
|
|
16
|
+
- **Auth Lifecycle Events (`swiftpy.auth.events`):** Added `Attempting`, `Authenticated`, `Login`, `Failed`, `Logout`, and `Lockout` dataclasses dispatched as both typed event classes and `"auth.<name>"` dotted aliases (with sensitive credential fields stripped from event payloads).
|
|
17
|
+
- **Default Login Throttling (`swiftpy.auth.throttle.LoginThrottle`, `TooManyRequestsError`):** Added HTTP `429 TooManyRequestsError` (with `Retry-After` header) in `swiftpy.http.exceptions` / `swiftpy.core.exceptions` / `swiftpy.auth.exceptions` and enabled cache-backed `LoginThrottle` (`max_attempts=5`, `decay_seconds=60`, `lockout_seconds=60`) by default in `Auth.attempt()` and `Auth.attempt_when()`, with `Auth.too_many_attempts()`, `Auth.available_in()`, `Auth.clear_throttle()`, `config/auth.py` (`remember`, `throttle`), `.env.example`, and `swiftpy new` scaffolding updates.
|
|
18
|
+
- **ORM Relationship Existence Queries (`swiftpy.database.orm.model`):** Added `has()`, `or_has()`, `doesnt_have()`, `or_doesnt_have()`, `where_has()`, `or_where_has()`, `where_doesnt_have()`, and `or_where_doesnt_have()` on `ModelQueryBuilder` and `Model` supporting `HasOne`, `HasMany`, `BelongsTo`, `BelongsToMany`, `camelCase`/`snake_case` relation lookup, dot-nested relation chains, count operators, and NULL-safe PostgreSQL `NOT IN` compilation.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **Packaging & Scaffolding:** Bumped `swiftpy-framework` to `0.3.1`, refreshed `uv.lock`, updated `create_users_table` migration and `app/models/user.py`, and updated `swiftpy new` templates to emit `"swiftpy-framework>=0.3.1"`, `table.remember_token()`, `User.remember_token`, and default `remember` / `throttle` config sections.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **`JWTIssuer` Class-Level Facade Calls (`swiftpy.auth.jwt_issuer.JWTIssuer`):** Fixed a `v0.3.0` regression where calling `await JWTIssuer.refresh_token_pair(...)` (or `issue_token`, `issue_access_token`, `issue_refresh_token`, `issue_token_pair`, `decode_token`) directly on the `JWTIssuer` class raised `TypeError: missing 1 required positional argument: 'self'`. Direct class calls now resolve the active container's `JWTIssuer` singleton (or construct one from `Config` without global state) while preserving bound instance calls (`issuer.refresh_token_pair(...)`).
|
|
25
|
+
|
|
26
|
+
### Documentation
|
|
27
|
+
- Updated Authentication & Security, Active Record ORM & Relationships, Database Schema & `Blueprint`, Installation Quick Start, and `README.md` for `v0.3.1`.
|
|
28
|
+
|
|
29
|
+
## [0.3.0] - 2026-11-22
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- **Routing & Controller DI Ergonomics (`swiftpy.http.router`, `swiftpy.core.application`):** Added dual decorator + direct handler binding across `Router`, `RouteGroup`, and `Application` (`router.get("/posts", PostController.index)`, `@router.get("/posts")`, `app.get("/posts", PostController.index)`), plus automatic per-request container resolution for unbound controller methods (`controller_cls` resolved once cleanly at compile/dispatch and instantiated isolated per request). Rejects passing raw controller classes directly with `RouteRegistrationError`.
|
|
33
|
+
- **Prompt Versioning & `messages` Templates (`swiftpy.ai.prompts`, `swiftpy.ai.client`):** Added `Prompt` facade (`Prompt.load("summarise.v2", ...)`, `await Prompt.aload(...)`, `Prompt.load_messages(...)`, `Prompt.aload_messages(...)`), module-level `messages` list support (`.py` sequences or zero-arg callables of role/content dicts or `Message` objects), `ai.prompts.path` config resolution, multi-message appending in `AIClient.prompt()` / `AIClient.aprompt()`, compiled cache round-tripping for `messages` lists and dotted versioned names, and exports via `swiftpy.ai.prompts`, `swiftpy.ai`, and top-level `swiftpy`.
|
|
34
|
+
- **CLI AI Generators (`make:agent`, `make:tool`, `make:prompt`):** Added `agent.stub`, `tool.stub`, `prompt.stub` and `swiftpy make:agent`, `swiftpy make:tool`, and `swiftpy make:prompt` (supporting nested folders and versioned `.v2` filenames such as `summarise.v2` with strict path-traversal and extension guards).
|
|
35
|
+
- **Starter Scaffolding Alignment (`swiftpy new`):** Scaffolded `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` (`AssistantAgent` and `SystemStatusTool`), `prompts/{summarise.py,classify.py}`, `UserController` + `UserResource` + `UserResponseSchema` -> `routes/api.py` (`router.get("/users", UserController.index)`), and `config/ai.py` (`prompts.path`, `prompts.cache`, `http`).
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- **Stubs & Resource Invariance (`swiftpy/console/stubs/`):** Refined `controller.stub`, `service.stub`, `repository.stub`, `schema.stub`, and `resource.stub` (typing `collection(cls, items: Iterable[Any])` for `mypy --strict` variance compatibility and removing unused imports).
|
|
39
|
+
- **Packaging:** Bumped `swiftpy-framework` package version and `swiftpy new` dependency floor to `0.3.0`.
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
- **Admin Dashboard (`swiftpy.admin`, `views/admin/`):** Completely removed the built-in HTML Admin Dashboard package (`swiftpy/admin/`), admin HTML templates (`views/admin/`), `AdminSite`/`ModelAdmin`/`AdminSessionStore` exports and scaffolding references, while preserving `app/http/middleware/admin_middleware.py` (`is_admin` API guard) and `views/mail/template.html`.
|
|
43
|
+
|
|
44
|
+
### Documentation
|
|
45
|
+
- Added [`documentations/2026-11-21-application-architecture-and-project-structure.md`](documentations/2026-11-21-application-architecture-and-project-structure.md) covering the full layered `app/` architecture, `Request` vs. `Schema` vs. `Resource` vs. `Model`, Patterns A–D + feature grouping, `app/ai/` and `prompts/`, decision table, Golden Rule, and verified CRUD walkthrough.
|
|
46
|
+
- Updated Installation Quick Start, HTTP Routing, Application Schemas, AI Subsystem, CLI & Testing, Authentication, Filesystem/Mail, CORS, WebSockets, `README.md`, and `docs/2026-11-14_documentation_plan.md` for `v0.3.0`.
|
|
47
|
+
|
|
7
48
|
## [0.2.2] - 2026-11-21
|
|
8
49
|
|
|
9
50
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/obrainwave/swiftpy
|
|
6
6
|
Project-URL: Repository, https://github.com/obrainwave/swiftpy
|
|
@@ -55,9 +55,9 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
55
55
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
56
56
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
57
57
|
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
58
|
-
- **Authentication,
|
|
58
|
+
- **Authentication, Credentials, Remember Me & Throttling**: `Auth.attempt()`, `Auth.attempt_when()` / `Callback` query & model closures, HMAC-signed `HttpOnly` remember-me cookies (`remember_token`, `via_remember()`), `login_using_id()`, single-request `once()`, default cache-backed `LoginThrottle` (HTTP `429 TooManyRequestsError` + `Retry-After`), `JWTIssuer` refresh rotation, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, and `ApiKeyGuard`.
|
|
59
59
|
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
60
|
-
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops
|
|
60
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
61
61
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
62
62
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
63
63
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -91,8 +91,10 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
91
91
|
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
92
92
|
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
93
93
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
94
|
+
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
95
|
+
| **Release v0.3.1: Auth Ergonomics, ORM `has()` & Login Throttling** | `Auth.attempt()`, `Callback` conditions + ORM `has()`/`where_has()`, `attempt_when()`, Remember Me cookies (`Blueprint.remember_token()`, `via_remember()`), `login_using_id()`, `once()`, default `LoginThrottle` (`429 TooManyRequestsError`), `Request.cookies` | ✅ Completed |
|
|
94
96
|
|
|
95
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete
|
|
97
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) and [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
96
98
|
|
|
97
99
|
---
|
|
98
100
|
|
|
@@ -523,6 +525,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
523
525
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
524
526
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
525
527
|
| `AUTH_KEY_PEPPER` | `auth.guards.api_key.pepper` | `None` | Server pepper for API key HMAC-SHA256 verification (`>= 32` bytes required when non-debug/production). |
|
|
528
|
+
| `AUTH_REMEMBER_COOKIE` | `auth.remember.cookie_name` | `"swiftpy_remember"` | Cookie name for HMAC-signed remember-me persistent authentication tokens. |
|
|
529
|
+
| `AUTH_REMEMBER_TTL` | `auth.remember.ttl` | `2592000` | Remember-me cookie lifetime (`Max-Age`) in seconds (default 30 days). |
|
|
530
|
+
| `AUTH_THROTTLE_ENABLED` | `auth.throttle.enabled` | `True` | Enable default cache-backed login rate limiting in `Auth.attempt()` / `Auth.attempt_when()`. |
|
|
531
|
+
| `AUTH_THROTTLE_MAX_ATTEMPTS` | `auth.throttle.max_attempts` | `5` | Maximum failed login attempts before lockout (`429 TooManyRequestsError`). |
|
|
532
|
+
| `AUTH_THROTTLE_DECAY_SECONDS` | `auth.throttle.decay_seconds` | `60` | Attempt counter window duration in seconds. |
|
|
533
|
+
| `AUTH_THROTTLE_LOCKOUT_SECONDS` | `auth.throttle.lockout_seconds` | `60` | Lockout duration (`Retry-After`) in seconds once `max_attempts` is exceeded. |
|
|
526
534
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
527
535
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
528
536
|
| — | `http.max_body_size` | `2097152` (2 MiB) | Maximum allowed HTTP request body size in bytes (configured via `Config` or `Application(...)` / route). Returns 413 when exceeded. |
|
|
@@ -595,7 +603,7 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
595
603
|
- **D-8 (Config Environment Variable Coercion)**: Coercion preserves strings unless the default type is known (e.g. `"0012"` is not silently cast to integer `12`).
|
|
596
604
|
- **D-9 (`FormRequest` Fail-Closed Validation)**: If `rules()` raises `TypeError` or any exception, the request fails closed with `ConfigurationError` (HTTP 500) rather than falling back to unvalidated `{}`.
|
|
597
605
|
- **D-10 (`update()`/`delete()` Without `WHERE`)**: Mass write/delete queries without a `WHERE` clause raise `QueryError` unless `.allow_all()` is explicitly chained.
|
|
598
|
-
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/
|
|
606
|
+
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/mail`, `swiftpy/filesystem`, and `swiftpy/validation` are fully implemented and distributed in the main `swiftpy-framework` wheel (dev test utilities remain in `swiftpy/testing`). `swiftpy/__init__.py` uses PEP 562 lazy exports so lightweight CLI/app imports avoid heavy optional subpackages until accessed.
|
|
599
607
|
- **G-16 (`dict` Auto-JSON & Cache Cleanup)**: Route handlers returning plain `dict` or `list` values are automatically serialized to JSON; legacy unbootstrapped `RouteCache` was removed (`swiftpy cache:build` compiles `config.json` and `prompts.json`); `/docs/` and `AGENTS.md` remain gitignored.
|
|
600
608
|
- **D-12 (Repository Hygiene)**: `.coverage` and cache artifacts untracked from git; `docs/`, `AGENTS.md`, and `DEVLOG.md` maintained untracked at repo root.
|
|
601
609
|
- **D-13 (Default `max_body_size`)**: Default 2 MiB request body limit (`413 Payload Too Large`) enforced across all buffered and streaming HTTP requests, configurable per app and per route.
|
|
@@ -606,16 +614,19 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
606
614
|
|
|
607
615
|
## Project Structure
|
|
608
616
|
|
|
609
|
-
SwiftPY follows a clean, intuitive layout inspired by modern application architectures:
|
|
617
|
+
SwiftPY follows a clean, intuitive layout inspired by modern application architectures (see [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md)):
|
|
610
618
|
|
|
611
619
|
```text
|
|
612
620
|
├── app/
|
|
613
|
-
│ ├──
|
|
614
|
-
│ ├──
|
|
621
|
+
│ ├── ai/ # AI agents, tools, pipelines, custom providers/vectorstores/observers
|
|
622
|
+
│ ├── events/ # Domain events
|
|
623
|
+
│ ├── http/ # Controllers, resources, middleware, requests, exception handlers
|
|
624
|
+
│ ├── jobs/ # Background queue jobs
|
|
625
|
+
│ ├── listeners/ # Event listeners
|
|
626
|
+
│ ├── mail/ # Mailables
|
|
615
627
|
│ ├── models/ # Active Record ORM models
|
|
616
628
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
617
|
-
│
|
|
618
|
-
│ │ └── database_service_provider.py
|
|
629
|
+
│ ├── repositories/ # Data access repositories
|
|
619
630
|
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
620
631
|
│ └── services/ # Domain business logic
|
|
621
632
|
├── config/ # Environment & framework configuration
|
|
@@ -632,9 +643,9 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
632
643
|
│ └── queue.py
|
|
633
644
|
├── database/
|
|
634
645
|
│ └── migrations/ # Timestamped database migrations
|
|
635
|
-
├──
|
|
646
|
+
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
647
|
+
├── views/ # Sandboxed Jinja2 HTML templates (mail/)
|
|
636
648
|
├── swiftpy/ # SwiftPY framework core
|
|
637
|
-
│ ├── admin/ # Auto-introspecting admin site, RBAC & session auth
|
|
638
649
|
│ ├── ai/ # AI client, embeddings, vectorstores, RAG, agents, tools, prompts
|
|
639
650
|
│ ├── auth/ # JWT issuer, API key guards, token blacklist
|
|
640
651
|
│ ├── cache/ # Redis and memory cache drivers
|
|
@@ -25,9 +25,9 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
25
25
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
26
26
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
27
27
|
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
28
|
-
- **Authentication,
|
|
28
|
+
- **Authentication, Credentials, Remember Me & Throttling**: `Auth.attempt()`, `Auth.attempt_when()` / `Callback` query & model closures, HMAC-signed `HttpOnly` remember-me cookies (`remember_token`, `via_remember()`), `login_using_id()`, single-request `once()`, default cache-backed `LoginThrottle` (HTTP `429 TooManyRequestsError` + `Retry-After`), `JWTIssuer` refresh rotation, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, and `ApiKeyGuard`.
|
|
29
29
|
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
30
|
-
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops
|
|
30
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
31
31
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
32
32
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
33
33
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -61,8 +61,10 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
61
61
|
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
62
62
|
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
63
63
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
64
|
+
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
65
|
+
| **Release v0.3.1: Auth Ergonomics, ORM `has()` & Login Throttling** | `Auth.attempt()`, `Callback` conditions + ORM `has()`/`where_has()`, `attempt_when()`, Remember Me cookies (`Blueprint.remember_token()`, `via_remember()`), `login_using_id()`, `once()`, default `LoginThrottle` (`429 TooManyRequestsError`), `Request.cookies` | ✅ Completed |
|
|
64
66
|
|
|
65
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete
|
|
67
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) and [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
66
68
|
|
|
67
69
|
---
|
|
68
70
|
|
|
@@ -493,6 +495,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
493
495
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
494
496
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
495
497
|
| `AUTH_KEY_PEPPER` | `auth.guards.api_key.pepper` | `None` | Server pepper for API key HMAC-SHA256 verification (`>= 32` bytes required when non-debug/production). |
|
|
498
|
+
| `AUTH_REMEMBER_COOKIE` | `auth.remember.cookie_name` | `"swiftpy_remember"` | Cookie name for HMAC-signed remember-me persistent authentication tokens. |
|
|
499
|
+
| `AUTH_REMEMBER_TTL` | `auth.remember.ttl` | `2592000` | Remember-me cookie lifetime (`Max-Age`) in seconds (default 30 days). |
|
|
500
|
+
| `AUTH_THROTTLE_ENABLED` | `auth.throttle.enabled` | `True` | Enable default cache-backed login rate limiting in `Auth.attempt()` / `Auth.attempt_when()`. |
|
|
501
|
+
| `AUTH_THROTTLE_MAX_ATTEMPTS` | `auth.throttle.max_attempts` | `5` | Maximum failed login attempts before lockout (`429 TooManyRequestsError`). |
|
|
502
|
+
| `AUTH_THROTTLE_DECAY_SECONDS` | `auth.throttle.decay_seconds` | `60` | Attempt counter window duration in seconds. |
|
|
503
|
+
| `AUTH_THROTTLE_LOCKOUT_SECONDS` | `auth.throttle.lockout_seconds` | `60` | Lockout duration (`Retry-After`) in seconds once `max_attempts` is exceeded. |
|
|
496
504
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
497
505
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
498
506
|
| — | `http.max_body_size` | `2097152` (2 MiB) | Maximum allowed HTTP request body size in bytes (configured via `Config` or `Application(...)` / route). Returns 413 when exceeded. |
|
|
@@ -565,7 +573,7 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
565
573
|
- **D-8 (Config Environment Variable Coercion)**: Coercion preserves strings unless the default type is known (e.g. `"0012"` is not silently cast to integer `12`).
|
|
566
574
|
- **D-9 (`FormRequest` Fail-Closed Validation)**: If `rules()` raises `TypeError` or any exception, the request fails closed with `ConfigurationError` (HTTP 500) rather than falling back to unvalidated `{}`.
|
|
567
575
|
- **D-10 (`update()`/`delete()` Without `WHERE`)**: Mass write/delete queries without a `WHERE` clause raise `QueryError` unless `.allow_all()` is explicitly chained.
|
|
568
|
-
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/
|
|
576
|
+
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/mail`, `swiftpy/filesystem`, and `swiftpy/validation` are fully implemented and distributed in the main `swiftpy-framework` wheel (dev test utilities remain in `swiftpy/testing`). `swiftpy/__init__.py` uses PEP 562 lazy exports so lightweight CLI/app imports avoid heavy optional subpackages until accessed.
|
|
569
577
|
- **G-16 (`dict` Auto-JSON & Cache Cleanup)**: Route handlers returning plain `dict` or `list` values are automatically serialized to JSON; legacy unbootstrapped `RouteCache` was removed (`swiftpy cache:build` compiles `config.json` and `prompts.json`); `/docs/` and `AGENTS.md` remain gitignored.
|
|
570
578
|
- **D-12 (Repository Hygiene)**: `.coverage` and cache artifacts untracked from git; `docs/`, `AGENTS.md`, and `DEVLOG.md` maintained untracked at repo root.
|
|
571
579
|
- **D-13 (Default `max_body_size`)**: Default 2 MiB request body limit (`413 Payload Too Large`) enforced across all buffered and streaming HTTP requests, configurable per app and per route.
|
|
@@ -576,16 +584,19 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
576
584
|
|
|
577
585
|
## Project Structure
|
|
578
586
|
|
|
579
|
-
SwiftPY follows a clean, intuitive layout inspired by modern application architectures:
|
|
587
|
+
SwiftPY follows a clean, intuitive layout inspired by modern application architectures (see [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md)):
|
|
580
588
|
|
|
581
589
|
```text
|
|
582
590
|
├── app/
|
|
583
|
-
│ ├──
|
|
584
|
-
│ ├──
|
|
591
|
+
│ ├── ai/ # AI agents, tools, pipelines, custom providers/vectorstores/observers
|
|
592
|
+
│ ├── events/ # Domain events
|
|
593
|
+
│ ├── http/ # Controllers, resources, middleware, requests, exception handlers
|
|
594
|
+
│ ├── jobs/ # Background queue jobs
|
|
595
|
+
│ ├── listeners/ # Event listeners
|
|
596
|
+
│ ├── mail/ # Mailables
|
|
585
597
|
│ ├── models/ # Active Record ORM models
|
|
586
598
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
587
|
-
│
|
|
588
|
-
│ │ └── database_service_provider.py
|
|
599
|
+
│ ├── repositories/ # Data access repositories
|
|
589
600
|
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
590
601
|
│ └── services/ # Domain business logic
|
|
591
602
|
├── config/ # Environment & framework configuration
|
|
@@ -602,9 +613,9 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
602
613
|
│ └── queue.py
|
|
603
614
|
├── database/
|
|
604
615
|
│ └── migrations/ # Timestamped database migrations
|
|
605
|
-
├──
|
|
616
|
+
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
617
|
+
├── views/ # Sandboxed Jinja2 HTML templates (mail/)
|
|
606
618
|
├── swiftpy/ # SwiftPY framework core
|
|
607
|
-
│ ├── admin/ # Auto-introspecting admin site, RBAC & session auth
|
|
608
619
|
│ ├── ai/ # AI client, embeddings, vectorstores, RAG, agents, tools, prompts
|
|
609
620
|
│ ├── auth/ # JWT issuer, API key guards, token blacklist
|
|
610
621
|
│ ├── cache/ # Redis and memory cache drivers
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from app.ai.tools.system_status_tool import SystemStatusTool
|
|
6
|
+
from swiftpy.ai.agents import AgentMemory, BaseAgent
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from collections.abc import Sequence
|
|
10
|
+
|
|
11
|
+
from swiftpy.ai.agents import BaseMemoryBackend
|
|
12
|
+
from swiftpy.ai.client import AIClient
|
|
13
|
+
from swiftpy.ai.tools import BaseTool
|
|
14
|
+
from swiftpy.core.config import Config
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AssistantAgent(BaseAgent):
|
|
18
|
+
"""Default conversational assistant agent wired with starter tools."""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
*,
|
|
23
|
+
model: str | None = None,
|
|
24
|
+
system_prompt: str = (
|
|
25
|
+
"You are a helpful, concise SwiftPY application assistant."
|
|
26
|
+
),
|
|
27
|
+
tools: Sequence[BaseTool | type[BaseTool]] | None = None,
|
|
28
|
+
memory: AgentMemory | BaseMemoryBackend | None = None,
|
|
29
|
+
client: AIClient | None = None,
|
|
30
|
+
config: Config | None = None,
|
|
31
|
+
) -> None:
|
|
32
|
+
default_tools: list[BaseTool | type[BaseTool]] = (
|
|
33
|
+
list(tools) if tools is not None else [SystemStatusTool()]
|
|
34
|
+
)
|
|
35
|
+
super().__init__(
|
|
36
|
+
name="AssistantAgent",
|
|
37
|
+
model=model,
|
|
38
|
+
system_prompt=system_prompt,
|
|
39
|
+
tools=default_tools,
|
|
40
|
+
memory=memory if memory is not None else AgentMemory(),
|
|
41
|
+
client=client,
|
|
42
|
+
config=config,
|
|
43
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from datetime import UTC, datetime
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.ai.tools import BaseTool
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SystemStatusTool(BaseTool):
|
|
10
|
+
"""Function-calling tool reporting basic application runtime status."""
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def name(self) -> str:
|
|
14
|
+
return "system_status"
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def description(self) -> str:
|
|
18
|
+
return "Return the current UTC timestamp and application health status."
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def parameters(self) -> dict[str, Any]:
|
|
22
|
+
return {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {},
|
|
25
|
+
"required": [],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async def handle(self, *args: Any, **kwargs: Any) -> Any:
|
|
29
|
+
"""Return structured UTC timestamp and ok status."""
|
|
30
|
+
return {
|
|
31
|
+
"status": "ok",
|
|
32
|
+
"utc_time": datetime.now(tz=UTC).isoformat(),
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from app.http.resources.user_resource import UserResource
|
|
4
|
+
from app.services.user_service import UserService
|
|
5
|
+
from swiftpy.http.request import Request
|
|
6
|
+
from swiftpy.http.response import Response, json_response
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserController:
|
|
10
|
+
"""
|
|
11
|
+
HTTP controller for user API endpoints.
|
|
12
|
+
|
|
13
|
+
Resolves constructor dependencies via the SwiftPY DI container and delegates
|
|
14
|
+
domain logic to UserService before formatting responses with UserResource.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, user_service: UserService) -> None:
|
|
18
|
+
self.user_service = user_service
|
|
19
|
+
|
|
20
|
+
async def index(self, request: Request) -> Response:
|
|
21
|
+
"""List users serialized through UserResource."""
|
|
22
|
+
users = await self.user_service.list_users()
|
|
23
|
+
return json_response(UserResource.collection(users))
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.core.context import Context
|
|
7
|
+
from swiftpy.core.exceptions import HttpException
|
|
8
|
+
from swiftpy.http.middleware import Handler, Middleware
|
|
9
|
+
from swiftpy.http.request import Request
|
|
10
|
+
from swiftpy.http.response import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _resolve_authenticated_user(request: Request) -> Any:
|
|
14
|
+
"""Resolve the active authenticated user across Context and request.state, respecting logout state."""
|
|
15
|
+
if Context.get("__swiftpy_logged_out__") or request.state.get(
|
|
16
|
+
"__swiftpy_logged_out__"
|
|
17
|
+
):
|
|
18
|
+
return None
|
|
19
|
+
user = Context.get("auth.user")
|
|
20
|
+
if user is None:
|
|
21
|
+
user = Context.get("__swiftpy_current_user__")
|
|
22
|
+
if user is None:
|
|
23
|
+
user = Context.get("__swiftpy_current_user_model__")
|
|
24
|
+
if user is None:
|
|
25
|
+
user = request.state.get("user")
|
|
26
|
+
return user
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _is_admin_user(user: Any) -> bool:
|
|
30
|
+
"""Return True only when user carries an explicit boolean `is_admin is True` in a mapping or model."""
|
|
31
|
+
if isinstance(user, Mapping):
|
|
32
|
+
raw_flag = user.get("is_admin")
|
|
33
|
+
if raw_flag is not None:
|
|
34
|
+
return raw_flag is True
|
|
35
|
+
if getattr(user, "is_admin", None) is True:
|
|
36
|
+
return True
|
|
37
|
+
model = getattr(user, "model", None) or Context.get(
|
|
38
|
+
"__swiftpy_current_user_model__"
|
|
39
|
+
)
|
|
40
|
+
return getattr(model, "is_admin", None) is True
|
|
41
|
+
return getattr(user, "is_admin", None) is True
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AdminMiddleware(Middleware):
|
|
45
|
+
"""
|
|
46
|
+
Authorization ASGI middleware for administrative access control.
|
|
47
|
+
|
|
48
|
+
Retrieves the authenticated user from task-isolated `Context` or `request.state`.
|
|
49
|
+
Verifies that the user exists and has administrative privileges (`user.is_admin` is True).
|
|
50
|
+
Raises HTTP 401 Unauthorized if unauthenticated, or HTTP 403 Forbidden if not an administrator.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
async def handle(self, request: Request, next_handler: Handler) -> Response:
|
|
54
|
+
user = _resolve_authenticated_user(request)
|
|
55
|
+
if user is None:
|
|
56
|
+
raise HttpException(
|
|
57
|
+
status_code=401,
|
|
58
|
+
message="Unauthenticated: Please authenticate first",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if not _is_admin_user(user):
|
|
62
|
+
raise HttpException(
|
|
63
|
+
status_code=403,
|
|
64
|
+
message="Forbidden: Administrator access required",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return await next_handler(request)
|
|
@@ -32,8 +32,12 @@ class AuthMiddleware(Middleware):
|
|
|
32
32
|
message="Unauthenticated: Missing or invalid credentials",
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
+
Context.set("__swiftpy_logged_out__", False)
|
|
35
36
|
Context.set("auth.user", user)
|
|
36
37
|
Context.set("__swiftpy_current_user__", user)
|
|
38
|
+
if hasattr(user, "__table__"):
|
|
39
|
+
Context.set("__swiftpy_current_user_model__", user)
|
|
40
|
+
request.state.pop("__swiftpy_logged_out__", None)
|
|
37
41
|
request.state["user"] = user
|
|
38
42
|
|
|
39
43
|
return await next_handler(request)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Any
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserResource:
|
|
10
|
+
"""HTTP API resource transformer for User entities and schemas."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, resource: Any) -> None:
|
|
13
|
+
self.resource = resource
|
|
14
|
+
|
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
|
16
|
+
"""Transform a User model or UserResponseSchema into an HTTP-safe dictionary."""
|
|
17
|
+
if isinstance(self.resource, dict):
|
|
18
|
+
return {
|
|
19
|
+
"id": self.resource.get("id"),
|
|
20
|
+
"name": self.resource.get("name"),
|
|
21
|
+
"email": self.resource.get("email"),
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
"id": getattr(self.resource, "id", None),
|
|
25
|
+
"name": getattr(self.resource, "name", None),
|
|
26
|
+
"email": getattr(self.resource, "email", None),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def collection(cls, items: Iterable[Any]) -> list[dict[str, Any]]:
|
|
31
|
+
"""Transform a collection of user items into HTTP-safe dictionaries."""
|
|
32
|
+
return [cls(item).to_dict() for item in items]
|
|
@@ -14,12 +14,13 @@ class User(Model):
|
|
|
14
14
|
__table__ = "users"
|
|
15
15
|
__primary_key__ = "id"
|
|
16
16
|
__fillable__ = ["name", "email", "password", "is_admin"]
|
|
17
|
-
__hidden__ = ["password"]
|
|
17
|
+
__hidden__ = ["password", "remember_token"]
|
|
18
18
|
|
|
19
19
|
id: int
|
|
20
20
|
name: str
|
|
21
21
|
email: str
|
|
22
22
|
password: str
|
|
23
23
|
is_admin: bool
|
|
24
|
+
remember_token: str | None = None
|
|
24
25
|
created_at: datetime
|
|
25
26
|
updated_at: datetime
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import asdict, dataclass
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import TYPE_CHECKING, Any
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from app.models.user import User
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
@dataclass(slots=True)
|
|
@@ -21,6 +24,12 @@ class UserResponseSchema:
|
|
|
21
24
|
name: str
|
|
22
25
|
email: str
|
|
23
26
|
|
|
27
|
+
@classmethod
|
|
28
|
+
def from_model(cls, user: User) -> UserResponseSchema:
|
|
29
|
+
return cls(id=user.id, name=user.name, email=user.email)
|
|
30
|
+
|
|
24
31
|
def to_dict(self) -> dict[str, Any]:
|
|
25
32
|
return asdict(self)
|
|
26
33
|
|
|
34
|
+
|
|
35
|
+
UserSchema = UserResponseSchema
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from app.models.user import User
|
|
4
|
+
from app.repositories.user_repository import UserRepository
|
|
5
|
+
from app.schemas.user_schema import UserResponseSchema
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserService:
|
|
9
|
+
"""
|
|
10
|
+
Domain business logic layer for user entity management.
|
|
11
|
+
Coordinates between repositories, schemas, transactions, events, and background notifications.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, repository: UserRepository | None = None) -> None:
|
|
15
|
+
self.repository = repository or UserRepository()
|
|
16
|
+
|
|
17
|
+
async def list_users(self) -> list[UserResponseSchema]:
|
|
18
|
+
"""Return starter user response DTOs."""
|
|
19
|
+
return [
|
|
20
|
+
UserResponseSchema(
|
|
21
|
+
id=1,
|
|
22
|
+
name="Alice Doe",
|
|
23
|
+
email="alice@example.com",
|
|
24
|
+
)
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
async def create_user(
|
|
28
|
+
self, name: str, email: str, password_hash: str
|
|
29
|
+
) -> User:
|
|
30
|
+
"""Create a new user account with hashed credentials."""
|
|
31
|
+
user = await self.repository.create(
|
|
32
|
+
name=name,
|
|
33
|
+
email=email,
|
|
34
|
+
password=password_hash,
|
|
35
|
+
is_admin=False,
|
|
36
|
+
)
|
|
37
|
+
return user
|
|
38
|
+
|
|
39
|
+
async def create_user_schema(
|
|
40
|
+
self, name: str, email: str, password_hash: str
|
|
41
|
+
) -> UserResponseSchema:
|
|
42
|
+
"""Create a new user account and return an explicit response schema."""
|
|
43
|
+
user = await self.create_user(name, email, password_hash)
|
|
44
|
+
return UserResponseSchema.from_model(user)
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from swiftpy import env
|
|
3
|
+
from swiftpy import env, env_bool
|
|
4
4
|
|
|
5
5
|
CONFIG: dict[str, object] = {
|
|
6
6
|
"enabled": env("AI_ENABLED", "true").lower() in ("true", "1", "yes"),
|
|
7
7
|
"default": env("AI_DEFAULT_PROVIDER", "openai"),
|
|
8
|
+
"prompts": {
|
|
9
|
+
"path": env("AI_PROMPTS_PATH", "prompts"),
|
|
10
|
+
"cache": env_bool("AI_PROMPTS_CACHE", False),
|
|
11
|
+
},
|
|
8
12
|
"providers": {
|
|
9
13
|
"openai": {
|
|
10
14
|
"api_key": env("OPENAI_API_KEY", ""),
|
|
@@ -10,6 +10,17 @@ CONFIG: dict[str, object] = {
|
|
|
10
10
|
"hash": {
|
|
11
11
|
"rounds": int(env("BCRYPT_ROUNDS", "12")),
|
|
12
12
|
},
|
|
13
|
+
"remember": {
|
|
14
|
+
"cookie_name": env("AUTH_REMEMBER_COOKIE", "swiftpy_remember"),
|
|
15
|
+
"ttl": int(env("AUTH_REMEMBER_TTL", "2592000")),
|
|
16
|
+
},
|
|
17
|
+
"throttle": {
|
|
18
|
+
"enabled": env_bool("AUTH_THROTTLE_ENABLED", True),
|
|
19
|
+
"max_attempts": int(env("AUTH_THROTTLE_MAX_ATTEMPTS", "5")),
|
|
20
|
+
"decay_seconds": int(env("AUTH_THROTTLE_DECAY_SECONDS", "60")),
|
|
21
|
+
"lockout_seconds": int(env("AUTH_THROTTLE_LOCKOUT_SECONDS", "60")),
|
|
22
|
+
"prefix": env("AUTH_THROTTLE_PREFIX", "auth:throttle"),
|
|
23
|
+
},
|
|
13
24
|
"guards": {
|
|
14
25
|
"jwt": {
|
|
15
26
|
"driver": "jwt",
|