swiftpy-framework 0.3.0__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.3.0 → swiftpy_framework-0.3.1}/.env.example +6 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/CHANGELOG.md +22 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/PKG-INFO +9 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/README.md +8 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/models/user.py +2 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/auth.py +11 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/database/migrations/2026_01_01_000000_create_users_table.py +1 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-14-installation-quick-start.md +2 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-authentication-and-security.md +93 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-orm-models-and-relationships.md +24 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-19-database-schema-and-blueprint.md +1 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/pyproject.toml +1 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/__init__.py +12 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth/__init__.py +24 -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.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth/exceptions.py +2 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth/jwt_guard.py +12 -1
- {swiftpy_framework-0.3.0 → 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.3.1/swiftpy/auth/user_context.py +796 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth_manager.py +4 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/new.py +21 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/application.py +45 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/exceptions.py +2 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/blueprint.py +4 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/orm/model.py +358 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/http/exceptions.py +22 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/http/request.py +38 -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.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_refresh_and_logout.py +209 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_new_command.py +2 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_phase9_cli_remediation.py +1 -1
- {swiftpy_framework-0.3.0 → 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.3.0 → swiftpy_framework-0.3.1}/uv.lock +1 -1
- swiftpy_framework-0.3.0/swiftpy/auth/auth_manager.py +0 -851
- swiftpy_framework-0.3.0/swiftpy/auth/user_context.py +0 -349
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/.dockerignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/.github/workflows/ci.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/.gitignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/Dockerfile +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/LICENSE +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/agents/assistant_agent.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/pipelines/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/providers/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/tools/system_status_tool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/ai/vectorstores/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/controllers/user_controller.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/http/resources/user_resource.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/schemas/user_schema.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/ai.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/app.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/cors.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/database.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/filesystems.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/logging.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/mail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/config/queue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/docker-compose.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-ai-subsystem.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-cache-events-and-queues.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-database-query-builder-and-migrations.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-filesystem-storage-and-mail.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-validation-and-form-requests.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-15-websockets-and-admin.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-19-application-schemas.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-19-cli-and-testing.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-20-request-and-responses.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-21-application-architecture-and-project-structure.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/documentations/2026-11-21-cors.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/main.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/prompts/classify.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/prompts/summarise.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/red-black.png +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/routes/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/routes/api.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth/api_key_guard.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/auth/token_blacklist.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/make.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/agent.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/prompt.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/repository.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/schema.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/console/stubs/tool.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/migrations/schema.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/http/router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/form_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/validation/validator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_auth_proxy.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/conftest.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/console/test_stubs_and_make.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_helpers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_controller_routing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/typing/test_orm_typing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_validation_ergonomics.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.1}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.3.0 → 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
|
|
@@ -4,6 +4,28 @@ 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
|
+
|
|
7
29
|
## [0.3.0] - 2026-11-22
|
|
8
30
|
|
|
9
31
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.3.
|
|
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,7 +55,7 @@ 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
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.
|
|
@@ -92,6 +92,7 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
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
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 |
|
|
95
96
|
|
|
96
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.*
|
|
97
98
|
|
|
@@ -524,6 +525,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
524
525
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
525
526
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
526
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. |
|
|
527
534
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
528
535
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
529
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. |
|
|
@@ -25,7 +25,7 @@ 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
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.
|
|
@@ -62,6 +62,7 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
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
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 |
|
|
65
66
|
|
|
66
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.*
|
|
67
68
|
|
|
@@ -494,6 +495,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
494
495
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
495
496
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
496
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. |
|
|
497
504
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
498
505
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
499
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. |
|
|
@@ -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
|
|
@@ -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",
|
|
@@ -325,7 +325,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
325
325
|
name = "my_api"
|
|
326
326
|
version = "0.1.0"
|
|
327
327
|
dependencies = [
|
|
328
|
-
"swiftpy-framework>=0.3.
|
|
328
|
+
"swiftpy-framework>=0.3.1",
|
|
329
329
|
# ...
|
|
330
330
|
]
|
|
331
331
|
```
|
|
@@ -355,7 +355,7 @@ If running without Docker, upgrade inside your activated `.venv`:
|
|
|
355
355
|
uv sync --upgrade-package swiftpy-framework
|
|
356
356
|
|
|
357
357
|
# Or with pip
|
|
358
|
-
python -m pip install --upgrade "swiftpy-framework>=0.3.
|
|
358
|
+
python -m pip install --upgrade "swiftpy-framework>=0.3.1"
|
|
359
359
|
swiftpy --version
|
|
360
360
|
```
|
|
361
361
|
|
|
@@ -9,15 +9,25 @@ Core authentication symbols can be imported from `swiftpy.auth` or lazily from t
|
|
|
9
9
|
```python
|
|
10
10
|
from swiftpy.auth import (
|
|
11
11
|
ApiKeyGuard,
|
|
12
|
+
Attempting,
|
|
13
|
+
Auth,
|
|
14
|
+
Authenticated,
|
|
12
15
|
AuthenticationError,
|
|
13
16
|
AuthManager,
|
|
17
|
+
Callback,
|
|
14
18
|
CurrentUser,
|
|
19
|
+
Failed,
|
|
15
20
|
Hash,
|
|
16
21
|
InvalidApiKeyError,
|
|
17
22
|
JWTGuard,
|
|
18
23
|
JWTIssuer,
|
|
24
|
+
Lockout,
|
|
25
|
+
Login,
|
|
26
|
+
LoginThrottle,
|
|
27
|
+
Logout,
|
|
19
28
|
TokenBlacklist,
|
|
20
29
|
TokenRevokedError,
|
|
30
|
+
TooManyRequestsError,
|
|
21
31
|
current_user,
|
|
22
32
|
generate_api_key,
|
|
23
33
|
hash_api_key,
|
|
@@ -97,6 +107,14 @@ JWT_REFRESH_TTL=604800
|
|
|
97
107
|
|
|
98
108
|
# API Keys (AUTH_KEY_PEPPER requires at least 32 UTF-8 bytes)
|
|
99
109
|
AUTH_KEY_PEPPER=replace-with-another-32-byte-random-secret
|
|
110
|
+
|
|
111
|
+
# Remember Me Cookies & Login Throttling
|
|
112
|
+
AUTH_REMEMBER_COOKIE=swiftpy_remember
|
|
113
|
+
AUTH_REMEMBER_TTL=2592000
|
|
114
|
+
AUTH_THROTTLE_ENABLED=true
|
|
115
|
+
AUTH_THROTTLE_MAX_ATTEMPTS=5
|
|
116
|
+
AUTH_THROTTLE_DECAY_SECONDS=60
|
|
117
|
+
AUTH_THROTTLE_LOCKOUT_SECONDS=60
|
|
100
118
|
```
|
|
101
119
|
|
|
102
120
|
When `APP_DEBUG=false` (or `APP_ENV=production`), `AuthServiceProvider.boot()` checks the active default guard (`auth.defaults.guard`) and fails fast with `ConfigurationError` if `JWT_SECRET` (for `jwt`) or `AUTH_KEY_PEPPER` (for `api_key`) is missing or shorter than 32 bytes.
|
|
@@ -297,7 +315,7 @@ async def login(payload: LoginRequest, jwt: JWTIssuer, current: CurrentUser) ->
|
|
|
297
315
|
|
|
298
316
|
> `CurrentUser.id` returns the raw token `sub` (a string) when no model is bound, while `auth().id()` coerces it to the User model's primary key type. Compare with `str(...)` or use `auth().id()` consistently.
|
|
299
317
|
|
|
300
|
-
For token refresh endpoints,
|
|
318
|
+
For token refresh endpoints, inject `jwt: JWTIssuer` **or** invoke `await JWTIssuer.refresh_token_pair(...)` directly on `JWTIssuer` (both forms automatically resolve the active application's configuration and `TokenBlacklist`). Rather than calling `issue_token_pair()` manually, `refresh_token_pair()` verifies the incoming token with `expected_type="refresh"`, checks `TokenBlacklist`, revokes the previous refresh token's `jti` automatically (`rotate=True` by default) so reused refresh tokens fail with `TokenRevokedError` (`401`), and issues a fresh access/refresh pair:
|
|
301
319
|
|
|
302
320
|
```python
|
|
303
321
|
from swiftpy.auth import JWTIssuer
|
|
@@ -317,10 +335,84 @@ async def refresh(payload: RefreshRequest, jwt: JWTIssuer) -> Response:
|
|
|
317
335
|
# rotates by blacklisting the previous refresh JTI, and returns a new token pair.
|
|
318
336
|
tokens = await jwt.refresh_token_pair(payload.refresh_token, rotate=True)
|
|
319
337
|
return json_response(tokens)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
# Static / service-layer invocation against the active application container is also supported:
|
|
341
|
+
async def refresh_in_service(refresh_token: str) -> dict[str, object]:
|
|
342
|
+
return await JWTIssuer.refresh_token_pair(refresh_token=refresh_token, rotate=True)
|
|
320
343
|
```
|
|
321
344
|
|
|
345
|
+
> Both instance calls (`jwt.issue_token_pair(...)`, `jwt.decode_token(...)`, `await jwt.refresh_token_pair(...)`) and direct class calls (`JWTIssuer.issue_token_pair(...)`, `JWTIssuer.decode_token(...)`, `await JWTIssuer.refresh_token_pair(...)`) are supported across `JWTIssuer` using the active container's `JWTIssuer` singleton.
|
|
346
|
+
|
|
322
347
|
> **WebSocket JWT support:** `require_jwt()` also extracts Bearer tokens from `Sec-WebSocket-Protocol` (`["bearer", "<jwt>"]` or `"bearer.<jwt>"`) or `?token=` / `?access_token=` query parameters on WebSocket handshakes (avoid query-string tokens in production where access logs record URLs).
|
|
323
348
|
|
|
349
|
+
### 4b. Credential Authentication (`Auth.attempt`, `attempt_when`, Remember Me, `once`, `login_using_id` & Login Throttling)
|
|
350
|
+
|
|
351
|
+
Use the `Auth` facade (`from swiftpy import Auth, Callback`) to verify user credentials against your configured `User` model (`auth.model` or `app.models.user.User`) using non-blocking `await Hash.check_async(...)` verification:
|
|
352
|
+
|
|
353
|
+
```python
|
|
354
|
+
from swiftpy import Auth, Callback, Request, Response, json_response
|
|
355
|
+
from app.models.user import User
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@router.post("/login")
|
|
359
|
+
async def login(request: Request) -> Response:
|
|
360
|
+
email = request.input("email")
|
|
361
|
+
password = request.input("password")
|
|
362
|
+
remember = bool(request.input("remember", False))
|
|
363
|
+
|
|
364
|
+
# 1. Verify email + plaintext password (+ arbitrary boolean/scalar filters such as active=1)
|
|
365
|
+
if await Auth.attempt({"email": email, "password": password, "active": 1}, remember):
|
|
366
|
+
return json_response({
|
|
367
|
+
"user": Auth.user().to_dict(),
|
|
368
|
+
"tokens": Auth.tokens(),
|
|
369
|
+
})
|
|
370
|
+
|
|
371
|
+
return json_response({"detail": "Invalid credentials"}, status_code=401)
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Supported `Auth` login patterns:
|
|
375
|
+
|
|
376
|
+
- **Extra conditions & boolean coercion:** Additional scalar key/value pairs in the `credentials` dictionary (such as `"active": 1`) are added as parameterized `WHERE` clauses and coerce `0`/`1` cleanly when the target model field is typed as `bool`.
|
|
377
|
+
- **Closure query conditions (`Callback`):** Pass `Callback(lambda q: q.has("activeSubscription"))` as a key (or callable value) inside `credentials` to extend the underlying `ModelQueryBuilder` before selecting the candidate user:
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
ok = await Auth.attempt({
|
|
381
|
+
"email": email,
|
|
382
|
+
"password": password,
|
|
383
|
+
Callback(lambda query: query.has("activeSubscription")): True,
|
|
384
|
+
})
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
- **Post-retrieval inspection (`Auth.attempt_when` / `attemptWhen`):** Inspect the fetched `User` model (sync or async closure) after password verification completes:
|
|
388
|
+
|
|
389
|
+
```python
|
|
390
|
+
if await Auth.attempt_when(
|
|
391
|
+
{"email": email, "password": password},
|
|
392
|
+
Callback(lambda user: user.is_not_banned()),
|
|
393
|
+
):
|
|
394
|
+
# Authenticated cleanly
|
|
395
|
+
...
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
- **Remember Me (`remember=True`):** Pass `remember=True` to `Auth.attempt()`, `Auth.attempt_when()`, `Auth.login()`, or `Auth.login_using_id()`. SwiftPY persists a 60-character random token in the user's nullable `remember_token` column (`table.remember_token()`, included in `create_users_table` and hidden via `User.__hidden__`) and automatically attaches an HMAC-SHA256 signed, `HttpOnly`, `SameSite=Lax` cookie (`swiftpy_remember`, with `Secure` enabled automatically under `APP_ENV=production` or HTTPS requests) to the HTTP response. Subsequent requests bearing that valid cookie are authenticated automatically (`Auth.via_remember() == True`). Each `remember=True` login rotates the user's single `remember_token` record (so signing in with remember-me on a new device invalidates older remembered device cookies), and `await Auth.logout()` / `await Auth.logout_all()` clears `remember_token` in PostgreSQL while expiring the browser cookie.
|
|
399
|
+
- **Direct ID login (`Auth.login_using_id` / `loginUsingId` / `login_sing_id`):** Authenticate directly by database primary key (returns the `User` instance, or `False` if absent):
|
|
400
|
+
|
|
401
|
+
```python
|
|
402
|
+
user = await Auth.login_using_id(1)
|
|
403
|
+
user = await Auth.login_using_id(1, remember=True)
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
- **Single-request stateless authentication (`Auth.once` / `Auth.once_using_id`):** Authenticates the user within the current task `Context` only—no `remember_token` writes, no cookies queued, no persistent token pairs stored, and no `Login` event dispatched:
|
|
407
|
+
|
|
408
|
+
```python
|
|
409
|
+
if await Auth.once({"email": email, "password": password}):
|
|
410
|
+
# Authenticated for this request only
|
|
411
|
+
...
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
- **Default Login Throttling (`LoginThrottle`):** Enabled by default on `Auth.attempt()` and `Auth.attempt_when()` (`max_attempts=5`, `decay_seconds=60`, `lockout_seconds=60` in `config/auth.py`). Exceeding `max_attempts` dispatches a `Lockout` event (`"auth.lockout"`) and raises `TooManyRequestsError`, mapping automatically to HTTP `429 Too Many Requests` with a `Retry-After` header. Call `await Auth.too_many_attempts(...)`, `await Auth.available_in(...)`, or `await Auth.clear_throttle(...)` to inspect or reset counters manually, or disable globally with `AUTH_THROTTLE_ENABLED=false`.
|
|
415
|
+
|
|
324
416
|
### 5. Token Revocation, `auth().logout()` & `auth().logout_all()`
|
|
325
417
|
|
|
326
418
|
`TokenBlacklist` uses Redis to track revoked `jti` IDs and subject-wide cutoffs with automatic TTL expiration (`min(exp - now, max_token_lifetime)`, capped at 7 days by default).
|
|
@@ -417,6 +417,30 @@ for user in users:
|
|
|
417
417
|
|
|
418
418
|
Eager-loaded to-many relationships return a `LoadedList` (a `list` subclass that also works if awaited with `await user.posts`), while eager-loaded to-one relationships resolve to `Model | None`.
|
|
419
419
|
|
|
420
|
+
#### Filtering by Relationship Existence (`has`, `doesnt_have`, `where_has`)
|
|
421
|
+
|
|
422
|
+
Query parent models based on whether related records exist or match additional constraints—across `HasOne`, `HasMany`, `BelongsTo`, `BelongsToMany`, and nested dot-paths:
|
|
423
|
+
|
|
424
|
+
```python
|
|
425
|
+
# Users with at least one subscription / post (supports camelCase or snake_case relation names)
|
|
426
|
+
subscribed = await User.has("activeSubscription").get()
|
|
427
|
+
active_authors = await User.has("posts", ">=", 2).get()
|
|
428
|
+
|
|
429
|
+
# Users without any posts (NULL-safe NOT IN)
|
|
430
|
+
no_posts = await User.doesnt_have("posts").get()
|
|
431
|
+
|
|
432
|
+
# Constrain the related query inside the subquery
|
|
433
|
+
published_authors = await User.where_has(
|
|
434
|
+
"posts", lambda q: q.where("published", True)
|
|
435
|
+
).get()
|
|
436
|
+
|
|
437
|
+
# Nested relationships + OR combinators
|
|
438
|
+
approved_commenters = await User.where_has(
|
|
439
|
+
"posts.comments", lambda q: q.where("approved", True)
|
|
440
|
+
).get()
|
|
441
|
+
mixed = await User.where("is_admin", True).or_where_doesnt_have("posts").get()
|
|
442
|
+
```
|
|
443
|
+
|
|
420
444
|
#### Async Lazy Queries vs `RelationNotLoadedError`
|
|
421
445
|
|
|
422
446
|
By default (`prevent_lazy_loading = False`), accessing an **unloaded** relationship attribute returns a `RelationshipQueryBuilder` (for `HasMany`/`BelongsToMany`) or `SingleRelationshipQueryBuilder` (for `HasOne`/`BelongsTo`):
|
|
@@ -116,6 +116,7 @@ Every column name and identifier passes through `validate_identifier()` before S
|
|
|
116
116
|
| `table.medium_text(name)` | `TEXT` | Mapped cleanly to PostgreSQL `TEXT`. |
|
|
117
117
|
| `table.long_text(name)` | `TEXT` | Mapped cleanly to PostgreSQL `TEXT`. |
|
|
118
118
|
| `table.enum(name, values)` | `VARCHAR(<N>)` + value check | Validates allowed non-empty string `values`; validates `.default(...)` against `values` (unless nullable `None` or `raw(...)`). |
|
|
119
|
+
| `table.remember_token(name="remember_token", length=100)` | `VARCHAR(length) NULL` | Nullable persistent token column used by `Auth.attempt(..., remember=True)`. |
|
|
119
120
|
|
|
120
121
|
### Numeric & Boolean Types
|
|
121
122
|
|
|
@@ -10,7 +10,7 @@ dev = [
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "swiftpy-framework"
|
|
13
|
-
version = "0.3.
|
|
13
|
+
version = "0.3.1"
|
|
14
14
|
description = "SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy."
|
|
15
15
|
requires-python = ">=3.12"
|
|
16
16
|
dependencies = [
|
|
@@ -19,10 +19,13 @@ if TYPE_CHECKING:
|
|
|
19
19
|
)
|
|
20
20
|
from swiftpy.auth import (
|
|
21
21
|
ApiKeyGuard,
|
|
22
|
+
Auth,
|
|
22
23
|
AuthManager,
|
|
24
|
+
Callback,
|
|
23
25
|
CurrentUser,
|
|
24
26
|
JWTGuard,
|
|
25
27
|
JWTIssuer,
|
|
28
|
+
LoginThrottle,
|
|
26
29
|
TokenBlacklist,
|
|
27
30
|
current_user,
|
|
28
31
|
hash_api_key,
|
|
@@ -51,6 +54,7 @@ if TYPE_CHECKING:
|
|
|
51
54
|
MethodNotAllowedError,
|
|
52
55
|
NotFoundError,
|
|
53
56
|
PayloadTooLargeError,
|
|
57
|
+
TooManyRequestsError,
|
|
54
58
|
UnauthorizedError,
|
|
55
59
|
ValidationError,
|
|
56
60
|
abort,
|
|
@@ -221,6 +225,7 @@ _EXPORT_MAP: dict[str, tuple[str, str]] = {
|
|
|
221
225
|
'ApiKeyGuard': ('swiftpy.auth', 'ApiKeyGuard'),
|
|
222
226
|
'Application': ('swiftpy.core.application', 'Application'),
|
|
223
227
|
'Attachment': ('swiftpy.mail', 'Attachment'),
|
|
228
|
+
'Auth': ('swiftpy.auth', 'Auth'),
|
|
224
229
|
'AuthManager': ('swiftpy.auth', 'AuthManager'),
|
|
225
230
|
'AuthUser': ('swiftpy.auth_manager', 'AuthUser'),
|
|
226
231
|
'BadRequestError': ('swiftpy.core.exceptions', 'BadRequestError'),
|
|
@@ -234,6 +239,7 @@ _EXPORT_MAP: dict[str, tuple[str, str]] = {
|
|
|
234
239
|
'Cache': ('swiftpy.cache', 'Cache'),
|
|
235
240
|
'CacheDriver': ('swiftpy.cache', 'CacheDriver'),
|
|
236
241
|
'CacheManager': ('swiftpy.cache', 'CacheManager'),
|
|
242
|
+
'Callback': ('swiftpy.auth', 'Callback'),
|
|
237
243
|
'CircularDependencyError': ('swiftpy.core.container_exceptions', 'CircularDependencyError'),
|
|
238
244
|
'ClientDisconnect': ('swiftpy.core.exceptions', 'ClientDisconnect'),
|
|
239
245
|
'Config': ('swiftpy.core.config', 'Config'),
|
|
@@ -265,6 +271,7 @@ _EXPORT_MAP: dict[str, tuple[str, str]] = {
|
|
|
265
271
|
'LazyLoadingDisabledError': ('swiftpy.database.orm', 'LazyLoadingDisabledError'),
|
|
266
272
|
'LocalStorageDriver': ('swiftpy.filesystem', 'LocalStorageDriver'),
|
|
267
273
|
'Log': ('swiftpy.logging', 'Log'),
|
|
274
|
+
'LoginThrottle': ('swiftpy.auth', 'LoginThrottle'),
|
|
268
275
|
'Mail': ('swiftpy.mail', 'Mail'),
|
|
269
276
|
'MailFake': ('swiftpy.mail', 'MailFake'),
|
|
270
277
|
'MailManager': ('swiftpy.mail', 'MailManager'),
|
|
@@ -315,6 +322,7 @@ _EXPORT_MAP: dict[str, tuple[str, str]] = {
|
|
|
315
322
|
'TestClient': ('swiftpy.testing', 'TestClient'),
|
|
316
323
|
'TestResponse': ('swiftpy.testing', 'TestResponse'),
|
|
317
324
|
'TokenBlacklist': ('swiftpy.auth', 'TokenBlacklist'),
|
|
325
|
+
'TooManyRequestsError': ('swiftpy.core.exceptions', 'TooManyRequestsError'),
|
|
318
326
|
'UnauthorizedError': ('swiftpy.core.exceptions', 'UnauthorizedError'),
|
|
319
327
|
'UniqueRule': ('swiftpy.validation', 'UniqueRule'),
|
|
320
328
|
'UploadedFile': ('swiftpy.filesystem', 'UploadedFile'),
|
|
@@ -441,6 +449,7 @@ __all__ = [
|
|
|
441
449
|
'ApiKeyGuard',
|
|
442
450
|
'Application',
|
|
443
451
|
'Attachment',
|
|
452
|
+
'Auth',
|
|
444
453
|
'AuthManager',
|
|
445
454
|
'AuthUser',
|
|
446
455
|
'BadRequestError',
|
|
@@ -453,6 +462,7 @@ __all__ = [
|
|
|
453
462
|
'Cache',
|
|
454
463
|
'CacheDriver',
|
|
455
464
|
'CacheManager',
|
|
465
|
+
'Callback',
|
|
456
466
|
'CircularDependencyError',
|
|
457
467
|
'ClientDisconnect',
|
|
458
468
|
'Config',
|
|
@@ -484,6 +494,7 @@ __all__ = [
|
|
|
484
494
|
'LazyLoadingDisabledError',
|
|
485
495
|
'LocalStorageDriver',
|
|
486
496
|
'Log',
|
|
497
|
+
'LoginThrottle',
|
|
487
498
|
'Mail',
|
|
488
499
|
'MailFake',
|
|
489
500
|
'MailManager',
|
|
@@ -534,6 +545,7 @@ __all__ = [
|
|
|
534
545
|
'TestClient',
|
|
535
546
|
'TestResponse',
|
|
536
547
|
'TokenBlacklist',
|
|
548
|
+
'TooManyRequestsError',
|
|
537
549
|
'UnauthorizedError',
|
|
538
550
|
'UniqueRule',
|
|
539
551
|
'UploadedFile',
|
|
@@ -9,9 +9,11 @@ from swiftpy.auth.api_key_guard import (
|
|
|
9
9
|
verify_api_key_hash,
|
|
10
10
|
)
|
|
11
11
|
from swiftpy.auth.auth_manager import (
|
|
12
|
+
Auth,
|
|
12
13
|
AuthManager,
|
|
13
14
|
AuthProxy,
|
|
14
15
|
AuthUser,
|
|
16
|
+
Callback,
|
|
15
17
|
CurrentUser,
|
|
16
18
|
auth,
|
|
17
19
|
current_user,
|
|
@@ -19,10 +21,20 @@ from swiftpy.auth.auth_manager import (
|
|
|
19
21
|
resolve_user_model_class,
|
|
20
22
|
set_user_model,
|
|
21
23
|
)
|
|
24
|
+
from swiftpy.auth.events import (
|
|
25
|
+
Attempting,
|
|
26
|
+
Authenticated,
|
|
27
|
+
Failed,
|
|
28
|
+
Lockout,
|
|
29
|
+
Login,
|
|
30
|
+
Logout,
|
|
31
|
+
dispatch_auth_event,
|
|
32
|
+
)
|
|
22
33
|
from swiftpy.auth.exceptions import (
|
|
23
34
|
AuthenticationError,
|
|
24
35
|
InvalidApiKeyError,
|
|
25
36
|
TokenRevokedError,
|
|
37
|
+
TooManyRequestsError,
|
|
26
38
|
)
|
|
27
39
|
from swiftpy.auth.jwt_guard import JWTGuard, require_jwt
|
|
28
40
|
from swiftpy.auth.jwt_issuer import (
|
|
@@ -33,6 +45,7 @@ from swiftpy.auth.jwt_issuer import (
|
|
|
33
45
|
JWTIssuer,
|
|
34
46
|
TokenExpiredError,
|
|
35
47
|
)
|
|
48
|
+
from swiftpy.auth.throttle import LoginThrottle
|
|
36
49
|
from swiftpy.auth.token_blacklist import TokenBlacklist
|
|
37
50
|
from swiftpy.support.hashing import (
|
|
38
51
|
Hash,
|
|
@@ -44,11 +57,16 @@ from swiftpy.support.hashing import (
|
|
|
44
57
|
|
|
45
58
|
__all__ = [
|
|
46
59
|
"ApiKeyGuard",
|
|
60
|
+
"Attempting",
|
|
61
|
+
"Auth",
|
|
47
62
|
"AuthManager",
|
|
48
63
|
"AuthProxy",
|
|
49
64
|
"AuthUser",
|
|
65
|
+
"Authenticated",
|
|
50
66
|
"AuthenticationError",
|
|
67
|
+
"Callback",
|
|
51
68
|
"CurrentUser",
|
|
69
|
+
"Failed",
|
|
52
70
|
"Hash",
|
|
53
71
|
"InvalidAlgorithmError",
|
|
54
72
|
"InvalidApiKeyError",
|
|
@@ -57,12 +75,18 @@ __all__ = [
|
|
|
57
75
|
"JWTError",
|
|
58
76
|
"JWTGuard",
|
|
59
77
|
"JWTIssuer",
|
|
78
|
+
"Lockout",
|
|
79
|
+
"Login",
|
|
80
|
+
"LoginThrottle",
|
|
81
|
+
"Logout",
|
|
60
82
|
"TokenBlacklist",
|
|
61
83
|
"TokenExpiredError",
|
|
62
84
|
"TokenRevokedError",
|
|
85
|
+
"TooManyRequestsError",
|
|
63
86
|
"auth",
|
|
64
87
|
"current_user",
|
|
65
88
|
"current_user_model",
|
|
89
|
+
"dispatch_auth_event",
|
|
66
90
|
"generate_api_key",
|
|
67
91
|
"get_server_pepper",
|
|
68
92
|
"hash_api_key",
|