simple-module-core 0.0.49__tar.gz → 0.0.50__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 (242) hide show
  1. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/PKG-INFO +2 -2
  2. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/README.md +1 -1
  3. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/pyproject.toml +1 -1
  4. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/__init__.py +50 -37
  5. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/__main__.py +5 -5
  6. simple_module_core-0.0.50/simple_module_core/access/__init__.py +1 -0
  7. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/_permission_grants.py +1 -1
  8. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/file_access.py +1 -1
  9. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permissions.py +2 -2
  10. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/principal_permissions.py +3 -3
  11. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/principals.py +2 -2
  12. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/resources.py +2 -2
  13. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/role_directory.py +1 -1
  14. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/tenancy.py +40 -2
  15. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/user_directory.py +22 -1
  16. simple_module_core-0.0.50/simple_module_core/activity_feed.py +13 -0
  17. simple_module_core-0.0.50/simple_module_core/app_state.py +11 -0
  18. simple_module_core-0.0.50/simple_module_core/audit_links.py +11 -0
  19. simple_module_core-0.0.50/simple_module_core/body_limits.py +11 -0
  20. simple_module_core-0.0.50/simple_module_core/correlation.py +13 -0
  21. simple_module_core-0.0.50/simple_module_core/cors.py +9 -0
  22. simple_module_core-0.0.50/simple_module_core/crypto.py +11 -0
  23. simple_module_core-0.0.50/simple_module_core/csp.py +9 -0
  24. simple_module_core-0.0.50/simple_module_core/data_compatibility.py +13 -0
  25. simple_module_core-0.0.50/simple_module_core/datetimes.py +11 -0
  26. simple_module_core-0.0.50/simple_module_core/deprecation.py +13 -0
  27. simple_module_core-0.0.50/simple_module_core/design_packs.py +11 -0
  28. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_auth.py +2 -2
  29. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_coupling.py +1 -1
  30. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_css.py +1 -1
  31. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/diagnostics}/_data_doctor.py +3 -3
  32. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_db_extensions.py +1 -1
  33. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_dependencies.py +2 -2
  34. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_durable_names.py +1 -1
  35. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_expression_index.py +2 -2
  36. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_heavy_task_imports.py +1 -1
  37. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_i18n.py +3 -3
  38. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_inertia_api.py +1 -1
  39. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_js_workspace.py +1 -1
  40. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_migration.py +1 -1
  41. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/diagnostics}/_migration_doctor.py +3 -3
  42. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_module.py +10 -8
  43. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_pages.py +89 -35
  44. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_runner.py +1 -1
  45. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_spa_mount.py +1 -1
  46. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_tenancy.py +2 -2
  47. simple_module_core-0.0.50/simple_module_core/discovery.py +11 -0
  48. simple_module_core-0.0.50/simple_module_core/dotenv.py +11 -0
  49. simple_module_core-0.0.50/simple_module_core/durable_events.py +13 -0
  50. simple_module_core-0.0.50/simple_module_core/environments.py +13 -0
  51. simple_module_core-0.0.50/simple_module_core/eventing/__init__.py +1 -0
  52. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/_invalidation_message.py +1 -1
  53. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/events.py +32 -6
  54. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/invalidation.py +2 -2
  55. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/invalidation_refresh.py +1 -1
  56. simple_module_core-0.0.50/simple_module_core/events.py +11 -0
  57. simple_module_core-0.0.50/simple_module_core/exceptions.py +11 -0
  58. simple_module_core-0.0.50/simple_module_core/feature_flags.py +13 -0
  59. simple_module_core-0.0.50/simple_module_core/file_access.py +13 -0
  60. simple_module_core-0.0.50/simple_module_core/health.py +11 -0
  61. simple_module_core-0.0.50/simple_module_core/i18n.py +11 -0
  62. simple_module_core-0.0.50/simple_module_core/invalidation.py +13 -0
  63. simple_module_core-0.0.50/simple_module_core/invalidation_refresh.py +13 -0
  64. simple_module_core-0.0.50/simple_module_core/leases.py +11 -0
  65. simple_module_core-0.0.50/simple_module_core/localization/__init__.py +1 -0
  66. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/_i18n_translator.py +3 -3
  67. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/i18n.py +3 -3
  68. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/i18n_overrides.py +1 -1
  69. simple_module_core-0.0.50/simple_module_core/mail.py +11 -0
  70. simple_module_core-0.0.50/simple_module_core/mailer/__init__.py +1 -0
  71. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/mailer}/_mail_headers.py +21 -0
  72. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/mailer}/mail.py +2 -12
  73. simple_module_core-0.0.50/simple_module_core/menu.py +9 -0
  74. simple_module_core-0.0.50/simple_module_core/migration_support/__init__.py +13 -0
  75. simple_module_core-0.0.50/simple_module_core/migrations/__init__.py +1 -0
  76. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/migrations}/data_compatibility.py +3 -3
  77. simple_module_core-0.0.49/simple_module_core/migration_support/__init__.py → simple_module_core-0.0.50/simple_module_core/migrations/support.py +4 -1
  78. simple_module_core-0.0.50/simple_module_core/module.py +11 -0
  79. simple_module_core-0.0.50/simple_module_core/module_meta.py +13 -0
  80. simple_module_core-0.0.50/simple_module_core/module_settings.py +13 -0
  81. simple_module_core-0.0.50/simple_module_core/modules/__init__.py +1 -0
  82. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_auth_providers.py +2 -2
  83. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_module_conventions.py +1 -1
  84. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_module_ordering.py +3 -3
  85. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_request_hooks.py +6 -6
  86. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/app_state.py +19 -11
  87. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/discovery.py +10 -10
  88. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/module.py +17 -17
  89. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/module_meta.py +1 -1
  90. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/services.py +17 -17
  91. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/versioning.py +2 -2
  92. simple_module_core-0.0.50/simple_module_core/permission_denied.py +13 -0
  93. simple_module_core-0.0.50/simple_module_core/permissions.py +13 -0
  94. simple_module_core-0.0.50/simple_module_core/principal_permissions.py +13 -0
  95. simple_module_core-0.0.50/simple_module_core/principals.py +11 -0
  96. simple_module_core-0.0.50/simple_module_core/public_routes.py +13 -0
  97. simple_module_core-0.0.50/simple_module_core/rate_limit.py +11 -0
  98. simple_module_core-0.0.50/simple_module_core/redirect_safety.py +13 -0
  99. simple_module_core-0.0.50/simple_module_core/resources.py +11 -0
  100. simple_module_core-0.0.50/simple_module_core/role_directory.py +13 -0
  101. simple_module_core-0.0.50/simple_module_core/runtime/__init__.py +1 -0
  102. simple_module_core-0.0.50/simple_module_core/runtime/_lease_memory.py +73 -0
  103. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/correlation.py +1 -1
  104. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/deprecation.py +1 -1
  105. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/leases.py +23 -61
  106. simple_module_core-0.0.50/simple_module_core/secret_fields.py +13 -0
  107. simple_module_core-0.0.50/simple_module_core/services.py +11 -0
  108. simple_module_core-0.0.50/simple_module_core/settings/__init__.py +1 -0
  109. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/module_settings.py +1 -1
  110. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/secret_fields.py +38 -1
  111. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/settings_hydrate.py +2 -2
  112. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/stored_settings.py +1 -1
  113. simple_module_core-0.0.50/simple_module_core/settings/url_validation.py +32 -0
  114. simple_module_core-0.0.50/simple_module_core/settings_base.py +13 -0
  115. simple_module_core-0.0.50/simple_module_core/settings_hydrate.py +13 -0
  116. simple_module_core-0.0.50/simple_module_core/setup_steps.py +11 -0
  117. simple_module_core-0.0.50/simple_module_core/singleflight.py +13 -0
  118. simple_module_core-0.0.50/simple_module_core/spa_mount.py +11 -0
  119. simple_module_core-0.0.50/simple_module_core/stored_settings.py +13 -0
  120. simple_module_core-0.0.50/simple_module_core/tenancy.py +11 -0
  121. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/tenant_events.py +1 -1
  122. simple_module_core-0.0.50/simple_module_core/user_directory.py +13 -0
  123. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/user_events.py +9 -1
  124. simple_module_core-0.0.50/simple_module_core/versioning.py +11 -0
  125. simple_module_core-0.0.50/simple_module_core/web/__init__.py +1 -0
  126. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/admin_surface.py +2 -2
  127. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/audit_links.py +15 -1
  128. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/body_limits.py +2 -2
  129. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/cors.py +2 -2
  130. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/design_packs.py +1 -1
  131. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/feature_flags.py +7 -6
  132. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/menu.py +1 -1
  133. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/path_rules.py +1 -1
  134. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/public_routes.py +2 -2
  135. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/rate_limit.py +1 -1
  136. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/setup_steps.py +1 -1
  137. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/spa_mount.py +1 -1
  138. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_core_role_directory.py +1 -1
  139. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_core_user_directory.py +27 -2
  140. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_permission_catalogue.py +1 -1
  141. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_permission_sources.py +1 -1
  142. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_permissions.py +1 -1
  143. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_permissions_admin_principal.py +1 -1
  144. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_principal_composition.py +2 -2
  145. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_tenant_exists.py +1 -1
  146. simple_module_core-0.0.50/tests/access/test_tenant_slug.py +21 -0
  147. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_admin_surface_diagnostics.py +1 -1
  148. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_core_data_compatibility_doctor.py +1 -1
  149. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics.py +3 -3
  150. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_expression_index_diagnostics.py +1 -1
  151. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_module_diagnostics.py +7 -7
  152. simple_module_core-0.0.50/tests/diagnostics/test_sm003_imported_constants.py +169 -0
  153. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm003_page_render.py +22 -16
  154. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm009_dynamic_coupling.py +2 -2
  155. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_core_inline_delivery_context.py +2 -2
  156. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_core_invalidation_refresh.py +3 -3
  157. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_durable_events.py +3 -3
  158. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_events.py +1 -1
  159. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_events_inline.py +2 -2
  160. simple_module_core-0.0.50/tests/eventing/test_events_sync_handlers.py +139 -0
  161. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation.py +1 -1
  162. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation_dedup.py +2 -2
  163. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation_handlers.py +1 -1
  164. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/localization}/test_i18n.py +1 -1
  165. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/localization}/test_i18n_overrides.py +1 -1
  166. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/mailer}/test_core_mail_resolution.py +3 -3
  167. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/mailer}/test_mail_attachments.py +3 -3
  168. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/mailer}/test_mail_headers.py +3 -3
  169. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/mailer}/test_mail_reply_to.py +4 -3
  170. simple_module_core-0.0.50/tests/migrations/test_resolve_project_root.py +107 -0
  171. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_auth_provider_capability.py +2 -2
  172. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_auth_provider_selection.py +5 -5
  173. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_core_app_state.py +1 -1
  174. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_core_discovery_stale_sys_path.py +4 -4
  175. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_core_lifecycle_docs.py +2 -2
  176. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_discovery.py +6 -6
  177. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_discovery_missing_deps.py +5 -5
  178. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_discovery_selection.py +4 -4
  179. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_module_base.py +10 -10
  180. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_module_defaults.py +1 -1
  181. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_module_discovery_versions.py +3 -3
  182. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_services.py +1 -1
  183. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_versioning.py +7 -7
  184. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/runtime}/test_core_datetimes.py +1 -1
  185. simple_module_core-0.0.50/tests/runtime/test_core_layout_shims.py +54 -0
  186. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/runtime}/test_core_leases.py +1 -1
  187. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/runtime}/test_core_singleflight.py +1 -1
  188. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/runtime}/test_deprecation_helper.py +2 -2
  189. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/runtime}/test_key_derivation.py +2 -2
  190. simple_module_core-0.0.50/tests/runtime/test_lease_listeners.py +131 -0
  191. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/settings}/test_core_module_settings.py +4 -4
  192. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/settings}/test_core_settings_source_cache.py +1 -1
  193. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/settings}/test_dotenv.py +1 -1
  194. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/settings}/test_environments.py +1 -1
  195. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/settings}/test_settings_base.py +37 -2
  196. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_admin_surface.py +1 -1
  197. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_audit_links.py +1 -1
  198. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_csp_registry.py +1 -1
  199. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_design_packs.py +1 -1
  200. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_feature_flags.py +1 -1
  201. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_feature_flags_decorator.py +1 -1
  202. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_health_registry.py +6 -1
  203. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_menu.py +1 -1
  204. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_path_rule_registries.py +2 -2
  205. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_public_routes.py +1 -1
  206. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_public_routes_rate_precedence.py +1 -1
  207. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_redirect_safety.py +1 -1
  208. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/web}/test_registry_overrides.py +9 -5
  209. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/.gitignore +0 -0
  210. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/LICENSE +0 -0
  211. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/activity_feed.py +0 -0
  212. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permission_catalogue.py +0 -0
  213. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permission_denied.py +0 -0
  214. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/__init__.py +0 -0
  215. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_types.py +0 -0
  216. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/durable_events.py +0 -0
  217. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/_i18n_flatten.py +0 -0
  218. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_entry_point_errors.py +0 -0
  219. {simple_module_core-0.0.49 → simple_module_core-0.0.50}/simple_module_core/py.typed +0 -0
  220. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/crypto.py +0 -0
  221. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/datetimes.py +0 -0
  222. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/exceptions.py +0 -0
  223. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/singleflight.py +0 -0
  224. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/dotenv.py +0 -0
  225. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/environments.py +0 -0
  226. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/settings_base.py +0 -0
  227. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/csp.py +0 -0
  228. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/health.py +0 -0
  229. {simple_module_core-0.0.49/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/redirect_safety.py +0 -0
  230. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/access}/test_tenant_roles.py +0 -0
  231. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_css_diagnostics.py +0 -0
  232. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_css_scanner.py +0 -0
  233. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_db_extensions_diagnostics.py +0 -0
  234. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_encoding.py +0 -0
  235. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_fd_output.py +0 -0
  236. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_output.py +0 -0
  237. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_tenancy.py +0 -0
  238. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_doctor_cli_overrides.py +0 -0
  239. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_heavy_task_imports_diagnostics.py +0 -0
  240. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_i18n_diagnostics.py +0 -0
  241. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm034_durable_names.py +0 -0
  242. {simple_module_core-0.0.49/tests → simple_module_core-0.0.50/tests/modules}/test_module_package_conventions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: simple_module_core
