tina4-python 3.13.137__tar.gz → 3.13.138__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.
Files changed (190) hide show
  1. tina4_python-3.13.138/COMMERCIAL-LICENSE.md +8 -0
  2. tina4_python-3.13.138/LICENSE +373 -0
  3. tina4_python-3.13.138/NOTICE +11 -0
  4. {tina4_python-3.13.137 → tina4_python-3.13.138}/PKG-INFO +8 -4
  5. {tina4_python-3.13.137 → tina4_python-3.13.138}/README.md +3 -2
  6. {tina4_python-3.13.137 → tina4_python-3.13.138}/pyproject.toml +3 -2
  7. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/CLAUDE.md +1 -1
  8. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/HtmlElement.py +6 -0
  9. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/Testing.py +6 -0
  10. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/__init__.py +7 -1
  11. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/_import_helper.py +6 -0
  12. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/ai/__init__.py +6 -0
  13. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/ai/client.py +6 -0
  14. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/api/__init__.py +10 -0
  15. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/auth/__init__.py +20 -8
  16. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/cache/__init__.py +22 -0
  17. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/cli/__init__.py +6 -0
  18. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/container/__init__.py +6 -0
  19. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/context/__init__.py +6 -0
  20. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/context/chunker.py +6 -0
  21. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/__init__.py +6 -0
  22. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/cache.py +6 -0
  23. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/constants.py +6 -0
  24. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/events.py +6 -0
  25. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/middleware.py +882 -825
  26. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/port_takeover.py +6 -0
  27. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/rate_limiter.py +6 -0
  28. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/request.py +53 -6
  29. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/response.py +104 -18
  30. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/router.py +6 -0
  31. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/core/server.py +654 -179
  32. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/crud/__init__.py +17 -7
  33. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/__init__.py +6 -0
  34. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/adapter.py +86 -7
  35. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/connection.py +143 -43
  36. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/database_url.py +12 -1
  37. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/firebird.py +66 -13
  38. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/mongodb.py +6 -0
  39. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/mssql.py +41 -9
  40. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/mysql.py +27 -7
  41. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/odbc.py +63 -7
  42. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/postgres.py +79 -22
  43. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/sql_translator.py +124 -15
  44. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/database/sqlite.py +22 -3
  45. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/debug/__init__.py +6 -0
  46. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/debug/error_overlay.py +6 -0
  47. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/dev_admin/__init__.py +227 -128
  48. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/dev_admin/metrics.py +6 -0
  49. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/dev_admin/plan.py +6 -0
  50. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/dev_admin/project_index.py +6 -0
  51. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/docs.py +6 -0
  52. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/docstore/__init__.py +19 -2
  53. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/dotenv/__init__.py +6 -0
  54. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/env.py +6 -0
  55. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/frond/__init__.py +6 -0
  56. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/frond/compiler.py +6 -0
  57. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/frond/engine.py +174 -12
  58. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/frond/parser.py +6 -0
  59. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +6 -0
  60. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/database/src/routes/api/gallery_db.py +6 -0
  61. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +6 -0
  62. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/orm/src/orm/Product.py +6 -0
  63. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +6 -0
  64. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +6 -0
  65. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +6 -0
  66. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/templates/src/routes/gallery_page.py +6 -0
  67. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/templates/src/templates/gallery_page.twig +8 -0
  68. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/__init__.py +6 -0
  69. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/adapter.py +6 -0
  70. tina4_python-3.13.138/tina4_python/graph/adapters/__init__.py +7 -0
  71. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/adapters/arango.py +6 -0
  72. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/adapters/bolt.py +6 -0
  73. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/adapters/ultipa.py +6 -0
  74. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graph/graph_url.py +6 -0
  75. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/graphql/__init__.py +11 -6
  76. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/i18n/__init__.py +6 -0
  77. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/mcp/__init__.py +6 -0
  78. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/mcp/protocol.py +6 -0
  79. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/mcp/tools.py +6 -0
  80. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/messenger/__init__.py +103 -45
  81. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/migration/__init__.py +6 -0
  82. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/migration/runner.py +6 -0
  83. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/mqtt/__init__.py +19 -4
  84. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/mqtt/message.py +6 -0
  85. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/orm/__init__.py +6 -0
  86. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/orm/collection.py +6 -0
  87. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/orm/fields.py +12 -7
  88. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/orm/model.py +84 -46
  89. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/orm/point.py +6 -0
  90. tina4_python-3.13.138/tina4_python/public/THIRD-PARTY-NOTICES.md +55 -0
  91. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/__feedback/widget.js +8 -0
  92. tina4_python-3.13.138/tina4_python/public/bundled-component-provenance.json +48 -0
  93. tina4_python-3.13.138/tina4_python/public/js/tina4js.min.js +58 -0
  94. tina4_python-3.13.138/tina4_python/public/licenses/swagger-ui-3.10.0-original-notice.txt +11 -0
  95. tina4_python-3.13.138/tina4_python/public/licenses/swagger-ui-5.17.14-NOTICE.txt +2 -0
  96. tina4_python-3.13.138/tina4_python/public/licenses/swagger-ui-Apache-2.0.txt +202 -0
  97. tina4_python-3.13.138/tina4_python/public/licenses/tina4-css-MIT.txt +21 -0
  98. tina4_python-3.13.138/tina4_python/public/licenses/tina4-dev-admin-components.json +240 -0
  99. tina4_python-3.13.138/tina4_python/public/licenses/tina4-dev-admin-third-party.txt +919 -0
  100. tina4_python-3.13.138/tina4_python/public/licenses/tina4-js-MIT.txt +20 -0
  101. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/push/__init__.py +6 -0
  102. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/push/_base.py +6 -0
  103. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/push/_cryptography.py +6 -0
  104. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/push/_libcrypto.py +6 -0
  105. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/query_builder/__init__.py +6 -0
  106. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/__init__.py +6 -0
  107. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/amqp_url.py +6 -0
  108. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/job.py +6 -0
  109. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/kafka_backend.py +6 -0
  110. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/lite_backend.py +6 -0
  111. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/mongo_backend.py +6 -0
  112. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue/rabbitmq_backend.py +6 -0
  113. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue_backends/__init__.py +6 -0
  114. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue_backends/kafka_backend.py +36 -2
  115. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue_backends/mongo_backend.py +6 -0
  116. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/queue_backends/rabbitmq_backend.py +6 -0
  117. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/__init__.py +6 -0
  118. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/Attachment.py +6 -0
  119. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/Channel.py +6 -0
  120. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/ChannelMember.py +6 -0
  121. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/Message.py +6 -0
  122. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/Workspace.py +6 -0
  123. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/models/__init__.py +6 -0
  124. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/realtime/storage.py +13 -1
  125. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/seeder/__init__.py +9 -3
  126. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/service/__init__.py +6 -0
  127. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session/__init__.py +6 -0
  128. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session_handlers/__init__.py +6 -0
  129. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session_handlers/memcached_handler.py +6 -0
  130. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session_handlers/mongodb_handler.py +85 -10
  131. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session_handlers/redis_handler.py +6 -0
  132. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/session_handlers/valkey_handler.py +6 -0
  133. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/sso.py +6 -0
  134. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/swagger/__init__.py +6 -0
  135. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/components/crud.twig +8 -0
  136. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/docker/distroless/Dockerfile +6 -0
  137. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/docker/poetry/Dockerfile +6 -0
  138. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/docker/python/Dockerfile +6 -0
  139. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/docker/uv/Dockerfile +6 -0
  140. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/302.twig +8 -0
  141. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/401.twig +8 -0
  142. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/403.twig +8 -0
  143. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/404.twig +8 -0
  144. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/500.twig +8 -0
  145. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/502.twig +8 -0
  146. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/503.twig +8 -0
  147. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/errors/base.twig +8 -0
  148. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/test/__init__.py +6 -0
  149. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/test_client/__init__.py +6 -0
  150. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/validator/__init__.py +6 -0
  151. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/websocket/__init__.py +6 -0
  152. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/websocket/backplane.py +31 -11
  153. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/wsdl/__init__.py +45 -1
  154. tina4_python-3.13.137/tina4_python/graph/adapters/__init__.py +0 -1
  155. tina4_python-3.13.137/tina4_python/public/js/tina4js.min.js +0 -48
  156. {tina4_python-3.13.137 → tina4_python-3.13.138}/.gitignore +0 -0
  157. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/.tina4-metrics.json +0 -0
  158. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/frond/FROND.md +0 -0
  159. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/auth/meta.json +0 -0
  160. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/database/meta.json +0 -0
  161. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/error-overlay/meta.json +0 -0
  162. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/orm/meta.json +0 -0
  163. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/queue/meta.json +0 -0
  164. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/rest-api/meta.json +0 -0
  165. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/gallery/templates/meta.json +0 -0
  166. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/css/tina4.css +0 -0
  167. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/css/tina4.min.css +0 -0
  168. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/favicon.ico +0 -0
  169. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/images/logo.svg +0 -0
  170. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
  171. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/js/frond.js +0 -0
  172. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/js/frond.min.js +0 -0
  173. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
  174. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/js/tina4.min.js +0 -0
  175. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/swagger/index.html +0 -0
  176. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
  177. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/frontend/README.md +0 -0
  178. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/templates/readme.md +0 -0
  179. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
  180. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
  181. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
  182. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
  183. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
  184. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
  185. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
  186. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
  187. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
  188. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
  189. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
  190. {tina4_python-3.13.137 → tina4_python-3.13.138}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
