swiftpy-framework 0.3.0__tar.gz → 0.3.5__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.5}/.env.example +21 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/CHANGELOG.md +53 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/PKG-INFO +25 -5
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/README.md +24 -4
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/models/user.py +2 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/auth.py +17 -0
- swiftpy_framework-0.3.5/config/http.py +42 -0
- swiftpy_framework-0.3.5/config/schedule.py +25 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/database/migrations/2026_01_01_000000_create_users_table.py +1 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-14-installation-quick-start.md +2 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-authentication-and-security.md +93 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-cache-events-and-queues.md +2 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-orm-models-and-relationships.md +24 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-websockets-and-admin.md +1 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-19-cli-and-testing.md +9 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-19-database-schema-and-blueprint.md +1 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-20-request-and-responses.md +9 -0
- swiftpy_framework-0.3.5/documentations/2026-11-22-task-scheduling.md +247 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/pyproject.toml +1 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/__init__.py +24 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/__init__.py +24 -0
- swiftpy_framework-0.3.5/swiftpy/auth/auth_manager.py +1741 -0
- swiftpy_framework-0.3.5/swiftpy/auth/events.py +90 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/exceptions.py +2 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/jwt_guard.py +12 -1
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/jwt_issuer.py +106 -2
- swiftpy_framework-0.3.5/swiftpy/auth/throttle.py +414 -0
- swiftpy_framework-0.3.5/swiftpy/auth/user_context.py +796 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth_manager.py +4 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/cli.py +2 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/new.py +115 -3
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/queue.py +8 -56
- swiftpy_framework-0.3.5/swiftpy/console/commands/schedule.py +227 -0
- swiftpy_framework-0.3.5/swiftpy/console/loader.py +110 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/application.py +152 -14
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/exceptions.py +2 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/blueprint.py +4 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/orm/model.py +358 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/helpers/helper.py +7 -0
- swiftpy_framework-0.3.5/swiftpy/http/client_ip.py +285 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/http/exceptions.py +22 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/http/request.py +127 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/queue/worker.py +233 -4
- swiftpy_framework-0.3.5/swiftpy/scheduling/__init__.py +145 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/_redis_lua.py +1135 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/cron.py +479 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/events.py +86 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/exceptions.py +40 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/jobs.py +97 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/models.py +353 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/scheduler.py +1745 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/signing.py +106 -0
- swiftpy_framework-0.3.5/swiftpy/scheduling/store.py +1563 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/websockets/connection.py +39 -1
- swiftpy_framework-0.3.5/tests/auth/test_auth_attempt.py +863 -0
- swiftpy_framework-0.3.5/tests/auth/test_auth_throttle.py +582 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_refresh_and_logout.py +209 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_new_command.py +19 -2
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_phase9_cli_remediation.py +1 -1
- swiftpy_framework-0.3.5/tests/http/test_client_ip.py +515 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/migrations/test_migrations.py +2 -0
- swiftpy_framework-0.3.5/tests/orm/test_where_has.py +368 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_cron_and_timezone.py +203 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_core.py +595 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_lifecycle_and_cli.py +367 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_queue_integration.py +486 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_recovery_and_failures.py +498 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_redis_store.py +564 -0
- swiftpy_framework-0.3.5/tests/scheduling/test_scheduler_worker_lifecycle.py +587 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/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/console/loader.py +0 -33
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/.dockerignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/.github/workflows/ci.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/.gitignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/Dockerfile +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/LICENSE +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/agents/assistant_agent.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/pipelines/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/providers/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/tools/system_status_tool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/ai/vectorstores/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/controllers/user_controller.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/http/resources/user_resource.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/schemas/user_schema.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/ai.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/app.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/cors.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/database.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/filesystems.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/logging.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/mail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/config/queue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/docker-compose.yml +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-ai-subsystem.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-database-query-builder-and-migrations.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-filesystem-storage-and-mail.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-15-validation-and-form-requests.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-19-application-schemas.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-21-application-architecture-and-project-structure.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/documentations/2026-11-21-cors.md +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/main.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/prompts/classify.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/prompts/summarise.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/red-black.png +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/routes/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/routes/api.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/api_key_guard.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/auth/token_blacklist.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/make.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/agent.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/prompt.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/repository.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/schema.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/console/stubs/tool.stub +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/migrations/schema.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/http/router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/form_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/validation/validator.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_auth_proxy.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/conftest.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/console/test_stubs_and_make.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_helpers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_controller_routing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/typing/test_orm_typing.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_validation_ergonomics.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.3.0 → swiftpy_framework-0.3.5}/views/mail/template.html +0 -0
|
@@ -6,11 +6,12 @@ APP_KEY=
|
|
|
6
6
|
APP_DEBUG=false
|
|
7
7
|
APP_URL=http://localhost:8000
|
|
8
8
|
|
|
9
|
-
# Server (Uvicorn)
|
|
9
|
+
# Server (Uvicorn) & HTTP Proxy Trust
|
|
10
10
|
SERVER_HOST=127.0.0.1
|
|
11
11
|
SERVER_PORT=8000
|
|
12
12
|
SERVER_WORKERS=1
|
|
13
13
|
SERVER_RELOAD=true
|
|
14
|
+
TRUSTED_PROXIES=
|
|
14
15
|
|
|
15
16
|
# Database (PostgreSQL / asyncpg)
|
|
16
17
|
DB_CONNECTION=postgresql
|
|
@@ -48,6 +49,17 @@ QUEUE_DRIVER=redis
|
|
|
48
49
|
QUEUE_PREFIX=swiftpy_queue:
|
|
49
50
|
QUEUE_NAME=default
|
|
50
51
|
|
|
52
|
+
# Task Scheduler
|
|
53
|
+
SCHEDULE_DRIVER=redis
|
|
54
|
+
SCHEDULE_TIMEZONE=UTC
|
|
55
|
+
SCHEDULE_AUTO_START=false
|
|
56
|
+
SCHEDULE_POLL_INTERVAL=1.0
|
|
57
|
+
SCHEDULE_GRACE_SECONDS=60.0
|
|
58
|
+
SCHEDULE_DISPATCH_LEASE_SECONDS=30.0
|
|
59
|
+
SCHEDULE_MAX_DISPATCH_ATTEMPTS=5
|
|
60
|
+
SCHEDULE_DEFAULT_LOCK_TTL=900
|
|
61
|
+
SCHEDULE_PREFIX=swiftpy_schedule:
|
|
62
|
+
|
|
51
63
|
# Filesystems & Storage
|
|
52
64
|
FILESYSTEM_DISK=local
|
|
53
65
|
STORAGE_LOCAL_ROOT=storage/app/private
|
|
@@ -85,6 +97,14 @@ JWT_ALGORITHM=HS256
|
|
|
85
97
|
JWT_ACCESS_TTL=3600
|
|
86
98
|
JWT_REFRESH_TTL=604800
|
|
87
99
|
AUTH_KEY_PEPPER=
|
|
100
|
+
AUTH_REMEMBER_COOKIE=swiftpy_remember
|
|
101
|
+
AUTH_REMEMBER_TTL=2592000
|
|
102
|
+
AUTH_THROTTLE_ENABLED=true
|
|
103
|
+
AUTH_THROTTLE_MAX_ATTEMPTS=5
|
|
104
|
+
AUTH_THROTTLE_DECAY_SECONDS=60
|
|
105
|
+
AUTH_THROTTLE_LOCKOUT_SECONDS=60
|
|
106
|
+
AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS=0
|
|
107
|
+
AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS=3600
|
|
88
108
|
|
|
89
109
|
# CORS (use explicit comma-separated origins; never pair '*' with CORS_ALLOW_CREDENTIALS=true)
|
|
90
110
|
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
|
|
@@ -4,6 +4,59 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.3.5] - 2026-11-23
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Proxy-Aware Client IP Detection (`swiftpy.http.client_ip`, `swiftpy.http.request`, `swiftpy.websockets.connection`, `swiftpy.auth.auth_manager`):**
|
|
11
|
+
- Added pure stateless resolver module `swiftpy.http.client_ip` (`parse_trusted_proxies`, `extract_trusted_proxies_from_config`, `resolve_client_ip`) defaulting `http.trusted_proxies` fail-safely to `[]` via [`config/http.py`](config/http.py) (`TRUSTED_PROXIES`, `HTTP_TRUSTED_PROXIES`).
|
|
12
|
+
- Added dual instance/class descriptor `request.ip()` and `Request.ip()` on `Request`, `WebSocketConnection.ip()`, WebSocket handshake `Request` context binding in `Application`, and unified `Auth` / `LoginThrottle` IP extraction via `req.ip() or "unknown"`.
|
|
13
|
+
- Enforces strict CIDR validation (`strict=True`), IPv4-mapped IPv6 unwrapping (`::ffff:172.30.0.5` -> `172.30.0.5`), right-to-left `X-Forwarded-For` traversal with header/hop bounds (`4096` bytes / `32` hops) and port/zone-ID/hostname rejection, and conservative resolution to direct peer (without consulting `X-Real-IP`) whenever `X-Forwarded-For` is malformed, empty, or all-trusted.
|
|
14
|
+
- **Native Task Scheduler (`swiftpy.scheduling`):**
|
|
15
|
+
- Added zero-dependency strict 5-field Vixie cron + IANA `ZoneInfo` engine (`cron.py`: macros, ranges, steps, lists, named month/weekday aliases, DOM/DOW OR rule, impossible calendar date rejection with `InvalidCronError`, DST spring-forward/fall-back handling with `fold=0` single firing, `UTC` default).
|
|
16
|
+
- Separated persistent `ScheduleRecord` definitions from `ScheduleOccurrence` execution lifecycles (`pending` -> `claimed` -> `dispatch_pending` -> `dispatched` -> `running` -> `completed` | `failed` | `skipped` | `cancelled`).
|
|
17
|
+
- Added fluent `Schedule` facade, `Scheduler` singleton, `scheduler()` helper, and builders (`cron`, `every_minute`, `every(N).seconds()/minutes()/hours()/days()`, `hourly`, `hourly_at`, `daily`, `daily_at`, `weekly`, `weekly_at`, `monthly`, `monthly_at`, `schedule(at=...)`, `delay(seconds=...)`, `@scheduler.task(...)`, `upsert()`, `update()`, `enable()`, `disable()`, `cancel()`, `get()`, `list_schedules()`, `get_occurrence()`).
|
|
18
|
+
- Added durable `RedisScheduleStore` on `REDIS_QUEUE_DB` (`swiftpy_schedule:`) using atomic Lua scripts (`SAVE_SCHEDULE_LUA`, `CLAIM_DUE_LUA`, `RECLAIM_PENDING_LUA`, `CONFIRM_DISPATCHED_LUA`, compare-and-del `RELEASE_OVERLAP_LOCK_LUA`, monotonic state guards, bounded occurrence history + retention TTLs), plus non-durable process-local `MemoryScheduleStore` (`is_durable = False`, production `ConfigurationError` guard unless opted in) and typed `scheduler.*` lifecycle events (`ScheduleRegistered`, `ScheduledTaskDue`, `ScheduledTaskDispatched`, `ScheduledTaskSkipped`, `ScheduledTaskCompleted`, `ScheduledTaskFailed`).
|
|
19
|
+
- Integrated `QueueWorker` (`running` / `completed` / `failed` hooks, retry overlap lock retention, DLQ lock release, standalone worker Redis prefix resolution), `FrameworkServiceProvider` (`schedule.auto_start = False` default, `SCHEDULE_AUTO_START=true`, clean loop cancellation on shutdown), and CLI commands `schedule:list [--app] [--json] [--prefix]`, `schedule:run [--app] [--limit] [--prefix]`, and `schedule:work [--app] [--sleep] [--max-ticks] [--prefix]`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- **Packaging, Configuration & Scaffolding:** Bumped `swiftpy-framework` and `swiftpy new` dependency floor to `0.3.5`, added [`config/http.py`](config/http.py) and [`config/schedule.py`](config/schedule.py), added `SCHEDULE_*` keys to [`.env.example`](.env.example), and updated `swiftpy new` templates accordingly.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **`Application(trusted_proxies="a,b")`:** a comma-separated string passed validation but was stored in config as a single invalid entry, making every `request.ip()` (and therefore `Auth.attempt`) raise `ConfigurationError`. The normalized network list is now stored.
|
|
26
|
+
- **Scheduler wake-up cost:** the scheduler loop no longer lists every schedule per iteration; it reads the earliest due time through the new `ScheduleStore.next_due_at()` (`ZRANGE ... 0 0` on Redis) and backs off instead of spinning when overdue work cannot be claimed.
|
|
27
|
+
- **Overlap lock lifetime:** `without_overlapping()` locks are re-armed to their full `lock_ttl` when the worker starts the job, kept alive by a worker heartbeat while the job runs, and extended across retry backoff delays, so queue wait time or long runs no longer allow overlapping executions. Added `ScheduleStore.extend_overlap_lock()` (token-verified compare-and-pexpire).
|
|
28
|
+
- **Duplicate delivery:** `QueueWorker` acknowledges and skips a scheduled job whose occurrence has already completed. Delivery stays at-least-once; use `job.data["_swiftpy_schedule_occurrence"]` as an idempotency key for non-idempotent work.
|
|
29
|
+
- **Request/Scheduler internals:** `request.ip()` is memoized per request, `_instantiate_job_class` no longer relies on `assert`, and the production `memory` schedule-driver guard is shared through `ensure_memory_driver_allowed()`.
|
|
30
|
+
|
|
31
|
+
### Security
|
|
32
|
+
- **Login throttle (`LoginThrottle`):** IPv6 clients are bucketed by `/64` (IPv4-mapped IPv6 collapses to IPv4) so rotating addresses inside one prefix cannot bypass lockouts; the per-key generation counter now expires (`2 * (lockout_seconds + decay_seconds)`) instead of living forever; added optional identifier-wide cap across all IPs via `auth.throttle.identifier_max_attempts` / `identifier_window_seconds` (`AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS`, `AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS`; disabled by default because it lets an attacker lock a known account for `lockout_seconds`).
|
|
33
|
+
- **Signed schedules:** schedule records now carry an HMAC-SHA256 `signature` (APP_KEY, previous keys accepted) over `task_kind`, `task_name`, `args`, `kwargs`, and `queue`. The signature is copied onto each occurrence and verified before a job is built; tampered or unsigned records (for example rewritten directly in Redis) are marked `failed` with `ScheduleSignatureError` and never pushed. Schedules registered before an `APP_KEY` was configured must be re-registered.
|
|
34
|
+
|
|
35
|
+
### Documentation
|
|
36
|
+
- Added dedicated Task Scheduler user guide [`documentations/2026-11-22-task-scheduling.md`](documentations/2026-11-22-task-scheduling.md) and updated Requests & Responses, WebSockets, Authentication & Security, Cache/Events/Queues, CLI & Testing, Installation Quick Start, [`docs/2026-11-14_documentation_plan.md`](docs/2026-11-14_documentation_plan.md), and [`README.md`](README.md) for `v0.3.5`.
|
|
37
|
+
|
|
38
|
+
## [0.3.1] - 2026-11-22
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- **Credential Authentication Facade (`swiftpy.auth.auth_manager.Auth` & `AuthProxy`):**
|
|
42
|
+
- 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`.
|
|
43
|
+
- 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.
|
|
44
|
+
- 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()`.
|
|
45
|
+
- 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).
|
|
46
|
+
- Added `Request.cookies` and `Request.cookie(name, default=None)` in `swiftpy.http.request`.
|
|
47
|
+
- **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).
|
|
48
|
+
- **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.
|
|
49
|
+
- **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.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
- **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.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **`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(...)`).
|
|
56
|
+
|
|
57
|
+
### Documentation
|
|
58
|
+
- Updated Authentication & Security, Active Record ORM & Relationships, Database Schema & `Blueprint`, Installation Quick Start, and `README.md` for `v0.3.1`.
|
|
59
|
+
|
|
7
60
|
## [0.3.0] - 2026-11-22
|
|
8
61
|
|
|
9
62
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
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,12 +55,12 @@ 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.
|
|
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
|
-
- **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.
|
|
63
|
+
- **At-Least-Once Queues, Task Scheduler & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, proxy-aware client IP resolution (`request.ip()`, `Request.ip()`, `websocket.ip()` behind `TRUSTED_PROXIES`), a native 5-field Vixie cron + `ZoneInfo` task scheduler (`Schedule` / `Scheduler`, crash-recoverable `RedisScheduleStore`, overlap locks, `schedule:work` / `schedule:run` / `schedule:list`), and a cryptographically protected cross-worker event bus.
|
|
64
64
|
- **WebSocket Gateway**: Structured WebSocket connection management, topic subscriptions, broadcast fan-out, ping/pong heartbeats, and strict same-origin handshake validation.
|
|
65
65
|
- **Zero-Config Provider Auto-Discovery**: Automatic service provider discovery in `app/providers/` that registers container dependencies behind the scenes without manual entrypoint registration.
|
|
66
66
|
- **Developer CLI (`swiftpy`)**: Built-in CLI for scaffolding new projects (`new`) and components (`make:*`), running/rolling back/resetting/seeding migrations (`migrate*`, `db:seed`), linking public storage, managing queue workers and failed jobs, precompiling caches, and starting the ASGI server.
|
|
@@ -92,8 +92,10 @@ 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 |
|
|
96
|
+
| **Release v0.3.5: Client IP Detection & Native Task Scheduler** | Fail-safe `request.ip()` / `Request.ip()` / `websocket.ip()` & `LoginThrottle` IP trust via `TRUSTED_PROXIES`, zero-dependency 5-field cron + `ZoneInfo` scheduler (`Schedule` / `Scheduler`), Redis crash recovery (`_CLAIM_DUE_LUA` / `_RECLAIM_PENDING_LUA`), worker overlap locks, `schedule:list`/`run`/`work` | ✅ Completed |
|
|
95
97
|
|
|
96
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md)
|
|
98
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
97
99
|
|
|
98
100
|
---
|
|
99
101
|
|
|
@@ -486,6 +488,11 @@ swiftpy queue:failed --limit 50
|
|
|
486
488
|
swiftpy queue:retry --all
|
|
487
489
|
swiftpy queue:flush
|
|
488
490
|
|
|
491
|
+
# List, trigger once, or run the dedicated task scheduler loop
|
|
492
|
+
swiftpy schedule:list --app main:app
|
|
493
|
+
swiftpy schedule:run --app main:app
|
|
494
|
+
swiftpy schedule:work --app main:app --sleep 1.0
|
|
495
|
+
|
|
489
496
|
# Run, inspect, rollback, reset, and seed database migrations
|
|
490
497
|
swiftpy migrate
|
|
491
498
|
swiftpy migrate:status
|
|
@@ -524,6 +531,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
524
531
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
525
532
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
526
533
|
| `AUTH_KEY_PEPPER` | `auth.guards.api_key.pepper` | `None` | Server pepper for API key HMAC-SHA256 verification (`>= 32` bytes required when non-debug/production). |
|
|
534
|
+
| `AUTH_REMEMBER_COOKIE` | `auth.remember.cookie_name` | `"swiftpy_remember"` | Cookie name for HMAC-signed remember-me persistent authentication tokens. |
|
|
535
|
+
| `AUTH_REMEMBER_TTL` | `auth.remember.ttl` | `2592000` | Remember-me cookie lifetime (`Max-Age`) in seconds (default 30 days). |
|
|
536
|
+
| `AUTH_THROTTLE_ENABLED` | `auth.throttle.enabled` | `True` | Enable default cache-backed login rate limiting in `Auth.attempt()` / `Auth.attempt_when()`. |
|
|
537
|
+
| `AUTH_THROTTLE_MAX_ATTEMPTS` | `auth.throttle.max_attempts` | `5` | Maximum failed login attempts before lockout (`429 TooManyRequestsError`). |
|
|
538
|
+
| `AUTH_THROTTLE_DECAY_SECONDS` | `auth.throttle.decay_seconds` | `60` | Attempt counter window duration in seconds. |
|
|
539
|
+
| `AUTH_THROTTLE_LOCKOUT_SECONDS` | `auth.throttle.lockout_seconds` | `60` | Lockout duration (`Retry-After`) in seconds once `max_attempts` is exceeded. |
|
|
527
540
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
528
541
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
529
542
|
| — | `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. |
|
|
@@ -537,6 +550,10 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
537
550
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of exact allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). See the [CORS Guide](./documentations/2026-11-21-cors.md). |
|
|
538
551
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
539
552
|
| `CORS_MAX_AGE` | `cors.max_age` | `600` | Preflight `OPTIONS` cache duration (`Access-Control-Max-Age`) in seconds. |
|
|
553
|
+
| `TRUSTED_PROXIES` | `http.trusted_proxies` | `[]` | Comma-separated or JSON array of trusted proxy IPs / strict CIDRs for `request.ip()`, `ws.ip()`, and `LoginThrottle`. |
|
|
554
|
+
| `SCHEDULE_DRIVER` | `schedule.driver` | `"redis"` | Scheduler persistence backend (`"redis"` on `REDIS_QUEUE_DB` or non-durable `"memory"`). See the [Task Scheduling Guide](./documentations/2026-11-22-task-scheduling.md). |
|
|
555
|
+
| `SCHEDULE_TIMEZONE` | `schedule.timezone` | `"UTC"` | Default IANA timezone name for scheduled cron/one-time tasks (`fallbacks` to `APP_TIMEZONE` then `"UTC"`). |
|
|
556
|
+
| `SCHEDULE_AUTO_START` | `schedule.auto_start` | `False` | Opt-in in-process scheduler loop during `Application.startup()` (keep `False` when scaling multiple web workers). |
|
|
540
557
|
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
541
558
|
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
542
559
|
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
@@ -631,9 +648,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
631
648
|
│ ├── database.py
|
|
632
649
|
│ ├── events.py
|
|
633
650
|
│ ├── filesystems.py
|
|
651
|
+
│ ├── http.py
|
|
634
652
|
│ ├── logging.py
|
|
635
653
|
│ ├── mail.py
|
|
636
|
-
│
|
|
654
|
+
│ ├── queue.py
|
|
655
|
+
│ └── schedule.py
|
|
637
656
|
├── database/
|
|
638
657
|
│ └── migrations/ # Timestamped database migrations
|
|
639
658
|
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
@@ -652,6 +671,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
652
671
|
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
653
672
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
654
673
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
674
|
+
│ ├── scheduling/ # 5-field cron engine, Redis/Memory stores, Scheduler & builders
|
|
655
675
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
656
676
|
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
657
677
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
@@ -25,12 +25,12 @@ 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.
|
|
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
|
-
- **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.
|
|
33
|
+
- **At-Least-Once Queues, Task Scheduler & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, proxy-aware client IP resolution (`request.ip()`, `Request.ip()`, `websocket.ip()` behind `TRUSTED_PROXIES`), a native 5-field Vixie cron + `ZoneInfo` task scheduler (`Schedule` / `Scheduler`, crash-recoverable `RedisScheduleStore`, overlap locks, `schedule:work` / `schedule:run` / `schedule:list`), and a cryptographically protected cross-worker event bus.
|
|
34
34
|
- **WebSocket Gateway**: Structured WebSocket connection management, topic subscriptions, broadcast fan-out, ping/pong heartbeats, and strict same-origin handshake validation.
|
|
35
35
|
- **Zero-Config Provider Auto-Discovery**: Automatic service provider discovery in `app/providers/` that registers container dependencies behind the scenes without manual entrypoint registration.
|
|
36
36
|
- **Developer CLI (`swiftpy`)**: Built-in CLI for scaffolding new projects (`new`) and components (`make:*`), running/rolling back/resetting/seeding migrations (`migrate*`, `db:seed`), linking public storage, managing queue workers and failed jobs, precompiling caches, and starting the ASGI server.
|
|
@@ -62,8 +62,10 @@ 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 |
|
|
66
|
+
| **Release v0.3.5: Client IP Detection & Native Task Scheduler** | Fail-safe `request.ip()` / `Request.ip()` / `websocket.ip()` & `LoginThrottle` IP trust via `TRUSTED_PROXIES`, zero-dependency 5-field cron + `ZoneInfo` scheduler (`Schedule` / `Scheduler`), Redis crash recovery (`_CLAIM_DUE_LUA` / `_RECLAIM_PENDING_LUA`), worker overlap locks, `schedule:list`/`run`/`work` | ✅ Completed |
|
|
65
67
|
|
|
66
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md)
|
|
68
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
67
69
|
|
|
68
70
|
---
|
|
69
71
|
|
|
@@ -456,6 +458,11 @@ swiftpy queue:failed --limit 50
|
|
|
456
458
|
swiftpy queue:retry --all
|
|
457
459
|
swiftpy queue:flush
|
|
458
460
|
|
|
461
|
+
# List, trigger once, or run the dedicated task scheduler loop
|
|
462
|
+
swiftpy schedule:list --app main:app
|
|
463
|
+
swiftpy schedule:run --app main:app
|
|
464
|
+
swiftpy schedule:work --app main:app --sleep 1.0
|
|
465
|
+
|
|
459
466
|
# Run, inspect, rollback, reset, and seed database migrations
|
|
460
467
|
swiftpy migrate
|
|
461
468
|
swiftpy migrate:status
|
|
@@ -494,6 +501,12 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
494
501
|
| `APP_KEY` | `app.key` | `""` | Primary `>= 32`-byte application secret key for HMAC queue/event-bus signing and signed local URLs. |
|
|
495
502
|
| `JWT_SECRET` | `auth.guards.jwt.secret` | `None` | Secret key for JWT HS256 signing (`>= 32` bytes required when non-debug/production). |
|
|
496
503
|
| `AUTH_KEY_PEPPER` | `auth.guards.api_key.pepper` | `None` | Server pepper for API key HMAC-SHA256 verification (`>= 32` bytes required when non-debug/production). |
|
|
504
|
+
| `AUTH_REMEMBER_COOKIE` | `auth.remember.cookie_name` | `"swiftpy_remember"` | Cookie name for HMAC-signed remember-me persistent authentication tokens. |
|
|
505
|
+
| `AUTH_REMEMBER_TTL` | `auth.remember.ttl` | `2592000` | Remember-me cookie lifetime (`Max-Age`) in seconds (default 30 days). |
|
|
506
|
+
| `AUTH_THROTTLE_ENABLED` | `auth.throttle.enabled` | `True` | Enable default cache-backed login rate limiting in `Auth.attempt()` / `Auth.attempt_when()`. |
|
|
507
|
+
| `AUTH_THROTTLE_MAX_ATTEMPTS` | `auth.throttle.max_attempts` | `5` | Maximum failed login attempts before lockout (`429 TooManyRequestsError`). |
|
|
508
|
+
| `AUTH_THROTTLE_DECAY_SECONDS` | `auth.throttle.decay_seconds` | `60` | Attempt counter window duration in seconds. |
|
|
509
|
+
| `AUTH_THROTTLE_LOCKOUT_SECONDS` | `auth.throttle.lockout_seconds` | `60` | Lockout duration (`Retry-After`) in seconds once `max_attempts` is exceeded. |
|
|
497
510
|
| `FILESYSTEM_DISK` | `filesystems.default` | `"local"` | Default disk driver (`"local"`, `"public"`, `"s3"`). |
|
|
498
511
|
| `MAIL_MAILER` | `mail.default` | `"smtp"` | Default mail transport (`"smtp"`, `"sendmail"`, `"resend"`, `"sendgrid"`, `"mailgun"`, `"console"`, `"array"`). Templates resolve under `views/`. |
|
|
499
512
|
| — | `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. |
|
|
@@ -507,6 +520,10 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
507
520
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of exact allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). See the [CORS Guide](./documentations/2026-11-21-cors.md). |
|
|
508
521
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
509
522
|
| `CORS_MAX_AGE` | `cors.max_age` | `600` | Preflight `OPTIONS` cache duration (`Access-Control-Max-Age`) in seconds. |
|
|
523
|
+
| `TRUSTED_PROXIES` | `http.trusted_proxies` | `[]` | Comma-separated or JSON array of trusted proxy IPs / strict CIDRs for `request.ip()`, `ws.ip()`, and `LoginThrottle`. |
|
|
524
|
+
| `SCHEDULE_DRIVER` | `schedule.driver` | `"redis"` | Scheduler persistence backend (`"redis"` on `REDIS_QUEUE_DB` or non-durable `"memory"`). See the [Task Scheduling Guide](./documentations/2026-11-22-task-scheduling.md). |
|
|
525
|
+
| `SCHEDULE_TIMEZONE` | `schedule.timezone` | `"UTC"` | Default IANA timezone name for scheduled cron/one-time tasks (`fallbacks` to `APP_TIMEZONE` then `"UTC"`). |
|
|
526
|
+
| `SCHEDULE_AUTO_START` | `schedule.auto_start` | `False` | Opt-in in-process scheduler loop during `Application.startup()` (keep `False` when scaling multiple web workers). |
|
|
510
527
|
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
511
528
|
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
512
529
|
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
@@ -601,9 +618,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
601
618
|
│ ├── database.py
|
|
602
619
|
│ ├── events.py
|
|
603
620
|
│ ├── filesystems.py
|
|
621
|
+
│ ├── http.py
|
|
604
622
|
│ ├── logging.py
|
|
605
623
|
│ ├── mail.py
|
|
606
|
-
│
|
|
624
|
+
│ ├── queue.py
|
|
625
|
+
│ └── schedule.py
|
|
607
626
|
├── database/
|
|
608
627
|
│ └── migrations/ # Timestamped database migrations
|
|
609
628
|
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
@@ -622,6 +641,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
622
641
|
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
623
642
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
624
643
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
644
|
+
│ ├── scheduling/ # 5-field cron engine, Redis/Memory stores, Scheduler & builders
|
|
625
645
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
626
646
|
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
627
647
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
@@ -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,23 @@ 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
|
+
"identifier_max_attempts": int(
|
|
23
|
+
env("AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS", "0")
|
|
24
|
+
),
|
|
25
|
+
"identifier_window_seconds": int(
|
|
26
|
+
env("AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS", "3600")
|
|
27
|
+
),
|
|
28
|
+
"prefix": env("AUTH_THROTTLE_PREFIX", "auth:throttle"),
|
|
29
|
+
},
|
|
13
30
|
"guards": {
|
|
14
31
|
"jwt": {
|
|
15
32
|
"driver": "jwt",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.helpers.helper import env
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _parse_proxy_env(raw: Any) -> Any:
|
|
10
|
+
if isinstance(raw, list):
|
|
11
|
+
return raw
|
|
12
|
+
if not isinstance(raw, str):
|
|
13
|
+
return raw
|
|
14
|
+
stripped = raw.strip()
|
|
15
|
+
if not stripped:
|
|
16
|
+
return []
|
|
17
|
+
if stripped.startswith("[") and stripped.endswith("]"):
|
|
18
|
+
try:
|
|
19
|
+
parsed = json.loads(stripped)
|
|
20
|
+
except (json.JSONDecodeError, ValueError):
|
|
21
|
+
return [stripped]
|
|
22
|
+
if isinstance(parsed, list):
|
|
23
|
+
return parsed
|
|
24
|
+
return parsed
|
|
25
|
+
return [entry.strip() for entry in stripped.split(",")]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_RAW_TRUSTED_PROXIES = env("TRUSTED_PROXIES", env("HTTP_TRUSTED_PROXIES", "")) or ""
|
|
29
|
+
_RAW_MAX_CONTENT_LENGTH = env("HTTP_MAX_CONTENT_LENGTH", None)
|
|
30
|
+
|
|
31
|
+
CONFIG: dict[str, Any] = {
|
|
32
|
+
"trusted_proxies": _parse_proxy_env(_RAW_TRUSTED_PROXIES),
|
|
33
|
+
"max_body_size": int(
|
|
34
|
+
env("HTTP_MAX_BODY_SIZE", str(2 * 1024 * 1024)) or (2 * 1024 * 1024)
|
|
35
|
+
),
|
|
36
|
+
"max_content_length": (
|
|
37
|
+
int(_RAW_MAX_CONTENT_LENGTH)
|
|
38
|
+
if _RAW_MAX_CONTENT_LENGTH not in (None, "")
|
|
39
|
+
else None
|
|
40
|
+
),
|
|
41
|
+
"max_json_depth": int(env("HTTP_MAX_JSON_DEPTH", "32") or "32"),
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from swiftpy.helpers.helper import env, env_bool
|
|
4
|
+
|
|
5
|
+
CONFIG: dict[str, object] = {
|
|
6
|
+
"driver": env("SCHEDULE_DRIVER", "redis"),
|
|
7
|
+
"timezone": env("SCHEDULE_TIMEZONE", env("APP_TIMEZONE", "UTC")),
|
|
8
|
+
"auto_start": env_bool("SCHEDULE_AUTO_START", False),
|
|
9
|
+
"poll_interval": float(env("SCHEDULE_POLL_INTERVAL", "1.0") or "1.0"),
|
|
10
|
+
"grace_seconds": float(env("SCHEDULE_GRACE_SECONDS", "60.0") or "60.0"),
|
|
11
|
+
"dispatch_lease_seconds": float(
|
|
12
|
+
env("SCHEDULE_DISPATCH_LEASE_SECONDS", "30.0") or "30.0"
|
|
13
|
+
),
|
|
14
|
+
"max_dispatch_attempts": int(
|
|
15
|
+
env("SCHEDULE_MAX_DISPATCH_ATTEMPTS", "5") or "5"
|
|
16
|
+
),
|
|
17
|
+
"default_lock_ttl": int(env("SCHEDULE_DEFAULT_LOCK_TTL", "900") or "900"),
|
|
18
|
+
"prefix": env("SCHEDULE_PREFIX", "swiftpy_schedule:"),
|
|
19
|
+
"retention_seconds": int(
|
|
20
|
+
env("SCHEDULE_RETENTION_SECONDS", str(7 * 24 * 3600)) or str(7 * 24 * 3600)
|
|
21
|
+
),
|
|
22
|
+
"max_occurrences_per_schedule": int(
|
|
23
|
+
env("SCHEDULE_MAX_OCCURRENCES", "200") or "200"
|
|
24
|
+
),
|
|
25
|
+
}
|
|
@@ -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.5",
|
|
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`). Keys rate-limit counters and `Failed` / `Lockout` event client IPs through `request.ip()` so verified `X-Forwarded-For` client IPs work cleanly behind `TRUSTED_PROXIES` while forged forwarding headers from untrusted peers are ignored. 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`. IPv6 clients share one bucket per `/64` prefix (IPv4-mapped IPv6 uses the IPv4 bucket), so rotating addresses inside a prefix does not reset the counter. Optionally set `AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS` (> 0, default `0` = off) to also cap failures per identifier across all IPs within `AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS` (default `3600`); when the cap is hit every IP is locked out for `lockout_seconds`, which also lets an attacker who knows an identifier lock that account out temporarily. `Auth.attempt(..., ip=...)` trusts the supplied `ip` as-is, so never pass a raw request header value.
|
|
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).
|
|
@@ -296,6 +296,8 @@ swiftpy queue:retry all --queue emails --app main:app
|
|
|
296
296
|
swiftpy queue:flush --queue emails --app main:app
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
+
When `QueueWorker` executes tasks submitted by the [Task Scheduler](2026-11-22-task-scheduling.md), it automatically records `running`, `completed`, and `failed` occurrence transitions in Redis, retains `.without_overlapping()` locks across intermediate backoff retries, and releases locks via compare-and-delete Lua upon `ack()` or final DLQ exhaustion.
|
|
300
|
+
|
|
299
301
|
---
|
|
300
302
|
|
|
301
303
|
## Important Defaults & Production Safeguards
|
|
@@ -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`):
|