3
- Version: 0.0.49
3
+ Version: 0.0.50
4
4
  Summary: Module-system primitives for the simple_module framework — ModuleBase, discovery, diagnostics, events
5
5
  Project-URL: Homepage, https://github.com/antosubash/simple_module_python
6
6
  Project-URL: Repository, https://github.com/antosubash/simple_module_python
@@ -51,7 +51,7 @@ You usually don't install this directly — it's pulled in by `simple_module_hos
51
51
  - `ModuleMeta` — required `meta = ModuleMeta(name=..., depends_on=...)` attribute on each module.
52
52
  - `discover_modules()` — loads all `[project.entry-points.simple_module]` modules, topologically sorts by `depends_on`.
53
53
  - Diagnostic registry — `SM001` missing meta, `SM003` orphan page, `SM008` duplicate name, `SM009` framework→plugin coupling violation, and the rest of the `SM0xx` set through `SM025`.
54
- - Tenant-role vocabulary (`simple_module_core.tenancy`) — `TenantRole`, `TENANT_ROLE_PREFIX`, `tenant_role()`, so any module can map `tenant:<role>` onto its permissions without depending on `tenants`.
54
+ - Tenant-role vocabulary (`simple_module_core.access.tenancy`) — `TenantRole`, `TENANT_ROLE_PREFIX`, `tenant_role()`, so any module can map `tenant:<role>` onto its permissions without depending on `tenants`.
55
55
  - Tiny event-bus (`pyee`) for decoupled module-to-module communication.
56
56
 
57
57
  ## Usage
@@ -18,7 +18,7 @@ You usually don't install this directly — it's pulled in by `simple_module_hos
18
18
  - `ModuleMeta` — required `meta = ModuleMeta(name=..., depends_on=...)` attribute on each module.
