tina4-python 3.13.154__tar.gz → 3.13.156__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.
- {tina4_python-3.13.154 → tina4_python-3.13.156}/PKG-INFO +1 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/pyproject.toml +1 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/.tina4-metrics.json +8 -8
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/__init__.py +1 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/cli/__init__.py +23 -18
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/middleware.py +18 -8
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/router.py +17 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/server.py +17 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/migration/runner.py +30 -20
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/__init__.py +18 -5
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/kafka_backend.py +8 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/lite_backend.py +12 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/mongo_backend.py +12 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/rabbitmq_backend.py +12 -1
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue_backends/kafka_backend.py +31 -5
- {tina4_python-3.13.154 → tina4_python-3.13.156}/.gitignore +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/COMMERCIAL-LICENSE.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/LICENSE +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/NOTICE +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/README.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/CLAUDE.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/Testing.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/_import_helper.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/ai/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/ai/client.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/api/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/auth/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/cache/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/container/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/context/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/context/chunker.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/cache.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/constants.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/csp.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/events.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/port_takeover.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/rate_limiter.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/request.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/core/response.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/crud/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/crud/page.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/crud/page_render.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/adapter.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/async_api.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/connection.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/database_url.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/firebird.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/mongodb.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/mssql.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/mysql.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/odbc.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/pool.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/postgres.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/sql_translator.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/database/sqlite.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/debug/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/debug/error_overlay.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/dev_admin/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/dev_admin/metrics.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/dev_admin/plan.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/dev_admin/project_index.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/docs.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/docstore/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/dotenv/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/env.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/frond/FROND.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/frond/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/frond/compiler.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/frond/engine.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/frond/parser.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/auth/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/database/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/error-overlay/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/orm/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/queue/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/rest-api/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/templates/meta.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/adapter.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/adapters/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/adapters/arango.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/adapters/bolt.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/adapters/ultipa.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graph/graph_url.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/graphql/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/i18n/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/mcp/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/mcp/protocol.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/mcp/tools.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/messenger/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/migration/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/mqtt/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/mqtt/message.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/async_api.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/collection.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/fields.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/model.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/orm/point.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/THIRD-PARTY-NOTICES.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/__feedback/widget.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/bundled-component-provenance.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/css/tina4.css +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/css/tina4.min.css +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/images/logo.svg +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/frond.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/frond.min.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/tina4-dev-admin-split.html +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/tina4.min.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/js/tina4js.min.js +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/swagger-ui-3.10.0-original-notice.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/swagger-ui-5.17.14-NOTICE.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/swagger-ui-Apache-2.0.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/tina4-css-MIT.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/tina4-dev-admin-components.json +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/tina4-dev-admin-third-party.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/licenses/tina4-js-MIT.txt +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/push/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/push/_base.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/push/_cryptography.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/push/_libcrypto.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/query_builder/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/amqp_url.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/job.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue/topic_dead_letter.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue_backends/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue_backends/mongo_backend.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/Attachment.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/Channel.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/ChannelMember.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/Message.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/Workspace.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/models/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/s3_client.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/realtime/storage.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/seeder/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/service/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session_handlers/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session_handlers/memcached_handler.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session_handlers/mongodb_handler.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session_handlers/redis_handler.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/session_handlers/valkey_handler.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/sso.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/ssrf.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/swagger/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/crud/form.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/crud/modals.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/crud/page.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/crud/table.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/docker/python/Dockerfile +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/docker/uv/Dockerfile +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/302.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/401.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/502.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/503.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/errors/base.twig +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/frontend/README.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/templates/readme.md +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/test/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/test_client/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/validator/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/websocket/__init__.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/websocket/backplane.py +0 -0
- {tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/wsdl/__init__.py +0 -0
|
@@ -1868,14 +1868,14 @@
|
|
|
1868
1868
|
"duplicate_lines": 0
|
|
1869
1869
|
},
|
|
1870
1870
|
"queue_backends/kafka_backend.py": {
|
|
1871
|
-
"offenders":
|
|
1871
|
+
"offenders": 4,
|
|
1872
1872
|
"worst_cc": 13,
|
|
1873
|
-
"maintainability": 12.
|
|
1874
|
-
"loc":
|
|
1875
|
-
"complexity":
|
|
1876
|
-
"avg_complexity": 3.
|
|
1877
|
-
"functions":
|
|
1878
|
-
"halstead_volume":
|
|
1873
|
+
"maintainability": 12.4,
|
|
1874
|
+
"loc": 523,
|
|
1875
|
+
"complexity": 111,
|
|
1876
|
+
"avg_complexity": 3.26,
|
|
1877
|
+
"functions": 34,
|
|
1878
|
+
"halstead_volume": 9657.57,
|
|
1879
1879
|
"has_referencing_test": true,
|
|
1880
1880
|
"dep_count": 8,
|
|
1881
1881
|
"coupling_efferent": 0,
|
|
@@ -35785,4 +35785,4 @@
|
|
|
35785
35785
|
}
|
|
35786
35786
|
}
|
|
35787
35787
|
]
|
|
35788
|
-
}
|
|
35788
|
+
}
|
|
@@ -1397,8 +1397,8 @@ def _next_steps_for(target: str, name: str, resolution: dict, flags: dict) -> li
|
|
|
1397
1397
|
if target == "migration":
|
|
1398
1398
|
return [
|
|
1399
1399
|
"Apply it: tina4 migrate",
|
|
1400
|
-
"Roll back last batch: tina4 migrate
|
|
1401
|
-
"Inspect the pending: tina4 migrate
|
|
1400
|
+
"Roll back last batch: tina4 migrate:rollback",
|
|
1401
|
+
"Inspect the pending: tina4 migrate:status",
|
|
1402
1402
|
]
|
|
1403
1403
|
|
|
1404
1404
|
if target == "middleware":
|
|
@@ -1914,7 +1914,7 @@ def _gen_route(name: str, flags: dict, *, emit_test: bool = True):
|
|
|
1914
1914
|
@description("List all {route_path}")
|
|
1915
1915
|
@tags(["{route_path}"])
|
|
1916
1916
|
@get("/api/{route_path}")
|
|
1917
|
-
|
|
1917
|
+
def list_{route_path}(request, response):
|
|
1918
1918
|
"""List all {route_path} with pagination."""
|
|
1919
1919
|
page = int(request.query.get("page", 1))
|
|
1920
1920
|
per_page = int(request.query.get("per_page", 20))
|
|
@@ -1928,7 +1928,7 @@ async def list_{route_path}(request, response):
|
|
|
1928
1928
|
@description("Get a {singular} by ID")
|
|
1929
1929
|
@tags(["{route_path}"])
|
|
1930
1930
|
@get("/api/{route_path}/{{id:int}}")
|
|
1931
|
-
|
|
1931
|
+
def get_{singular}(request, response):
|
|
1932
1932
|
"""Get a single {singular} by ID."""
|
|
1933
1933
|
{singular} = {model}.find_by_id(request.params["id"])
|
|
1934
1934
|
if {singular} is None:
|
|
@@ -1939,7 +1939,7 @@ async def get_{singular}(request, response):
|
|
|
1939
1939
|
{w}@description("Create a new {singular}")
|
|
1940
1940
|
@tags(["{route_path}"])
|
|
1941
1941
|
@post("/api/{route_path}")
|
|
1942
|
-
|
|
1942
|
+
def create_{singular}(request, response):
|
|
1943
1943
|
"""Create a new {singular}. {write_doc}"""
|
|
1944
1944
|
{ext_create} item = {model}.create(request.body)
|
|
1945
1945
|
if item is False:
|
|
@@ -1950,7 +1950,7 @@ async def create_{singular}(request, response):
|
|
|
1950
1950
|
{w}@description("Update a {singular}")
|
|
1951
1951
|
@tags(["{route_path}"])
|
|
1952
1952
|
@put("/api/{route_path}/{{id:int}}")
|
|
1953
|
-
|
|
1953
|
+
def update_{singular}(request, response):
|
|
1954
1954
|
"""Update a {singular} by ID. {write_doc}"""
|
|
1955
1955
|
item = {model}.find_by_id(request.params["id"])
|
|
1956
1956
|
if item is None:
|
|
@@ -1966,7 +1966,7 @@ async def update_{singular}(request, response):
|
|
|
1966
1966
|
{w}@description("Delete a {singular}")
|
|
1967
1967
|
@tags(["{route_path}"])
|
|
1968
1968
|
@delete("/api/{route_path}/{{id:int}}")
|
|
1969
|
-
|
|
1969
|
+
def delete_{singular}(request, response):
|
|
1970
1970
|
"""Delete a {singular} by ID. {write_doc}"""
|
|
1971
1971
|
item = {model}.find_by_id(request.params["id"])
|
|
1972
1972
|
if item is None:
|
|
@@ -2027,35 +2027,35 @@ async def delete_{singular}(request, response):
|
|
|
2027
2027
|
@description("List all {route_path}")
|
|
2028
2028
|
@tags(["{route_path}"])
|
|
2029
2029
|
@get("/api/{route_path}")
|
|
2030
|
-
|
|
2030
|
+
def list_{route_path}(request, response):
|
|
2031
2031
|
"""List all {route_path}."""
|
|
2032
2032
|
{b_list}
|
|
2033
2033
|
|
|
2034
2034
|
@description("Get a {singular} by ID")
|
|
2035
2035
|
@tags(["{route_path}"])
|
|
2036
2036
|
@get("/api/{route_path}/{{id:int}}")
|
|
2037
|
-
|
|
2037
|
+
def get_{singular}(request, response):
|
|
2038
2038
|
"""Get a single {singular}."""
|
|
2039
2039
|
{b_get}
|
|
2040
2040
|
|
|
2041
2041
|
{w}@description("Create a new {singular}")
|
|
2042
2042
|
@tags(["{route_path}"])
|
|
2043
2043
|
@post("/api/{route_path}")
|
|
2044
|
-
|
|
2044
|
+
def create_{singular}(request, response):
|
|
2045
2045
|
"""Create a new {singular}. {write_doc}"""
|
|
2046
2046
|
{b_create}
|
|
2047
2047
|
|
|
2048
2048
|
{w}@description("Update a {singular}")
|
|
2049
2049
|
@tags(["{route_path}"])
|
|
2050
2050
|
@put("/api/{route_path}/{{id:int}}")
|
|
2051
|
-
|
|
2051
|
+
def update_{singular}(request, response):
|
|
2052
2052
|
"""Update a {singular}. {write_doc}"""
|
|
2053
2053
|
{b_update}
|
|
2054
2054
|
|
|
2055
2055
|
{w}@description("Delete a {singular}")
|
|
2056
2056
|
@tags(["{route_path}"])
|
|
2057
2057
|
@delete("/api/{route_path}/{{id:int}}")
|
|
2058
|
-
|
|
2058
|
+
def delete_{singular}(request, response):
|
|
2059
2059
|
"""Delete a {singular}. {write_doc}"""
|
|
2060
2060
|
{b_delete}'''
|
|
2061
2061
|
|
|
@@ -2156,7 +2156,7 @@ def _gen_crud_admin_route(model: str, table: str, is_public: bool):
|
|
|
2156
2156
|
+ f"# Restyle the UI by editing src/templates/crud/*.twig (copied into this app).\n"
|
|
2157
2157
|
+ f"AutoCrud.register({model}, public={is_public})\n\n\n"
|
|
2158
2158
|
+ f"{decorator}\n"
|
|
2159
|
-
+ f"
|
|
2159
|
+
+ f"def {table}_admin(request, response):\n"
|
|
2160
2160
|
+ f' return response(Crud.to_crud(request, model={model}, title="{model} Admin"))\n'
|
|
2161
2161
|
)
|
|
2162
2162
|
path.write_text(content, encoding="utf-8")
|
|
@@ -2375,7 +2375,7 @@ def _gen_test(name: str, flags: dict = None):
|
|
|
2375
2375
|
'"""\n'
|
|
2376
2376
|
"import os\n"
|
|
2377
2377
|
"\n"
|
|
2378
|
-
'os.environ.setdefault("TINA4_SECRET", "
|
|
2378
|
+
'os.environ.setdefault("TINA4_SECRET", "__SECRET__")\n'
|
|
2379
2379
|
'os.environ.pop("TINA4_API_KEY", None)\n'
|
|
2380
2380
|
"\n"
|
|
2381
2381
|
"from tina4_python.auth import get_token\n"
|
|
@@ -2414,6 +2414,9 @@ def _gen_test(name: str, flags: dict = None):
|
|
|
2414
2414
|
.replace("__MODEL__", model)
|
|
2415
2415
|
.replace("__SINGULAR__", singular_)
|
|
2416
2416
|
.replace("__SNAKE__", snake)
|
|
2417
|
+
# A >=32-byte secret baked at generation time, like init writes to .env.
|
|
2418
|
+
# "test-secret" (11 bytes) tripped auth's InsecureSecretError (tina4-python#259).
|
|
2419
|
+
.replace("__SECRET__", secrets.token_hex(32))
|
|
2417
2420
|
)
|
|
2418
2421
|
_write_test(snake, content)
|
|
2419
2422
|
return
|
|
@@ -2876,7 +2879,9 @@ def _emit_auth_test() -> None:
|
|
|
2876
2879
|
'"""\n'
|
|
2877
2880
|
"import os\n"
|
|
2878
2881
|
"\n"
|
|
2879
|
-
|
|
2882
|
+
# A >=32-byte secret baked at generation time; "test-secret" (11 bytes)
|
|
2883
|
+
# tripped auth's InsecureSecretError on a fresh app (tina4-python#259).
|
|
2884
|
+
f'os.environ.setdefault("TINA4_SECRET", "{secrets.token_hex(32)}")\n'
|
|
2880
2885
|
'os.environ.pop("TINA4_API_KEY", None)\n'
|
|
2881
2886
|
"\n"
|
|
2882
2887
|
"from tina4_python.database import Database\n"
|
|
@@ -3700,7 +3705,7 @@ def _gen_auth(name: str = None, flags: dict = None):
|
|
|
3700
3705
|
'@description("Register a new user")\n'
|
|
3701
3706
|
'@tags(["auth"])\n'
|
|
3702
3707
|
'@post("/api/auth/register")\n'
|
|
3703
|
-
'
|
|
3708
|
+
'def register(request, response):\n'
|
|
3704
3709
|
' """Register a new user."""\n'
|
|
3705
3710
|
' body = request.body\n'
|
|
3706
3711
|
' email = body.get("email", "")\n'
|
|
@@ -3723,7 +3728,7 @@ def _gen_auth(name: str = None, flags: dict = None):
|
|
|
3723
3728
|
'@description("Login and receive JWT token")\n'
|
|
3724
3729
|
'@tags(["auth"])\n'
|
|
3725
3730
|
'@post("/api/auth/login")\n'
|
|
3726
|
-
'
|
|
3731
|
+
'def login(request, response):\n'
|
|
3727
3732
|
' """Login with email and password."""\n'
|
|
3728
3733
|
' body = request.body\n'
|
|
3729
3734
|
' email = body.get("email", "")\n'
|
|
@@ -3738,7 +3743,7 @@ def _gen_auth(name: str = None, flags: dict = None):
|
|
|
3738
3743
|
'@description("Get current user profile")\n'
|
|
3739
3744
|
'@tags(["auth"])\n'
|
|
3740
3745
|
'@get("/api/auth/me")\n'
|
|
3741
|
-
'
|
|
3746
|
+
'def me(request, response):\n'
|
|
3742
3747
|
' """Get current authenticated user."""\n'
|
|
3743
3748
|
' auth_header = request.headers.get("authorization", "")\n'
|
|
3744
3749
|
' token = auth_header[7:] if auth_header.startswith("Bearer ") else ""\n'
|
|
@@ -669,15 +669,18 @@ class SecurityHeadersMiddleware:
|
|
|
669
669
|
class CsrfMiddleware:
|
|
670
670
|
"""CSRF token validation middleware.
|
|
671
671
|
|
|
672
|
-
|
|
673
|
-
environment and the framework auto-attaches this middleware at boot
|
|
674
|
-
``attach_csrf_from_env``); or register it explicitly via
|
|
675
|
-
``Router.use(CsrfMiddleware)``. Once attached
|
|
676
|
-
``0``/``no``) is
|
|
672
|
+
Not attached by default. Set ``TINA4_CSRF=true`` (or ``1``/``yes``/``on``)
|
|
673
|
+
in the environment and the framework auto-attaches this middleware at boot
|
|
674
|
+
(see ``attach_csrf_from_env``); or register it explicitly via
|
|
675
|
+
``Router.use(CsrfMiddleware)``. Once attached it enforces unless the kill
|
|
676
|
+
switch ``TINA4_CSRF=false`` (or ``0``/``no``) is set — so with the middleware
|
|
677
|
+
attached but ``TINA4_CSRF`` unset, enforcement is ON (the attach is the opt-in).
|
|
677
678
|
|
|
678
679
|
Behaviour:
|
|
679
680
|
- Skips GET, HEAD, OPTIONS requests.
|
|
680
|
-
- Skips routes
|
|
681
|
+
- Skips routes that opt out with @no_csrf() (server-to-server webhooks).
|
|
682
|
+
@noauth() does NOT skip CSRF (#265): a public form can be open to
|
|
683
|
+
anonymous visitors AND still be protected against cross-site posts.
|
|
681
684
|
- Fails CLOSED: with TINA4_SECRET unset the signing secret resolves to
|
|
682
685
|
blank (there is NO built-in default), and a blank HMAC key is
|
|
683
686
|
publicly reproducible — so no token can be trusted and every write is
|
|
@@ -710,9 +713,16 @@ class CsrfMiddleware:
|
|
|
710
713
|
if method in ("GET", "HEAD", "OPTIONS"):
|
|
711
714
|
return request, response
|
|
712
715
|
|
|
713
|
-
# Skip routes
|
|
716
|
+
# Skip routes that explicitly opt OUT of CSRF with @no_csrf() — the
|
|
717
|
+
# escape hatch for server-to-server endpoints (webhooks, callbacks) that
|
|
718
|
+
# carry no browser session and so have no cross-site-forgery surface.
|
|
719
|
+
# @noauth() no longer skips CSRF (#265): a PUBLIC form must be able to be
|
|
720
|
+
# both open to anonymous visitors AND protected against cross-site posts,
|
|
721
|
+
# so a form token is still validated on an anonymous write route. @noauth
|
|
722
|
+
# controls IDENTITY (who), CSRF controls ORIGIN (did our own form send
|
|
723
|
+
# it) — they are orthogonal, and a webhook opts out of CSRF explicitly.
|
|
714
724
|
handler = getattr(request, "_handler", None)
|
|
715
|
-
if handler and getattr(handler, "
|
|
725
|
+
if handler and getattr(handler, "_no_csrf", False):
|
|
716
726
|
return request, response
|
|
717
727
|
|
|
718
728
|
# Resolve the signing secret ONCE, fail-closed (blank when TINA4_SECRET
|
|
@@ -897,6 +897,23 @@ def secured():
|
|
|
897
897
|
return decorator
|
|
898
898
|
|
|
899
899
|
|
|
900
|
+
def no_csrf():
|
|
901
|
+
"""Opt a route out of CSRF form-token validation.
|
|
902
|
+
|
|
903
|
+
For server-to-server endpoints — webhooks, payment callbacks, API clients
|
|
904
|
+
that already authenticate with a Bearer token — which carry no browser
|
|
905
|
+
session and so have no cross-site-request-forgery surface. Without this a
|
|
906
|
+
public ``@noauth()`` write route is still CSRF-checked when ``TINA4_CSRF`` is
|
|
907
|
+
enabled (#265), which is correct for a browser form but wrong for a webhook.
|
|
908
|
+
CSRF (origin) and auth (identity) are orthogonal: pair ``@no_csrf()`` with
|
|
909
|
+
``@noauth()`` for a public webhook, or use it alone on an authenticated one.
|
|
910
|
+
"""
|
|
911
|
+
def decorator(fn):
|
|
912
|
+
fn._no_csrf = True
|
|
913
|
+
return fn
|
|
914
|
+
return decorator
|
|
915
|
+
|
|
916
|
+
|
|
900
917
|
# ── RBAC guards (Feature 138 / ADR-0058) ──────────────────────
|
|
901
918
|
# Claim-first authorization on top of the JWT auth gate. @role reads the verified
|
|
902
919
|
# `roles` claim, @can reads `permissions`. Multiple args are OR; stack guards for
|
|
@@ -4172,8 +4172,13 @@ def _auto_migrate_on_startup(migration_folder: str = "migrations") -> None:
|
|
|
4172
4172
|
from pathlib import Path
|
|
4173
4173
|
from tina4_python.dotenv import is_truthy
|
|
4174
4174
|
|
|
4175
|
+
from tina4_python.migration.runner import _migration_source_files
|
|
4176
|
+
|
|
4175
4177
|
folder = Path(migration_folder)
|
|
4176
|
-
|
|
4178
|
+
# Both .sql AND .py migrations count — the runner applies both, so a .py-only
|
|
4179
|
+
# migrations folder must still trigger startup auto-migration (#268). Reuse
|
|
4180
|
+
# the one discovery helper so this gate and the runner never disagree.
|
|
4181
|
+
if not folder.is_dir() or not _migration_source_files(folder):
|
|
4177
4182
|
return # no migrations → nothing to do (silent)
|
|
4178
4183
|
if not is_truthy(os.environ.get("TINA4_AUTO_MIGRATE", "true")):
|
|
4179
4184
|
Log.debug("TINA4_AUTO_MIGRATE is off — skipping startup migrations")
|
|
@@ -4416,6 +4421,17 @@ def run(host: str | None = None, port: int | None = None, no_browser: bool = Fal
|
|
|
4416
4421
|
# Determine AI dev port (port+1) when debug is on and not suppressed
|
|
4417
4422
|
_no_ai_port = os.environ.get("TINA4_NO_AI_PORT", "").lower() in ("true", "1", "yes")
|
|
4418
4423
|
_ai_port = (port + 1000) if (is_debug and not _no_ai_port) else None
|
|
4424
|
+
# The test port is port + 1000, so a main port above 64535 pushes it past the
|
|
4425
|
+
# 65535 ceiling and the bind raises OverflowError (not OSError, so the bind's
|
|
4426
|
+
# own guard below misses it) and the server dies. Ephemeral ports run to 65535,
|
|
4427
|
+
# so a harness that grabs a free port hits this often. Skip the test port in
|
|
4428
|
+
# that range, with a word, instead of crashing (tina4-python#260).
|
|
4429
|
+
if _ai_port is not None and _ai_port > 65535:
|
|
4430
|
+
Log.warning(
|
|
4431
|
+
f"Test port {_ai_port} (main port {port} + 1000) is above the maximum 65535 — "
|
|
4432
|
+
f"skipping it. Use a main port at or below 64535, or set TINA4_NO_AI_PORT=true."
|
|
4433
|
+
)
|
|
4434
|
+
_ai_port = None
|
|
4419
4435
|
|
|
4420
4436
|
# Banner — printed directly to stdout, not through the logger.
|
|
4421
4437
|
# TINA4_SUPPRESS=true silences the startup banner (useful in CI / Docker
|
|
@@ -676,6 +676,26 @@ def _migration_sort_key(name: str):
|
|
|
676
676
|
return (0, int(m.group(1)), name) if m else (1, 0, name)
|
|
677
677
|
|
|
678
678
|
|
|
679
|
+
def _migration_source_files(folder: Path) -> list:
|
|
680
|
+
"""Every migration file the runner APPLIES — ``.sql`` and ``.py`` — sorted by
|
|
681
|
+
the apply order (numeric/timestamp prefix). Excludes ``.down.sql`` rollback
|
|
682
|
+
files and dunder ``.py`` helpers (``__init__`` etc.).
|
|
683
|
+
|
|
684
|
+
The single source of truth so migrate(), get_files() and status() can never
|
|
685
|
+
disagree on what is pending. They used to each glob ``*.sql`` separately while
|
|
686
|
+
only migrate() also ran ``*.py``, so a pending ``.py`` migration was applied by
|
|
687
|
+
migrate() yet never shown by status() and never triggered startup
|
|
688
|
+
auto-migration (tina4-python#268).
|
|
689
|
+
"""
|
|
690
|
+
if not folder.is_dir():
|
|
691
|
+
return []
|
|
692
|
+
return sorted(
|
|
693
|
+
[f for f in folder.glob("*.sql") if not f.name.endswith(".down.sql")]
|
|
694
|
+
+ [f for f in folder.glob("*.py") if not f.name.startswith("__")],
|
|
695
|
+
key=lambda f: _migration_sort_key(f.name),
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
|
|
679
699
|
# CREATE TABLE <name> — name may be quoted ("x"), bracketed ([x] MSSQL), or bare.
|
|
680
700
|
_CREATE_TABLE_RE = re.compile(
|
|
681
701
|
r"^\s*CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?"
|
|
@@ -900,15 +920,9 @@ def _run_pending(db, migration_folder: str = "migrations", delimiter: str = ";")
|
|
|
900
920
|
batch = _get_next_batch(db)
|
|
901
921
|
ran = []
|
|
902
922
|
|
|
903
|
-
# Collect both .sql and .py migration files
|
|
904
|
-
#
|
|
905
|
-
|
|
906
|
-
# prefix sort after the numbered ones, then lexically.
|
|
907
|
-
migration_files = sorted(
|
|
908
|
-
[f for f in folder.glob("*.sql") if not f.name.endswith(".down.sql")]
|
|
909
|
-
+ [f for f in folder.glob("*.py") if not f.name.startswith("__")],
|
|
910
|
-
key=lambda f: _migration_sort_key(f.name),
|
|
911
|
-
)
|
|
923
|
+
# Collect both .sql and .py migration files, in apply order — the one
|
|
924
|
+
# discovery helper that get_files() and status() also use (#268).
|
|
925
|
+
migration_files = _migration_source_files(folder)
|
|
912
926
|
# Warn (once) about filenames without a recognized NNNNNN_/timestamp prefix —
|
|
913
927
|
# their ordering relative to numbered migrations is undefined, a silent
|
|
914
928
|
# out-of-order-apply footgun.
|
|
@@ -1200,11 +1214,9 @@ class Migration:
|
|
|
1200
1214
|
return self.status()["pending"]
|
|
1201
1215
|
|
|
1202
1216
|
def get_files(self) -> list[str]:
|
|
1203
|
-
"""
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
return []
|
|
1207
|
-
return sorted(f.name for f in folder.glob("*.sql") if not f.name.endswith(".down.sql"))
|
|
1217
|
+
"""Sorted migration filenames on disk — both .sql and .py (the two the
|
|
1218
|
+
runner applies), excluding .down.sql and dunder .py (#268)."""
|
|
1219
|
+
return [f.name for f in _migration_source_files(Path(self._dir))]
|
|
1208
1220
|
|
|
1209
1221
|
def record_migration(self, name: str, batch: int, passed: int = 1) -> None:
|
|
1210
1222
|
"""Insert a record into the migration tracking table.
|
|
@@ -1245,11 +1257,9 @@ def _status(db, migration_folder: str = "migrations") -> dict:
|
|
|
1245
1257
|
|
|
1246
1258
|
executed = _get_executed(db)
|
|
1247
1259
|
|
|
1248
|
-
#
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
if not f.name.endswith(".down.sql")
|
|
1252
|
-
)
|
|
1260
|
+
# Every migration the runner would apply — .sql AND .py — so a pending .py
|
|
1261
|
+
# migration shows up here instead of being invisible until it runs (#268).
|
|
1262
|
+
migration_files = _migration_source_files(folder)
|
|
1253
1263
|
|
|
1254
1264
|
# Build completed list from the database with execution metadata
|
|
1255
1265
|
result = db.fetch(
|
|
@@ -1268,7 +1278,7 @@ def _status(db, migration_folder: str = "migrations") -> dict:
|
|
|
1268
1278
|
|
|
1269
1279
|
# Build pending list from files not yet executed
|
|
1270
1280
|
pending = []
|
|
1271
|
-
for sql_file in
|
|
1281
|
+
for sql_file in migration_files:
|
|
1272
1282
|
migration_name = sql_file.stem
|
|
1273
1283
|
if migration_name not in executed:
|
|
1274
1284
|
desc = re.sub(r"^\d+_", "", migration_name, count=1).replace("_", " ")
|
|
@@ -124,9 +124,19 @@ class Queue:
|
|
|
124
124
|
self.retry_backoff, self.visibility_timeout,
|
|
125
125
|
)
|
|
126
126
|
|
|
127
|
-
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0,
|
|
128
|
+
raw: bool = False):
|
|
129
|
+
"""Add a job to the queue. Returns job ID.
|
|
130
|
+
|
|
131
|
+
``raw=True`` is a Kafka-only option (#264): it produces the value with
|
|
132
|
+
NO Tina4 envelope ({payload, priority, attempts}) and no injected id, so
|
|
133
|
+
a non-Tina4 service consuming the topic receives the exact schema it
|
|
134
|
+
expects. On the file/rabbitmq/mongodb backends the envelope is internal
|
|
135
|
+
bookkeeping that pop(), retries and dead-lettering depend on, so there is
|
|
136
|
+
nothing to omit — those backends refuse raw=True by name rather than
|
|
137
|
+
silently ignore it.
|
|
138
|
+
"""
|
|
139
|
+
return self._backend.push(data, priority, delay_seconds, raw)
|
|
130
140
|
|
|
131
141
|
def pop(self) -> Job | None:
|
|
132
142
|
"""Atomically claim the next available job. Returns None if empty."""
|
|
@@ -303,9 +313,12 @@ class Queue:
|
|
|
303
313
|
self._backend.close()
|
|
304
314
|
|
|
305
315
|
def produce(self, topic: str, data: dict, priority: int = 0,
|
|
306
|
-
delay_seconds: int = 0, delay_until: datetime | None = None
|
|
316
|
+
delay_seconds: int = 0, delay_until: datetime | None = None,
|
|
317
|
+
raw: bool = False):
|
|
307
318
|
"""Produce a message onto a topic. Convenience wrapper around push().
|
|
308
319
|
|
|
320
|
+
``raw`` behaves exactly as on push() — Kafka-only, un-enveloped (#264).
|
|
321
|
+
|
|
309
322
|
Either ``delay_seconds`` (integer offset) or ``delay_until``
|
|
310
323
|
(absolute ``datetime``) may be passed for scheduled jobs. ``delay_until``
|
|
311
324
|
takes precedence when both are set — naive datetimes are interpreted
|
|
@@ -322,7 +335,7 @@ class Queue:
|
|
|
322
335
|
old_topic = self.topic
|
|
323
336
|
self._retarget(topic)
|
|
324
337
|
try:
|
|
325
|
-
return self.push(data, priority, delay_seconds)
|
|
338
|
+
return self.push(data, priority, delay_seconds, raw)
|
|
326
339
|
finally:
|
|
327
340
|
self._retarget(old_topic)
|
|
328
341
|
|
|
@@ -32,7 +32,8 @@ class KafkaBackend(TopicDeadLetterMixin):
|
|
|
32
32
|
self._topic = topic
|
|
33
33
|
self._max_retries = max_retries
|
|
34
34
|
|
|
35
|
-
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0
|
|
35
|
+
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0,
|
|
36
|
+
raw: bool = False) -> str:
|
|
36
37
|
if priority > 0:
|
|
37
38
|
raise NotImplementedError(
|
|
38
39
|
"The kafka queue backend cannot honour push(priority): Kafka has "
|
|
@@ -48,6 +49,12 @@ class KafkaBackend(TopicDeadLetterMixin):
|
|
|
48
49
|
"every record behind it. Use the file or mongodb backend for "
|
|
49
50
|
"delayed jobs, or schedule the push itself."
|
|
50
51
|
)
|
|
52
|
+
if raw:
|
|
53
|
+
# Emit the value exactly as given — no {payload, priority, attempts}
|
|
54
|
+
# envelope and no injected id — so a non-Tina4 consumer reading the
|
|
55
|
+
# topic gets the schema it expects (#264). The symmetric unwrap is
|
|
56
|
+
# already on pop(): result.get("payload", result).
|
|
57
|
+
return self._backend.enqueue(self._topic, data, add_id=False)
|
|
51
58
|
msg = {"payload": data, "priority": priority, "attempts": 0}
|
|
52
59
|
return self._backend.enqueue(self._topic, msg)
|
|
53
60
|
|
|
@@ -93,7 +93,18 @@ class LiteBackend:
|
|
|
93
93
|
self._seq += 1
|
|
94
94
|
return f"{int(time.time() * 1000)}-{self._seq:06d}"
|
|
95
95
|
|
|
96
|
-
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0
|
|
96
|
+
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0,
|
|
97
|
+
raw: bool = False) -> str:
|
|
98
|
+
if raw:
|
|
99
|
+
raise NotImplementedError(
|
|
100
|
+
"The file queue backend cannot honour push(raw=True): raw emits "
|
|
101
|
+
"the message with no Tina4 envelope, which only a message bus "
|
|
102
|
+
"consumed by non-Tina4 systems (Kafka) needs. This backend stores "
|
|
103
|
+
"an internal envelope (id/status/attempts/available_at) that "
|
|
104
|
+
"pop(), the retry lifecycle and dead-lettering depend on, so there "
|
|
105
|
+
"is nothing to omit. Use the kafka backend for raw external "
|
|
106
|
+
"messages."
|
|
107
|
+
)
|
|
97
108
|
job_id = str(uuid.uuid4())
|
|
98
109
|
available = _now() if delay_seconds == 0 else _future(delay_seconds)
|
|
99
110
|
job = {
|
|
@@ -41,7 +41,18 @@ class MongoBackend:
|
|
|
41
41
|
self._topic = topic
|
|
42
42
|
self._max_retries = max_retries
|
|
43
43
|
|
|
44
|
-
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0
|
|
44
|
+
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0,
|
|
45
|
+
raw: bool = False) -> str:
|
|
46
|
+
if raw:
|
|
47
|
+
raise NotImplementedError(
|
|
48
|
+
"The mongodb queue backend cannot honour push(raw=True): raw "
|
|
49
|
+
"emits the message with no Tina4 envelope, which only a message "
|
|
50
|
+
"bus consumed by non-Tina4 systems (Kafka) needs. This backend "
|
|
51
|
+
"stores an internal envelope (payload/priority/attempts) that "
|
|
52
|
+
"pop(), the retry lifecycle and dead-lettering depend on, so there "
|
|
53
|
+
"is nothing to omit. Use the kafka backend for raw external "
|
|
54
|
+
"messages."
|
|
55
|
+
)
|
|
45
56
|
msg = {"payload": data, "priority": priority, "attempts": 0}
|
|
46
57
|
return self._backend.enqueue(self._topic, msg, delay_seconds)
|
|
47
58
|
|
|
@@ -31,7 +31,18 @@ class RabbitMQBackend(TopicDeadLetterMixin):
|
|
|
31
31
|
self._max_retries = max_retries
|
|
32
32
|
self._jobs: dict = {} # track jobs by id for complete/fail/retry
|
|
33
33
|
|
|
34
|
-
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0
|
|
34
|
+
def push(self, data: dict, priority: int = 0, delay_seconds: int = 0,
|
|
35
|
+
raw: bool = False) -> str:
|
|
36
|
+
if raw:
|
|
37
|
+
raise NotImplementedError(
|
|
38
|
+
"The rabbitmq queue backend cannot honour push(raw=True): raw "
|
|
39
|
+
"emits the message with no Tina4 envelope, which only a message "
|
|
40
|
+
"bus consumed by non-Tina4 systems (Kafka) needs. This backend "
|
|
41
|
+
"stores an internal envelope (payload/priority/attempts) that "
|
|
42
|
+
"pop(), the retry lifecycle and dead-lettering depend on, so there "
|
|
43
|
+
"is nothing to omit. Use the kafka backend for raw external "
|
|
44
|
+
"messages."
|
|
45
|
+
)
|
|
35
46
|
if priority > 0:
|
|
36
47
|
raise NotImplementedError(
|
|
37
48
|
"The rabbitmq queue backend cannot honour push(priority): "
|
{tina4_python-3.13.154 → tina4_python-3.13.156}/tina4_python/queue_backends/kafka_backend.py
RENAMED
|
@@ -12,6 +12,13 @@ Kafka wire protocol over TCP sockets (zero dependencies).
|
|
|
12
12
|
Environment variables:
|
|
13
13
|
TINA4_KAFKA_BROKERS — comma-separated broker list (default: localhost:9092)
|
|
14
14
|
TINA4_KAFKA_GROUP_ID — consumer group ID (default: tina4_consumer_group)
|
|
15
|
+
TINA4_KAFKA_AUTO_OFFSET_RESET — where a NEW consumer group starts when it has
|
|
16
|
+
no committed offset: 'earliest' (default, unchanged behaviour) or 'latest'.
|
|
17
|
+
Read as TINA4_KAFKA_AUTO_OFFSET_RESET first, then bare KAFKA_AUTO_OFFSET_RESET
|
|
18
|
+
(the librdkafka-convention name many deployments already set). Takes effect
|
|
19
|
+
on the confluent-kafka consume path; the zero-dependency raw fallback always
|
|
20
|
+
reads from the earliest retained offset (it tracks offsets from 0 and has no
|
|
21
|
+
offset-reset concept).
|
|
15
22
|
|
|
16
23
|
TLS/SASL (each read as TINA4_KAFKA_<NAME> first, then bare KAFKA_<NAME>):
|
|
17
24
|
TINA4_KAFKA_SECURITY_PROTOCOL — e.g. SSL / SASL_SSL (default: PLAINTEXT)
|
|
@@ -90,11 +97,23 @@ class KafkaConnector:
|
|
|
90
97
|
else:
|
|
91
98
|
self._connect_raw()
|
|
92
99
|
|
|
93
|
-
def enqueue(self, topic: str, message: dict) -> str:
|
|
94
|
-
"""Push a message onto a Kafka topic. Returns the message ID.
|
|
100
|
+
def enqueue(self, topic: str, message: dict, add_id: bool = True) -> str:
|
|
101
|
+
"""Push a message onto a Kafka topic. Returns the message ID.
|
|
102
|
+
|
|
103
|
+
``add_id`` (default True) stamps a generated ``id`` into the message
|
|
104
|
+
value so a Tina4 consumer can acknowledge it. For a RAW produce
|
|
105
|
+
(``Queue.push(raw=True)``, #264) it is False: the value is serialized
|
|
106
|
+
exactly as given — no ``id`` injected and the caller's dict is not
|
|
107
|
+
mutated — so a non-Tina4 consumer receives the bytes it expects. A
|
|
108
|
+
record key is still generated for partitioning; the key is never part
|
|
109
|
+
of the value.
|
|
110
|
+
"""
|
|
95
111
|
self._ensure_connected()
|
|
96
|
-
|
|
97
|
-
|
|
112
|
+
if add_id:
|
|
113
|
+
msg_id = message.get("id", secrets.token_hex(8))
|
|
114
|
+
message["id"] = msg_id
|
|
115
|
+
else:
|
|
116
|
+
msg_id = secrets.token_hex(8) # record key only; never written into the value
|
|
98
117
|
body = json.dumps(message, default=str)
|
|
99
118
|
|
|
100
119
|
if self._use_confluent:
|
|
@@ -233,12 +252,19 @@ class KafkaConnector:
|
|
|
233
252
|
"bootstrap.servers": self._brokers,
|
|
234
253
|
"client.id": self._client_id,
|
|
235
254
|
"group.id": self._group_id,
|
|
236
|
-
"auto.offset.reset":
|
|
255
|
+
"auto.offset.reset": self._offset_reset(),
|
|
237
256
|
"enable.auto.commit": False,
|
|
238
257
|
**security,
|
|
239
258
|
}
|
|
240
259
|
self._consumer = self._confluent.Consumer(consumer_conf)
|
|
241
260
|
|
|
261
|
+
@staticmethod
|
|
262
|
+
def _offset_reset() -> str:
|
|
263
|
+
"""Consumer auto.offset.reset from env: TINA4_KAFKA_AUTO_OFFSET_RESET,
|
|
264
|
+
then bare KAFKA_AUTO_OFFSET_RESET, default 'earliest' (#263)."""
|
|
265
|
+
return (os.environ.get("TINA4_KAFKA_AUTO_OFFSET_RESET")
|
|
266
|
+
or os.environ.get("KAFKA_AUTO_OFFSET_RESET") or "earliest")
|
|
267
|
+
|
|
242
268
|
@staticmethod
|
|
243
269
|
def _security_config() -> dict:
|
|
244
270
|
"""Build SSL/SASL client config from env (for a TLS broker/proxy).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|