@@ -0,0 +1,8 @@
1
+ # Commercial licensing
2
+
3
+ Copyright (c) 2026 Code Infinity.
4
+
5
+ Tina4 is available under the Mozilla Public License 2.0 in LICENSE.
6
+ Code Infinity may also provide Tina4 under a separate commercial licence.
7
+ Contact Code Infinity through https://tina4.com to discuss commercial terms.
8
+ This notice does not itself grant a commercial licence or alter the MPL-2.0 grant.
@@ -0,0 +1,373 @@
1
+ Mozilla Public License Version 2.0
2
+ ==================================
3
+
4
+ 1. Definitions
5
+ --------------
6
+
7
+ 1.1. "Contributor"
8
+ means each individual or legal entity that creates, contributes to
9
+ the creation of, or owns Covered Software.
10
+
11
+ 1.2. "Contributor Version"
12
+ means the combination of the Contributions of others (if any) used
13
+ by a Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+ means Covered Software of a particular Contributor.
17
+
18
+ 1.4. "Covered Software"
19
+ means Source Code Form to which the initial Contributor has attached
20
+ the notice in Exhibit A, the Executable Form of such Source Code
21
+ Form, and Modifications of such Source Code Form, in each case
22
+ including portions thereof.
23
+
24
+ 1.5. "Incompatible With Secondary Licenses"
25
+ means
26
+
27
+ (a) that the initial Contributor has attached the notice described
28
+ in Exhibit B to the Covered Software; or
29
+
30
+ (b) that the Covered Software was made available under the terms of
31
+ version 1.1 or earlier of the License, but not also under the
32
+ terms of a Secondary License.
33
+
34
+ 1.6. "Executable Form"
35
+ means any form of the work other than Source Code Form.
36
+
37
+ 1.7. "Larger Work"
38
+ means a work that combines Covered Software with other material, in
39
+ a separate file or files, that is not Covered Software.
40
+
41
+ 1.8. "License"
42
+ means this document.
43
+
44
+ 1.9. "Licensable"
45
+ means having the right to grant, to the maximum extent possible,
46
+ whether at the time of the initial grant or subsequently, any and
47
+ all of the rights conveyed by this License.
48
+
49
+ 1.10. "Modifications"
50
+ means any of the following:
51
+
52
+ (a) any file in Source Code Form that results from an addition to,
53
+ deletion from, or modification of the contents of Covered
54
+ Software; or
55
+
56
+ (b) any new file in Source Code Form that contains any Covered
57
+ Software.
58
+
59
+ 1.11. "Patent Claims" of a Contributor
60
+ means any patent claim(s), including without limitation, method,
61
+ process, and apparatus claims, in any patent Licensable by such
62
+ Contributor that would be infringed, but for the grant of the
63
+ License, by the making, using, selling, offering for sale, having
64
+ made, import, or transfer of either its Contributions or its
65
+ Contributor Version.
66
+
67
+ 1.12. "Secondary License"
68
+ means either the GNU General Public License, Version 2.0, the GNU
69
+ Lesser General Public License, Version 2.1, the GNU Affero General
70
+ Public License, Version 3.0, or any later versions of those
71
+ licenses.
72
+
73
+ 1.13. "Source Code Form"
74
+ means the form of the work preferred for making modifications.
75
+
76
+ 1.14. "You" (or "Your")
77
+ means an individual or a legal entity exercising rights under this
78
+ License. For legal entities, "You" includes any entity that
79
+ controls, is controlled by, or is under common control with You. For
80
+ purposes of this definition, "control" means (a) the power, direct
81
+ or indirect, to cause the direction or management of such entity,
82
+ whether by contract or otherwise, or (b) ownership of more than
83
+ fifty percent (50%) of the outstanding shares or beneficial
84
+ ownership of such entity.
85
+
86
+ 2. License Grants and Conditions
87
+ --------------------------------
88
+
89
+ 2.1. Grants
90
+
91
+ Each Contributor hereby grants You a world-wide, royalty-free,
92
+ non-exclusive license:
93
+
94
+ (a) under intellectual property rights (other than patent or trademark)
95
+ Licensable by such Contributor to use, reproduce, make available,
96
+ modify, display, perform, distribute, and otherwise exploit its
97
+ Contributions, either on an unmodified basis, with Modifications, or
98
+ as part of a Larger Work; and
99
+
100
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
101
+ for sale, have made, import, and otherwise transfer either its
102
+ Contributions or its Contributor Version.
103
+
104
+ 2.2. Effective Date
105
+
106
+ The licenses granted in Section 2.1 with respect to any Contribution
107
+ become effective for each Contribution on the date the Contributor first
108
+ distributes such Contribution.
109
+
110
+ 2.3. Limitations on Grant Scope
111
+
112
+ The licenses granted in this Section 2 are the only rights granted under
113
+ this License. No additional rights or licenses will be implied from the
114
+ distribution or licensing of Covered Software under this License.
115
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
116
+ Contributor:
117
+
118
+ (a) for any code that a Contributor has removed from Covered Software;
119
+ or
120
+
121
+ (b) for infringements caused by: (i) Your and any other third party's
122
+ modifications of Covered Software, or (ii) the combination of its
123
+ Contributions with other software (except as part of its Contributor
124
+ Version); or
125
+
126
+ (c) under Patent Claims infringed by Covered Software in the absence of
127
+ its Contributions.
128
+
129
+ This License does not grant any rights in the trademarks, service marks,
130
+ or logos of any Contributor (except as may be necessary to comply with
131
+ the notice requirements in Section 3.4).
132
+
133
+ 2.4. Subsequent Licenses
134
+
135
+ No Contributor makes additional grants as a result of Your choice to
136
+ distribute the Covered Software under a subsequent version of this
137
+ License (see Section 10.2) or under the terms of a Secondary License (if
138
+ permitted under the terms of Section 3.3).
139
+
140
+ 2.5. Representation
141
+
142
+ Each Contributor represents that the Contributor believes its
143
+ Contributions are its original creation(s) or it has sufficient rights
144
+ to grant the rights to its Contributions conveyed by this License.
145
+
146
+ 2.6. Fair Use
147
+
148
+ This License is not intended to limit any rights You have under
149
+ applicable copyright doctrines of fair use, fair dealing, or other
150
+ equivalents.
151
+
152
+ 2.7. Conditions
153
+
154
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155
+ in Section 2.1.
156
+
157
+ 3. Responsibilities
158
+ -------------------
159
+
160
+ 3.1. Distribution of Source Form
161
+
162
+ All distribution of Covered Software in Source Code Form, including any
163
+ Modifications that You create or to which You contribute, must be under
164
+ the terms of this License. You must inform recipients that the Source
165
+ Code Form of the Covered Software is governed by the terms of this
166
+ License, and how they can obtain a copy of this License. You may not
167
+ attempt to alter or restrict the recipients' rights in the Source Code
168
+ Form.
169
+
170
+ 3.2. Distribution of Executable Form
171
+
172
+ If You distribute Covered Software in Executable Form then:
173
+
174
+ (a) such Covered Software must also be made available in Source Code
175
+ Form, as described in Section 3.1, and You must inform recipients of
176
+ the Executable Form how they can obtain a copy of such Source Code
177
+ Form by reasonable means in a timely manner, at a charge no more
178
+ than the cost of distribution to the recipient; and
179
+
180
+ (b) You may distribute such Executable Form under the terms of this
181
+ License, or sublicense it under different terms, provided that the
182
+ license for the Executable Form does not attempt to limit or alter
183
+ the recipients' rights in the Source Code Form under this License.
184
+
185
+ 3.3. Distribution of a Larger Work
186
+
187
+ You may create and distribute a Larger Work under terms of Your choice,
188
+ provided that You also comply with the requirements of this License for
189
+ the Covered Software. If the Larger Work is a combination of Covered
190
+ Software with a work governed by one or more Secondary Licenses, and the
191
+ Covered Software is not Incompatible With Secondary Licenses, this
192
+ License permits You to additionally distribute such Covered Software
193
+ under the terms of such Secondary License(s), so that the recipient of
194
+ the Larger Work may, at their option, further distribute the Covered
195
+ Software under the terms of either this License or such Secondary
196
+ License(s).
197
+
198
+ 3.4. Notices
199
+
200
+ You may not remove or alter the substance of any license notices
201
+ (including copyright notices, patent notices, disclaimers of warranty,
202
+ or limitations of liability) contained within the Source Code Form of
203
+ the Covered Software, except that You may alter any license notices to
204
+ the extent required to remedy known factual inaccuracies.
205
+
206
+ 3.5. Application of Additional Terms
207
+
208
+ You may choose to offer, and to charge a fee for, warranty, support,
209
+ indemnity or liability obligations to one or more recipients of Covered
210
+ Software. However, You may do so only on Your own behalf, and not on
211
+ behalf of any Contributor. You must make it absolutely clear that any
212
+ such warranty, support, indemnity, or liability obligation is offered by
213
+ You alone, and You hereby agree to indemnify every Contributor for any
214
+ liability incurred by such Contributor as a result of warranty, support,
215
+ indemnity or liability terms You offer. You may include additional
216
+ disclaimers of warranty and limitations of liability specific to any
217
+ jurisdiction.
218
+
219
+ 4. Inability to Comply Due to Statute or Regulation
220
+ ---------------------------------------------------
221
+
222
+ If it is impossible for You to comply with any of the terms of this
223
+ License with respect to some or all of the Covered Software due to
224
+ statute, judicial order, or regulation then You must: (a) comply with
225
+ the terms of this License to the maximum extent possible; and (b)
226
+ describe the limitations and the code they affect. Such description must
227
+ be placed in a text file included with all distributions of the Covered
228
+ Software under this License. Except to the extent prohibited by statute
229
+ or regulation, such description must be sufficiently detailed for a
230
+ recipient of ordinary skill to be able to understand it.
231
+
232
+ 5. Termination
233
+ --------------
234
+
235
+ 5.1. The rights granted under this License will terminate automatically
236
+ if You fail to comply with any of its terms. However, if You become
237
+ compliant, then the rights granted under this License from a particular
238
+ Contributor are reinstated (a) provisionally, unless and until such
239
+ Contributor explicitly and finally terminates Your grants, and (b) on an
240
+ ongoing basis, if such Contributor fails to notify You of the
241
+ non-compliance by some reasonable means prior to 60 days after You have
242
+ come back into compliance. Moreover, Your grants from a particular
243
+ Contributor are reinstated on an ongoing basis if such Contributor
244
+ notifies You of the non-compliance by some reasonable means, this is the
245
+ first time You have received notice of non-compliance with this License
246
+ from such Contributor, and You become compliant prior to 30 days after
247
+ Your receipt of the notice.
248
+
249
+ 5.2. If You initiate litigation against any entity by asserting a patent
250
+ infringement claim (excluding declaratory judgment actions,
251
+ counter-claims, and cross-claims) alleging that a Contributor Version
252
+ directly or indirectly infringes any patent, then the rights granted to
253
+ You by any and all Contributors for the Covered Software under Section
254
+ 2.1 of this License shall terminate.
255
+
256
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257
+ end user license agreements (excluding distributors and resellers) which
258
+ have been validly granted by You or Your distributors under this License
259
+ prior to termination shall survive termination.
260
+
261
+ ************************************************************************
262
+ * *
263
+ * 6. Disclaimer of Warranty *
264
+ * ------------------------- *
265
+ * *
266
+ * Covered Software is provided under this License on an "as is" *
267
+ * basis, without warranty of any kind, either expressed, implied, or *
268
+ * statutory, including, without limitation, warranties that the *
269
+ * Covered Software is free of defects, merchantable, fit for a *
270
+ * particular purpose or non-infringing. The entire risk as to the *
271
+ * quality and performance of the Covered Software is with You. *
272
+ * Should any Covered Software prove defective in any respect, You *
273
+ * (not any Contributor) assume the cost of any necessary servicing, *
274
+ * repair, or correction. This disclaimer of warranty constitutes an *
275
+ * essential part of this License. No use of any Covered Software is *
276
+ * authorized under this License except under this disclaimer. *
277
+ * *
278
+ ************************************************************************
279
+
280
+ ************************************************************************
281
+ * *
282
+ * 7. Limitation of Liability *
283
+ * -------------------------- *
284
+ * *
285
+ * Under no circumstances and under no legal theory, whether tort *
286
+ * (including negligence), contract, or otherwise, shall any *
287
+ * Contributor, or anyone who distributes Covered Software as *
288
+ * permitted above, be liable to You for any direct, indirect, *
289
+ * special, incidental, or consequential damages of any character *
290
+ * including, without limitation, damages for lost profits, loss of *
291
+ * goodwill, work stoppage, computer failure or malfunction, or any *
292
+ * and all other commercial damages or losses, even if such party *
293
+ * shall have been informed of the possibility of such damages. This *
294
+ * limitation of liability shall not apply to liability for death or *
295
+ * personal injury resulting from such party's negligence to the *
296
+ * extent applicable law prohibits such limitation. Some *
297
+ * jurisdictions do not allow the exclusion or limitation of *
298
+ * incidental or consequential damages, so this exclusion and *
299
+ * limitation may not apply to You. *
300
+ * *
301
+ ************************************************************************
302
+
303
+ 8. Litigation
304
+ -------------
305
+
306
+ Any litigation relating to this License may be brought only in the
307
+ courts of a jurisdiction where the defendant maintains its principal
308
+ place of business and such litigation shall be governed by laws of that
309
+ jurisdiction, without reference to its conflict-of-law provisions.
310
+ Nothing in this Section shall prevent a party's ability to bring
311
+ cross-claims or counter-claims.
312
+
313
+ 9. Miscellaneous
314
+ ----------------
315
+
316
+ This License represents the complete agreement concerning the subject
317
+ matter hereof. If any provision of this License is held to be
318
+ unenforceable, such provision shall be reformed only to the extent
319
+ necessary to make it enforceable. Any law or regulation which provides
320
+ that the language of a contract shall be construed against the drafter
321
+ shall not be used to construe this License against a Contributor.
322
+
323
+ 10. Versions of the License
324
+ ---------------------------
325
+
326
+ 10.1. New Versions
327
+
328
+ Mozilla Foundation is the license steward. Except as provided in Section
329
+ 10.3, no one other than the license steward has the right to modify or
330
+ publish new versions of this License. Each version will be given a
331
+ distinguishing version number.
332
+
333
+ 10.2. Effect of New Versions
334
+
335
+ You may distribute the Covered Software under the terms of the version
336
+ of the License under which You originally received the Covered Software,
337
+ or under the terms of any subsequent version published by the license
338
+ steward.
339
+
340
+ 10.3. Modified Versions
341
+
342
+ If you create software not governed by this License, and you want to
343
+ create a new license for such software, you may create and use a
344
+ modified version of this License if you rename the license and remove
345
+ any references to the name of the license steward (except to note that
346
+ such modified license differs from this License).
347
+
348
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
349
+ Licenses
350
+
351
+ If You choose to distribute Source Code Form that is Incompatible With
352
+ Secondary Licenses under the terms of this version of the License, the
353
+ notice described in Exhibit B of this License must be attached.
354
+
355
+ Exhibit A - Source Code Form License Notice
356
+ -------------------------------------------
357
+
358
+ This Source Code Form is subject to the terms of the Mozilla Public
359
+ License, v. 2.0. If a copy of the MPL was not distributed with this
360
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
+
362
+ If it is not possible or desirable to put the notice in a particular
363
+ file, then You may include the notice in a location (such as a LICENSE
364
+ file in a relevant directory) where a recipient would be likely to look
365
+ for such a notice.
366
+
367
+ You may add additional accurate notices of copyright ownership.
368
+
369
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
370
+ ---------------------------------------------------------
371
+
372
+ This Source Code Form is "Incompatible With Secondary Licenses", as
373
+ defined by the Mozilla Public License, v. 2.0.
@@ -0,0 +1,11 @@
1
+ Tina4
2
+ Copyright (c) 2026 Code Infinity
3
+
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+
8
+ Source code for each release is available from its corresponding
9
+ tina4stack repository and release tag at https://github.com/tina4stack.
10
+ Previously published releases retain their original licences.
11
+ Third-party components retain their own licences and notices.
@@ -1,9 +1,12 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tina4-python
3
- Version: 3.13.137
3
+ Version: 3.13.138
4
4
  Summary: Tina4 Python v3 — Zero-dependency, lightweight web framework