19
19
  - `discover_modules()` — loads all `[project.entry-points.simple_module]` modules, topologically sorts by `depends_on`.
20
20
  - Diagnostic registry — `SM001` missing meta, `SM003` orphan page, `SM008` duplicate name, `SM009` framework→plugin coupling violation, and the rest of the `SM0xx` set through `SM025`.
21
- - Tenant-role vocabulary (`simple_module_core.tenancy`) — `TenantRole`, `TENANT_ROLE_PREFIX`, `tenant_role()`, so any module can map `tenant:<role>` onto its permissions without depending on `tenants`.
21
+ - Tenant-role vocabulary (`simple_module_core.access.tenancy`) — `TenantRole`, `TENANT_ROLE_PREFIX`, `tenant_role()`, so any module can map `tenant:<role>` onto its permissions without depending on `tenants`.
22
22
  - Tiny event-bus (`pyee`) for decoupled module-to-module communication.
23
23
 
24
24
  ## Usage
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "simple_module_core"
3
- version = "0.0.49"
3
+ version = "0.0.50"
4
4
  description = "Module-system primitives for the simple_module framework — ModuleBase, discovery, diagnostics, events"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,19 +1,39 @@
1
1
  """SimpleModule Core - Module system, menu, permissions, events, and diagnostics."""
2
2
 
3
- from simple_module_core.admin_surface import AdminSurface
4
- from simple_module_core.audit_links import AuditLink, AuditLinkRegistry, LabelResolver
5
- from simple_module_core.body_limits import BodyLimitRegistry
6
- from simple_module_core.cors import CorsPolicy, CorsPolicyRegistry
7
- from simple_module_core.csp import CspSourceError, CspSourceRegistry
8
- from simple_module_core.data_compatibility import DataCompatibilityIssue
9
- from simple_module_core.design_packs import DesignPack, DesignPackRegistry
3
+ from simple_module_core.access.permissions import PermissionCatalogue, PermissionRegistry
4
+ from simple_module_core.access.principals import PrincipalRegistry
5
+ from simple_module_core.access.resources import (
6
+ ResourcePolicy,
7
+ ResourcePrincipal,
8
+ ResourceType,
9
+ ResourceTypeRegistry,
10
+ )
11
+ from simple_module_core.access.tenancy import (
12
+ TENANT_ROLE_PREFIX,
13
+ TenantRole,
14
+ is_tenant_role,
15
+ tenant_role,
16
+ )
10
17
  from simple_module_core.diagnostics import (
11
18
  DiagnosticLevel,
12
19
  MigrationDiagnostics,
13
20
  print_diagnostics,
14
21
  run_diagnostics,
15
22
  )