5
5
  Author-email: Andre van Zuydam <andrevanzuydam@gmail.com>
6
- License: MIT
6
+ License-Expression: MPL-2.0
7
+ License-File: COMMERCIAL-LICENSE.md
8
+ License-File: LICENSE
9
+ License-File: NOTICE
7
10
  Requires-Python: >=3.12
8
11
  Provides-Extra: all-db
9
12
  Requires-Dist: firebird-driver>=1.10; extra == 'all-db'
@@ -830,8 +833,9 @@ Full guides, API reference, and examples at **[tina4.com](https://tina4.com)**.
830
833
 
831
834
  ## License
832
835
 
833
- MIT (c) 2007-2026 Tina4 Stack
834
- https://opensource.org/licenses/MIT
836
+ Copyright (c) 2026 Code Infinity. Licensed under the [Mozilla Public License 2.0](LICENSE).
837
+ A separate commercial licence is available from Code Infinity; see [commercial licensing](COMMERCIAL-LICENSE.md).
838
+ Previously published releases retain their original licences.
835
839
 
836
840
  ---
837
841
 
@@ -764,8 +764,9 @@ Full guides, API reference, and examples at **[tina4.com](https://tina4.com)**.
764
764
 
765
765
  ## License
766
766
 
767
- MIT (c) 2007-2026 Tina4 Stack
768
- https://opensource.org/licenses/MIT
767
+ Copyright (c) 2026 Code Infinity. Licensed under the [Mozilla Public License 2.0](LICENSE).
768
+ A separate commercial licence is available from Code Infinity; see [commercial licensing](COMMERCIAL-LICENSE.md).
769
+ Previously published releases retain their original licences.
769
770
 
770
771
  ---
771
772
 
@@ -1,13 +1,14 @@
1
1
  [project]
2
2
  name = "tina4-python"
3
- version = "3.13.137"
3
+ version = "3.13.138"
4
4
  description = "Tina4 Python v3 — Zero-dependency, lightweight web framework"
5
5
  authors = [
6
6
  {name = "Andre van Zuydam", email = "andrevanzuydam@gmail.com"}
7
7
  ]
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.12"
10
- license = {text = "MIT"}
10
+ license = "MPL-2.0"
11
+ license-files = ["LICENSE", "NOTICE", "COMMERCIAL-LICENSE.md"]
11
12
 
12
13
  # ZERO core dependencies — this is v3's defining feature
13
14
  dependencies = []
@@ -1720,7 +1720,7 @@ anywhere (the production on/off switch, wired for real in 3.13.40).
1720
1720
 
1721
1721
  ## CORS
1722
1722
 
1723
- Built-in, and it DENIES by default (ADR-0018). Set `TINA4_CORS_ORIGINS` to the origins you want to allow (comma-separated), or `*` for any. With it unset no `Access-Control-Allow-Origin` is sent and the browser blocks the cross-origin request. `TINA4_CORS_CREDENTIALS=true` is never sent alongside a `*` origin (the Fetch Standard forbids the pair). OPTIONS pre-flight is handled automatically.
1723
+ Built-in, and it DENIES by default (ADR-0018). Set `TINA4_CORS_ORIGINS` to the specific origins you want to allow (comma-separated, e.g. `https://app.example.com`). With it unset no `Access-Control-Allow-Origin` is sent and the browser blocks the cross-origin request. A same-origin request (its `Origin` equals the request's own scheme://host[:port], default ports 80/443 ignored) needs no CORS headers and is never warned about; a disallowed cross-origin request logs one warning naming that origin to add. `TINA4_CORS_CREDENTIALS=true` is never sent alongside a `*` origin (the Fetch Standard forbids the pair). OPTIONS pre-flight is handled automatically.
1724
1724
 
1725
1725
  ## SCSS Workflow
1726
1726
 
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  """
2
8
  Tina4 - The Intelligent Native Application 4ramework.
3
9
  Programmatic HTML builder - avoids string concatenation.
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 Python v3.0 — The Intelligent Native Application 4ramework.
2
8
  # Copyright 2007 - present Tina4
3
9
  # License: MIT https://opensource.org/licenses/MIT
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 Python v3.0 — The Intelligent Native Application 4ramework.
2
8
  # Copyright 2007 - present Tina4
3
9
  # License: MIT https://opensource.org/licenses/MIT
@@ -51,7 +57,7 @@ def _resolve_version() -> str:
51
57
  #
52
58
  # test_version_constant.py now asserts this literal equals the pyproject
53
59
  # version, so the release bump cannot leave it behind again.
54
- return "3.13.137"
60
+ return "3.13.138"
55
61
 
56
62
 
57
63
  __version__ = _resolve_version()
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  """
2
8
  tina4_python._import_helper — turn a wrong `tina4_python.<X>` import into a
3
9
  helpful ModuleNotFoundError that names the closest real module in the tree.
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 AI — Detect and install AI coding assistant context files.
2
8
  """
3
9
  Detect which AI tools are present in a project and install Tina4-aware
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  """Zero-dependency app-facing AI client (ADR-0053)."""
2
8
 
3
9
  from __future__ import annotations
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 API Client — HTTP client using Python stdlib only.
2
8
  """
3
9
  Make HTTP requests without requests/httpx/aiohttp.
@@ -795,6 +801,10 @@ class Api:
795
801
  if extra_headers:
796
802
  headers.update(extra_headers)
797
803
 
804
+ # Match redirect policy after every configured/per-call header merge.
805
+ if not _same_origin(url, self.base_url):
806
+ headers = {key: value for key, value in headers.items()
807
+ if key.lower() not in ("authorization", "cookie")}
798
808
  return Request(url, data=data, headers=headers, method=method)
799
809
 
800
810
  def _request(self, method: str, url: str, body=None,
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 Auth — Zero-dependency JWT, password hashing, and token validation.
2
8
  """
3
9
  JWT implementation using Python stdlib only (hmac + hashlib). No PyJWT.
@@ -144,14 +150,20 @@ def ensure_dev_secret(cwd: str = None) -> str | None:
144
150
  base = Path(cwd) if cwd else Path.cwd()
145
151
  env_local = base / ".env.local"
146
152
  try:
147
- # Append (create if missing). A trailing newline keeps the file
148
- # parseable if it already held entries without a final newline.
149
- prefix = ""
150
- if env_local.exists():
151
- existing = env_local.read_text(encoding="utf-8")
152
- if existing and not existing.endswith("\n"):
153
- prefix = "\n"
154
- with env_local.open("a", encoding="utf-8") as fh:
153
+ import stat
154
+ # Read and append through the same guarded descriptor: a replaced path
155
+ # cannot redirect either operation to another file.
156
+ fd = os.open(env_local, os.O_RDWR | os.O_APPEND | os.O_CREAT
157
+ | getattr(os, "O_NOFOLLOW", 0) | getattr(os, "O_NONBLOCK", 0), 0o600)
158
+ with os.fdopen(fd, "a+", encoding="utf-8") as fh:
159
+ info = os.fstat(fh.fileno())
160
+ if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1:
161
+ raise OSError("Refusing a non-regular or multiply-linked configuration file")
162
+ if hasattr(os, "fchmod"):
163
+ os.fchmod(fh.fileno(), 0o600)
164
+ fh.seek(0)
165
+ existing = fh.read()
166
+ prefix = "\n" if existing and not existing.endswith("\n") else ""
155
167
  fh.write(f"{prefix}TINA4_SECRET={new_secret}\n")
156
168
  _log_info(
157
169
  "Auth: generated a development secret, saved to .env.local (gitignored)"
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 Response Cache — Multi-backend GET response caching middleware.
2
8
  # Copyright 2007 - present Tina4
3
9
  # License: MIT https://opensource.org/licenses/MIT
@@ -73,6 +79,10 @@ from pathlib import Path
73
79
  class _CacheBackend:
74
80
  """Abstract cache backend."""
75
81
 
82
+ # Set by a backend whose optional driver could not be imported: the
83
+ # "package is required ... Install it with: ..." text the fallback appends.
84
+ missing_driver_message: str | None = None
85
+
76
86
  def get(self, key: str):
77
87
  raise NotImplementedError
78
88
 
@@ -816,6 +826,16 @@ class _MongoBackend(_CacheBackend):
816
826
  self._coll = None
817
827
  try:
818
828
  import pymongo
829
+ except ImportError:
830
+ # Recorded so the fallback warning can say the one thing the user
831
+ # can fix with one command - and ONLY when the driver really is
832
+ # missing, never when Mongo is merely unreachable.
833
+ self.missing_driver_message = (
834
+ "The 'pymongo' package is required for the mongodb cache backend. "
835
+ "Install it with: uv add pymongo (or: pip install pymongo)"
836
+ )
837
+ return
838
+ try:
819
839
  mongo_kwargs = {"serverSelectionTimeoutMS": 5000}
820
840
  # Credentials from env when not embedded in the URL (parity with DB layer).
821
841
  if "@" not in url:
@@ -1070,9 +1090,11 @@ def _create_backend(
1070
1090
  if not be.is_available():
1071
1091
  try:
1072
1092
  from tina4_python.debug import Log
1093
+ missing_driver = be.missing_driver_message
1073
1094
  Log.warning(
1074
1095
  f"Cache backend '{backend}' is unavailable "
1075
1096
  f"(driver missing or service unreachable) — falling back to 'file'."
1097
+ + (f" {missing_driver}" if missing_driver else "")
1076
1098
  )
1077
1099
  except Exception:
1078
1100
  pass
@@ -1,3 +1,9 @@
1
+ # Copyright (c) 2026 Code Infinity
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
1
7
  # Tina4 CLI — Command-line interface for project management.
2
8
  """
3
9
  CLI commands for development workflow.