16
- from simple_module_core.discovery import (
23
+ from simple_module_core.eventing.durable_events import (
24
+ DurableContext,
25
+ DurableDeliveryUnavailable,
26
+ DurableTransport,
27
+ )
28
+ from simple_module_core.eventing.events import Event, EventBus
29
+ from simple_module_core.eventing.invalidation import (
30
+ Invalidation,
31
+ InvalidationBus,
32
+ InvalidationTransport,
33
+ )
34
+ from simple_module_core.localization.i18n import I18nRegistry, Translator
35
+ from simple_module_core.migrations.data_compatibility import DataCompatibilityIssue
36
+ from simple_module_core.modules.discovery import (
17
37
  DEFAULT_AUTH_PROVIDER,
18
38
  discover_modules,
19
39
  get_module_package_name,
@@ -22,13 +42,13 @@ from simple_module_core.discovery import (
22
42
  select_auth_provider,
23
43
  topological_sort,
24
44
  )
25
- from simple_module_core.durable_events import (
26
- DurableContext,
27
- DurableDeliveryUnavailable,
28
- DurableTransport,
45
+ from simple_module_core.modules.module import ModuleBase, ModuleMeta
46
+ from simple_module_core.modules.services import Services
47
+ from simple_module_core.modules.versioning import (
48
+ FRAMEWORK_API_VERSION,
49
+ check_framework_compatibility,
29
50
  )
30
- from simple_module_core.events import Event, EventBus
31
- from simple_module_core.exceptions import (
51
+ from simple_module_core.runtime.exceptions import (
32
52
  CircularDependencyError,
33
53
  FrameworkVersionError,
34
54
  InvalidModuleError,
@@ -37,7 +57,13 @@ from simple_module_core.exceptions import (
37
57
  NotFoundError,
38
58
  ValidationError,
39
59
  )
40
- from simple_module_core.feature_flags import (
60
+ from simple_module_core.web.admin_surface import AdminSurface
61
+ from simple_module_core.web.audit_links import AuditLink, AuditLinkRegistry, LabelResolver
62
+ from simple_module_core.web.body_limits import BodyLimitRegistry
63
+ from simple_module_core.web.cors import CorsPolicy, CorsPolicyRegistry
64
+ from simple_module_core.web.csp import CspSourceError, CspSourceRegistry
65
+ from simple_module_core.web.design_packs import DesignPack, DesignPackRegistry
66
+ from simple_module_core.web.feature_flags import (
41
67
  FeatureFlagDefinition,
42
68
  FeatureFlagRegistry,
43
69
  feature_flag,
@@ -45,29 +71,16 @@ from simple_module_core.feature_flags import (
45
71
  is_flag_enabled,
46
72
  require_flag,
47
73
  )
48
- from simple_module_core.health import HealthCheck, HealthCheckResult, HealthRegistry, HealthStatus
49
- from simple_module_core.i18n import I18nRegistry, Translator
50
- from simple_module_core.invalidation import (
51
- Invalidation,
52
- InvalidationBus,
53
- InvalidationTransport,
54
- )
55
- from simple_module_core.menu import MenuItem, MenuRegistry, MenuSection
56
- from simple_module_core.module import ModuleBase, ModuleMeta
57
- from simple_module_core.permissions import PermissionCatalogue, PermissionRegistry
58
- from simple_module_core.principals import PrincipalRegistry
59
- from simple_module_core.public_routes import PublicRoute, PublicRouteRegistry
60
- from simple_module_core.resources import (
61
- ResourcePolicy,
62
- ResourcePrincipal,
63
- ResourceType,
64
- ResourceTypeRegistry,
74
+ from simple_module_core.web.health import (
75
+ HealthCheck,
76
+ HealthCheckResult,
77
+ HealthRegistry,
78
+ HealthStatus,
65
79
  )
66
- from simple_module_core.services import Services
67
- from simple_module_core.setup_steps import SetupAction, SetupField, SetupRegistry, SetupStep
68
- from simple_module_core.spa_mount import SpaMount
69
- from simple_module_core.tenancy import TENANT_ROLE_PREFIX, TenantRole, is_tenant_role, tenant_role
70
- from simple_module_core.versioning import FRAMEWORK_API_VERSION, check_framework_compatibility
80
+ from simple_module_core.web.menu import MenuItem, MenuRegistry, MenuSection
81
+ from simple_module_core.web.public_routes import PublicRoute, PublicRouteRegistry
82
+ from simple_module_core.web.setup_steps import SetupAction, SetupField, SetupRegistry, SetupStep
83
+ from simple_module_core.web.spa_mount import SpaMount
71
84
 
72
85
  __all__ = [
73
86
  "DEFAULT_AUTH_PROVIDER",
@@ -24,25 +24,25 @@ import os
24
24
  import sys
25
25
  from pathlib import Path
26
26
 
27
- from simple_module_core._data_doctor import data_compatibility_diagnostics
28
- from simple_module_core._migration_doctor import migration_diagnostics
29
27
  from simple_module_core.diagnostics import (
30
28
  Diagnostic,
31
29
  DiagnosticLevel,
32
30
  print_diagnostics,
33
31
  run_diagnostics,
34
32
  )
33
+ from simple_module_core.diagnostics._data_doctor import data_compatibility_diagnostics
35
34
  from simple_module_core.diagnostics._dependencies import CODE as MISSING_DEPENDENCY_CODE
36
35
  from simple_module_core.diagnostics._expression_index import sqlite_file_index_names
37
36
  from simple_module_core.diagnostics._i18n import unknown_overrides_for
38
- from simple_module_core.discovery import (
37
+ from simple_module_core.diagnostics._migration_doctor import migration_diagnostics
38
+ from simple_module_core.modules.discovery import (
39
39
  discover_modules,
40
40
  resolve_auth_provider,
41
41
  select_auth_provider,
42
42
  topological_sort,
43
43
  )
44
- from simple_module_core.dotenv import absolutize_sqlite_url, find_env_file, parse_dotenv
45
- from simple_module_core.exceptions import InvalidModuleError
44
+ from simple_module_core.runtime.exceptions import InvalidModuleError
45
+ from simple_module_core.settings.dotenv import absolutize_sqlite_url, find_env_file, parse_dotenv
46
46
 
47
47
 
48
48
  def _load_i18n_settings_from_env() -> tuple[list[str] | None, str]:
@@ -0,0 +1 @@
1
+ """Core access area."""
@@ -68,7 +68,7 @@ GrantSource = Callable[[Any, Any], Awaitable[Collection[str]]]
68
68
  How a module that stores grants of its own (``permissions``' per-user grants)
69
69
  gets them into the one set every check reads, without the framework importing
70
70
  it (SM009). Called once per authenticated request by
71
- ``simple_module_hosting.permissions.resolve_principal_permissions``, so a
71
+ ``simple_module_hosting.auth.permissions.resolve_principal_permissions``, so a
72
72
  source that reads the database must cache: it sits on the hot path of every
73
73
  page load.
74
74
  """
@@ -6,7 +6,7 @@ import re
6
6
  from dataclasses import dataclass
7
7
  from typing import Any
8
8
 
9
- from simple_module_core.resources import ResourcePolicy
9
+ from simple_module_core.access.resources import ResourcePolicy
10
10
 
11
11
  ACTION_PUBLISH = "publish"
12
12
  _STATE_KEY = "file_access_policies"
@@ -7,7 +7,7 @@ import time
7
7
  from collections.abc import Callable, Collection
8
8
  from dataclasses import dataclass, field
9
9
 
10
- from simple_module_core._permission_grants import ( # noqa: F401 (re-exported)
10
+ from simple_module_core.access._permission_grants import ( # noqa: F401 (re-exported)
11
11
  ADMIN_ROLE,
12
12
  DEFAULT_ROLE_PERMISSIONS,
13
13
  WILDCARD,
@@ -17,7 +17,7 @@ from simple_module_core._permission_grants import ( # noqa: F401 (re-exported)
17
17
  is_admin,
18
18
  is_admin_principal,
19
19
  )
20
- from simple_module_core.permission_catalogue import PermissionCatalogue
20
+ from simple_module_core.access.permission_catalogue import PermissionCatalogue
21
21
 
22
22
  logger = logging.getLogger(__name__)
23
23
 
@@ -6,14 +6,14 @@ import logging
6
6
  from collections.abc import Iterable
7
7
  from typing import Any
8
8
 
9
- from simple_module_core.permissions import (
9
+ from simple_module_core.access.permissions import (
10
10
  DEFAULT_ROLE_PERMISSIONS,
11
11
  WILDCARD,
12
12
  PermissionRegistry,
13
13
  grants,
14
14
  )
15
- from simple_module_core.resources import ResourcePrincipal
16
- from simple_module_core.tenancy import is_tenant_role
15
+ from simple_module_core.access.resources import ResourcePrincipal
16
+ from simple_module_core.access.tenancy import is_tenant_role
17
17
 
18
18
  logger = logging.getLogger(__name__)
19
19
 
@@ -6,8 +6,8 @@ from collections.abc import Awaitable, Callable, Sequence
6
6
  from dataclasses import dataclass, field
7
7
  from typing import Any
8
8
 
9
- from simple_module_core.permissions import PermissionRegistry
10
- from simple_module_core.user_directory import NullUserDirectory, UserDirectory
9
+ from simple_module_core.access.permissions import PermissionRegistry
10
+ from simple_module_core.access.user_directory import NullUserDirectory, UserDirectory
11
11
 
12
12
  PRINCIPALS_KEY = "sm_principals"
13
13
 
@@ -19,7 +19,7 @@ view but not *action* is a 403.
19
19
  Modules declare their types in ``register_resource_types`` so cross-cutting
20
20
  code (the optional ``sharing`` module) can find a type's policy and load a row
21
21
  by its string id. ``simple_module_core`` stays SQLAlchemy-free: statements are
22
- typed ``Any``; the stock policy lives in ``simple_module_db.resource_policy``.
22
+ typed ``Any``; the stock policy lives in ``simple_module_db.queries.resource_policy``.
23
23
  """
24
24
 
25
25
  from __future__ import annotations
@@ -29,7 +29,7 @@ from collections.abc import Callable, Mapping
29
29
  from dataclasses import dataclass, field
30
30
  from typing import Any, Protocol, runtime_checkable
31
31
 
32
- from simple_module_core.permissions import grants
32
+ from simple_module_core.access.permissions import grants
33
33
 
34
34
  ACTION_VIEW = "view"
35
35
  """Seeing the row at all; what decides 404 versus 403."""
@@ -10,7 +10,7 @@ from dataclasses import dataclass
10
10
  from typing import Any, Protocol, runtime_checkable
11
11
  from uuid import UUID
12
12
 
13
- from simple_module_core.tenancy import is_tenant_role
13
+ from simple_module_core.access.tenancy import is_tenant_role
14
14
 
15
15
  ROLE_DIRECTORY_STATE_ATTR = "role_directory"
16
16
 
@@ -6,7 +6,7 @@ tenant ``admin`` can never be mistaken for the platform ``admin`` role. The
6
6
  ``tenants`` module assigns these; any other module maps them onto its own
7
7
  permissions without depending on ``tenants``::
8
8
 
9
- from simple_module_core.tenancy import TenantRole, tenant_role
9
+ from simple_module_core.access.tenancy import TenantRole, tenant_role
10
10
 
11
11
  registry.map_role(tenant_role(TenantRole.MEMBER), ["files.view"])
12
12
  """
@@ -17,7 +17,12 @@ from collections.abc import Awaitable, Callable, Collection
17
17
  from enum import StrEnum
18
18
  from typing import Any
19
19
 
20
- from simple_module_core.app_state import get_tenant_exists, get_tenant_members
20
+ from simple_module_core.modules.app_state import (
21
+ get_services,
22
+ get_tenant_exists,
23
+ get_tenant_members,
24
+ get_tenant_slug,
25
+ )
21
26
 
22
27
  TENANT_ROLE_PREFIX = "tenant:"
23
28
 
@@ -42,6 +47,21 @@ class TenancyMode(StrEnum):
42
47
  MULTI = "multi"
43
48
 
44
49
 
50
+ def request_tenant_id(request: Any) -> str | None:
51
+ """The effective tenant for authorization and flags, without binding DB scope.
52
+
53
+ Single-tenant hosts publish their install ID on the database state, even
54
+ when requests stay unbound so reads can see every row. Bare apps without
55
+ that state retain their request's tenant; multi-tenant hosts never fall back.
56
+ """
57
+ sm = get_services(request.app)
58
+ if getattr(sm, "tenancy", TenancyMode.SINGLE) is TenancyMode.SINGLE:
59
+ default = getattr(getattr(sm, "db", None), "default_tenant_id", None)
60
+ if default:
61
+ return default
62
+ return getattr(request.state, "tenant_id", None)
63
+
64
+
45
65
  def tenant_role(name: str) -> str:
46
66
  """The effective principal role for membership role ``name``: ``tenant:<name>``.
47
67
 
@@ -80,6 +100,21 @@ async def tenant_exists(app: Any, tenant_id: str) -> bool | None:
80
100
  return bool(await check(tenant_id))
81
101
 
82
102
 
103
+ TenantSlug = Callable[[str], Awaitable[str | None]]
104
+ """``async (tenant_id) -> slug | None``: the human-readable slug of a tenant."""
105
+
106
+
107
+ async def tenant_slug(app: Any, tenant_id: str) -> str | None:
108
+ """The slug of ``tenant_id``, or ``None`` when unknown or no module owns tenants.
109
+
110
+ The ``tenants`` module publishes ``app.state.tenant_slug`` (a :data:`TenantSlug`);
111
+ clients that show or accept a slug (``/api/_meta/whoami``, the CLI's ``--tenant``)
112
+ ask through this without importing that module.
113
+ """
114
+ lookup: TenantSlug | None = get_tenant_slug(app)
115
+ return None if lookup is None else await lookup(tenant_id)
116
+
117
+
83
118
  TenantMembers = Callable[[Any, str, Collection[str] | None], Awaitable[Collection[str]]]
84
119
  """``async (db, tenant_id, user_ids) -> the subset of user_ids that are members``.
85
120
 
@@ -114,8 +149,11 @@ __all__ = [
114
149
  "TenantExists",
115
150
  "TenantMembers",
116
151
  "TenantRole",
152
+ "TenantSlug",
117
153
  "is_tenant_role",
154
+ "request_tenant_id",
118
155
  "tenant_exists",
119
156
  "tenant_member_ids",
120
157
  "tenant_role",
158
+ "tenant_slug",
121
159
  ]
@@ -96,12 +96,15 @@ class UserDirectory(Protocol):
96
96
  exclude_ids: Collection[str] = (),
97
97
  active_only: bool = False,
98
98
  exact_email: bool = False,
99
+ match_email: bool = True,
99
100
  ) -> list[DirectoryUser]:
100
101
  """Users matching *term*, with every filter applied before *limit*.
101
102
 
102
103
  ``include_ids=None`` is unrestricted; an empty collection matches nobody.
103
104
  ``active_only`` excludes disabled accounts too. ``exact_email`` matches
104
105
  only the complete email (case insensitive), never a name or substring.
106
+ ``match_email=False`` restricts substring matching to full names, without
107
+ falling back to email for nameless users. ``exact_email`` takes precedence.
105
108
  Defaults preserve the unrestricted name/email search.
106
109
  """
107
110
  ...
@@ -120,7 +123,23 @@ class UserDirectory(Protocol):
120
123
  ...
121
124
 
122
125
 
123
- class NullUserDirectory:
126
+ @runtime_checkable
127
+ class EmailLookupUserDirectory(UserDirectory, Protocol):
128
+ """Optional exact-email lookup; legacy structural directories stay valid.
129
+
130
+ Providers can inherit this default, or implement the method themselves.
131
+ """
132
+
133
+ async def find_by_email(self, db: Any, email: str) -> DirectoryUser | None:
134
+ """Find one case-insensitive exact email in the directory's usual scope."""
135
+ email = email.strip()
136
+ if not email:
137
+ return None
138
+ found = await self.search(db, email, limit=1, exact_email=True)
139
+ return found[0] if found else None
140
+
141
+
142
+ class NullUserDirectory(EmailLookupUserDirectory):
124
143
  """The directory when no auth provider registered one: it knows nobody."""
125
144
 
126
145
  entity_type: str | None = None
@@ -140,6 +159,7 @@ class NullUserDirectory:
140
159
  exclude_ids: Collection[str] = (),
141
160
  active_only: bool = False,
142
161
  exact_email: bool = False,
162
+ match_email: bool = True,
143
163
  ) -> list[DirectoryUser]:
144
164
  return []
145
165
 
@@ -211,6 +231,7 @@ __all__ = [
211
231
  "USER_DIRECTORY_STATE_ATTR",
212
232
  "DirectoryStats",
213
233
  "DirectoryUser",
234
+ "EmailLookupUserDirectory",
214
235
  "NullUserDirectory",
215
236
  "UserDirectory",
216
237
  "chunked",
@@ -0,0 +1,13 @@
1
+ """Deprecated alias for simple_module_core.access.activity_feed."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.activity_feed",
10
+ remove_in="0.0.52",
11
+ use="simple_module_core.access.activity_feed",
12
+ )
13
+ sys.modules[__name__] = import_module("simple_module_core.access.activity_feed")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.modules.app_state."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.app_state", remove_in="0.0.52", use="simple_module_core.modules.app_state"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.modules.app_state")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.web.audit_links."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.audit_links", remove_in="0.0.52", use="simple_module_core.web.audit_links"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.web.audit_links")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.web.body_limits."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.body_limits", remove_in="0.0.52", use="simple_module_core.web.body_limits"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.web.body_limits")
@@ -0,0 +1,13 @@
1
+ """Deprecated alias for simple_module_core.runtime.correlation."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.correlation",
10
+ remove_in="0.0.52",
11
+ use="simple_module_core.runtime.correlation",
12
+ )
13
+ sys.modules[__name__] = import_module("simple_module_core.runtime.correlation")
@@ -0,0 +1,9 @@
1
+ """Deprecated alias for simple_module_core.web.cors."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module("simple_module_core.cors", remove_in="0.0.52", use="simple_module_core.web.cors")
9
+ sys.modules[__name__] = import_module("simple_module_core.web.cors")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.runtime.crypto."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.crypto", remove_in="0.0.52", use="simple_module_core.runtime.crypto"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.runtime.crypto")
@@ -0,0 +1,9 @@
1
+ """Deprecated alias for simple_module_core.web.csp."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module("simple_module_core.csp", remove_in="0.0.52", use="simple_module_core.web.csp")
9
+ sys.modules[__name__] = import_module("simple_module_core.web.csp")
@@ -0,0 +1,13 @@
1
+ """Deprecated alias for simple_module_core.migrations.data_compatibility."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.data_compatibility",
10
+ remove_in="0.0.52",
11
+ use="simple_module_core.migrations.data_compatibility",
12
+ )
13
+ sys.modules[__name__] = import_module("simple_module_core.migrations.data_compatibility")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.runtime.datetimes."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.datetimes", remove_in="0.0.52", use="simple_module_core.runtime.datetimes"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.runtime.datetimes")
@@ -0,0 +1,13 @@
1
+ """Deprecated alias for simple_module_core.runtime.deprecation."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.deprecation",
10
+ remove_in="0.0.52",
11
+ use="simple_module_core.runtime.deprecation",
12
+ )
13
+ sys.modules[__name__] = import_module("simple_module_core.runtime.deprecation")
@@ -0,0 +1,11 @@
1
+ """Deprecated alias for simple_module_core.web.design_packs."""
2
+
3
+ import sys
4
+ from importlib import import_module
5
+
6
+ from simple_module_core.runtime.deprecation import deprecated_module
7
+
8
+ deprecated_module(
9
+ "simple_module_core.design_packs", remove_in="0.0.52", use="simple_module_core.web.design_packs"
10
+ )
11
+ sys.modules[__name__] = import_module("simple_module_core.web.design_packs")
@@ -4,11 +4,11 @@ from __future__ import annotations
4
4
 
5
5
  from typing import TYPE_CHECKING
6
6
 
7
- from simple_module_core._auth_providers import provides_auth, resembles_auth_provider
8
7
  from simple_module_core.diagnostics._types import Diagnostic, DiagnosticLevel
8
+ from simple_module_core.modules._auth_providers import provides_auth, resembles_auth_provider
9
9
 
10
10
  if TYPE_CHECKING:
11
- from simple_module_core.module import ModuleBase
11
+ from simple_module_core.modules.module import ModuleBase
12
12
 
13
13
 
14
14
  def check_auth_providers(modules: list[ModuleBase]) -> list[Diagnostic]:
@@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
10
10
  from simple_module_core.diagnostics._types import Diagnostic, DiagnosticLevel
11
11
 
12
12
  if TYPE_CHECKING:
13
- from simple_module_core.module import ModuleBase
13
+ from simple_module_core.modules.module import ModuleBase
14
14
 
15
15
  FRAMEWORK_PACKAGES = ("simple_module_core", "simple_module_hosting", "simple_module_db")
16
16
 
@@ -28,7 +28,7 @@ from typing import TYPE_CHECKING
28
28
  from simple_module_core.diagnostics._types import Diagnostic, DiagnosticLevel
29
29
 
30
30
  if TYPE_CHECKING:
31
- from simple_module_core.module import ModuleBase
31
+ from simple_module_core.modules.module import ModuleBase
32
32
 
33
33
  THEME_CSS = "theme.css"
34
34
  STYLES_CSS = "styles.css"
@@ -4,9 +4,9 @@ import asyncio
4
4
  import importlib.util
5
5
  from collections.abc import Sequence
6
6
 
7
- from simple_module_core.data_compatibility import checking_modules
8
7
  from simple_module_core.diagnostics import Diagnostic
9
- from simple_module_core.module import ModuleBase
8
+ from simple_module_core.migrations.data_compatibility import checking_modules
9
+ from simple_module_core.modules.module import ModuleBase
10
10
 
11
11
 
12
12
  def data_compatibility_diagnostics(
@@ -17,6 +17,6 @@ def data_compatibility_diagnostics(
17
17
  return []
18
18
  if not checking_modules(modules):
19
19
  return []
20
- from simple_module_db.data_compatibility import database_compatibility_diagnostics
20
+ from simple_module_db.schema.data_compatibility import database_compatibility_diagnostics
21
21
 
22
22
  return asyncio.run(database_compatibility_diagnostics(modules, database_url))
@@ -12,7 +12,7 @@ from typing import TYPE_CHECKING
12
12
  from simple_module_core.diagnostics._types import Diagnostic, DiagnosticLevel
13
13
 
14
14
  if TYPE_CHECKING:
15
- from simple_module_core.module import ModuleBase
15
+ from simple_module_core.modules.module import ModuleBase
16
16
 
17
17
 
18
18
  def check_db_extensions_need_postgres(mod: ModuleBase, dialect: str | None) -> list[Diagnostic]: