simple-module-core 0.0.48__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.
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/PKG-INFO +2 -2
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/README.md +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/pyproject.toml +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/__init__.py +50 -37
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/__main__.py +5 -5
- simple_module_core-0.0.50/simple_module_core/access/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/_permission_grants.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/file_access.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permissions.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/principal_permissions.py +3 -3
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/principals.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/resources.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/role_directory.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/tenancy.py +40 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/user_directory.py +22 -1
- simple_module_core-0.0.50/simple_module_core/activity_feed.py +13 -0
- simple_module_core-0.0.50/simple_module_core/app_state.py +11 -0
- simple_module_core-0.0.50/simple_module_core/audit_links.py +11 -0
- simple_module_core-0.0.50/simple_module_core/body_limits.py +11 -0
- simple_module_core-0.0.50/simple_module_core/correlation.py +13 -0
- simple_module_core-0.0.50/simple_module_core/cors.py +9 -0
- simple_module_core-0.0.50/simple_module_core/crypto.py +11 -0
- simple_module_core-0.0.50/simple_module_core/csp.py +9 -0
- simple_module_core-0.0.50/simple_module_core/data_compatibility.py +13 -0
- simple_module_core-0.0.50/simple_module_core/datetimes.py +11 -0
- simple_module_core-0.0.50/simple_module_core/deprecation.py +13 -0
- simple_module_core-0.0.50/simple_module_core/design_packs.py +11 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_auth.py +2 -2
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_coupling.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_css.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/diagnostics}/_data_doctor.py +3 -3
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_db_extensions.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_dependencies.py +2 -2
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_durable_names.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_expression_index.py +2 -2
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_heavy_task_imports.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_i18n.py +3 -3
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_inertia_api.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_js_workspace.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_migration.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/diagnostics}/_migration_doctor.py +3 -3
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_module.py +10 -8
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_pages.py +89 -35
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_runner.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_spa_mount.py +1 -1
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_tenancy.py +2 -2
- simple_module_core-0.0.50/simple_module_core/discovery.py +11 -0
- simple_module_core-0.0.50/simple_module_core/dotenv.py +11 -0
- simple_module_core-0.0.50/simple_module_core/durable_events.py +13 -0
- simple_module_core-0.0.50/simple_module_core/environments.py +13 -0
- simple_module_core-0.0.50/simple_module_core/eventing/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/_invalidation_message.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/events.py +32 -6
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/invalidation.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/invalidation_refresh.py +1 -1
- simple_module_core-0.0.50/simple_module_core/events.py +11 -0
- simple_module_core-0.0.50/simple_module_core/exceptions.py +11 -0
- simple_module_core-0.0.50/simple_module_core/feature_flags.py +13 -0
- simple_module_core-0.0.50/simple_module_core/file_access.py +13 -0
- simple_module_core-0.0.50/simple_module_core/health.py +11 -0
- simple_module_core-0.0.50/simple_module_core/i18n.py +11 -0
- simple_module_core-0.0.50/simple_module_core/invalidation.py +13 -0
- simple_module_core-0.0.50/simple_module_core/invalidation_refresh.py +13 -0
- simple_module_core-0.0.50/simple_module_core/leases.py +11 -0
- simple_module_core-0.0.50/simple_module_core/localization/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/_i18n_translator.py +3 -3
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/i18n.py +3 -3
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/i18n_overrides.py +1 -1
- simple_module_core-0.0.50/simple_module_core/mail.py +11 -0
- simple_module_core-0.0.50/simple_module_core/mailer/__init__.py +1 -0
- simple_module_core-0.0.50/simple_module_core/mailer/_mail_headers.py +68 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/mailer}/mail.py +6 -12
- simple_module_core-0.0.50/simple_module_core/menu.py +9 -0
- simple_module_core-0.0.50/simple_module_core/migration_support/__init__.py +13 -0
- simple_module_core-0.0.50/simple_module_core/migrations/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/migrations}/data_compatibility.py +3 -3
- simple_module_core-0.0.48/simple_module_core/migration_support/__init__.py → simple_module_core-0.0.50/simple_module_core/migrations/support.py +4 -1
- simple_module_core-0.0.50/simple_module_core/module.py +11 -0
- simple_module_core-0.0.50/simple_module_core/module_meta.py +13 -0
- simple_module_core-0.0.50/simple_module_core/module_settings.py +13 -0
- simple_module_core-0.0.50/simple_module_core/modules/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_auth_providers.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_module_conventions.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_module_ordering.py +3 -3
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_request_hooks.py +6 -6
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/app_state.py +19 -11
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/discovery.py +10 -10
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/module.py +17 -17
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/module_meta.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/services.py +17 -17
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/versioning.py +2 -2
- simple_module_core-0.0.50/simple_module_core/permission_denied.py +13 -0
- simple_module_core-0.0.50/simple_module_core/permissions.py +13 -0
- simple_module_core-0.0.50/simple_module_core/principal_permissions.py +13 -0
- simple_module_core-0.0.50/simple_module_core/principals.py +11 -0
- simple_module_core-0.0.50/simple_module_core/public_routes.py +13 -0
- simple_module_core-0.0.50/simple_module_core/rate_limit.py +11 -0
- simple_module_core-0.0.50/simple_module_core/redirect_safety.py +13 -0
- simple_module_core-0.0.50/simple_module_core/resources.py +11 -0
- simple_module_core-0.0.50/simple_module_core/role_directory.py +13 -0
- simple_module_core-0.0.50/simple_module_core/runtime/__init__.py +1 -0
- simple_module_core-0.0.50/simple_module_core/runtime/_lease_memory.py +73 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/correlation.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/deprecation.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/leases.py +23 -61
- simple_module_core-0.0.50/simple_module_core/secret_fields.py +13 -0
- simple_module_core-0.0.50/simple_module_core/services.py +11 -0
- simple_module_core-0.0.50/simple_module_core/settings/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/module_settings.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/secret_fields.py +38 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/settings_hydrate.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/stored_settings.py +1 -1
- simple_module_core-0.0.50/simple_module_core/settings/url_validation.py +32 -0
- simple_module_core-0.0.50/simple_module_core/settings_base.py +13 -0
- simple_module_core-0.0.50/simple_module_core/settings_hydrate.py +13 -0
- simple_module_core-0.0.50/simple_module_core/setup_steps.py +11 -0
- simple_module_core-0.0.50/simple_module_core/singleflight.py +13 -0
- simple_module_core-0.0.50/simple_module_core/spa_mount.py +11 -0
- simple_module_core-0.0.50/simple_module_core/stored_settings.py +13 -0
- simple_module_core-0.0.50/simple_module_core/tenancy.py +11 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/tenant_events.py +1 -1
- simple_module_core-0.0.50/simple_module_core/user_directory.py +13 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/user_events.py +9 -1
- simple_module_core-0.0.50/simple_module_core/versioning.py +11 -0
- simple_module_core-0.0.50/simple_module_core/web/__init__.py +1 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/admin_surface.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/audit_links.py +15 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/body_limits.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/cors.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/design_packs.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/feature_flags.py +7 -6
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/menu.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/path_rules.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/public_routes.py +2 -2
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/rate_limit.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/setup_steps.py +1 -1
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/spa_mount.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_core_role_directory.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_core_user_directory.py +27 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_permission_catalogue.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_permission_sources.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_permissions.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_permissions_admin_principal.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_principal_composition.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_tenant_exists.py +1 -1
- simple_module_core-0.0.50/tests/access/test_tenant_slug.py +21 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_admin_surface_diagnostics.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_core_data_compatibility_doctor.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics.py +3 -3
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_expression_index_diagnostics.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_module_diagnostics.py +7 -7
- simple_module_core-0.0.50/tests/diagnostics/test_sm003_imported_constants.py +169 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm003_page_render.py +22 -16
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm009_dynamic_coupling.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_core_inline_delivery_context.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_core_invalidation_refresh.py +3 -3
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_durable_events.py +3 -3
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_events.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_events_inline.py +2 -2
- simple_module_core-0.0.50/tests/eventing/test_events_sync_handlers.py +139 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation_dedup.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/eventing}/test_invalidation_handlers.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/localization}/test_i18n.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/localization}/test_i18n_overrides.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/mailer}/test_core_mail_resolution.py +3 -3
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/mailer}/test_mail_attachments.py +3 -3
- simple_module_core-0.0.50/tests/mailer/test_mail_headers.py +94 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/mailer}/test_mail_reply_to.py +4 -3
- simple_module_core-0.0.50/tests/migrations/test_resolve_project_root.py +107 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_auth_provider_capability.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_auth_provider_selection.py +5 -5
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_core_app_state.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_core_discovery_stale_sys_path.py +4 -4
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_core_lifecycle_docs.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_discovery.py +6 -6
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_discovery_missing_deps.py +5 -5
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_discovery_selection.py +4 -4
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_module_base.py +10 -10
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_module_defaults.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_module_discovery_versions.py +3 -3
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_services.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/modules}/test_versioning.py +7 -7
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/runtime}/test_core_datetimes.py +1 -1
- simple_module_core-0.0.50/tests/runtime/test_core_layout_shims.py +54 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/runtime}/test_core_leases.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/runtime}/test_core_singleflight.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/runtime}/test_deprecation_helper.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/runtime}/test_key_derivation.py +2 -2
- simple_module_core-0.0.50/tests/runtime/test_lease_listeners.py +131 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/settings}/test_core_module_settings.py +4 -4
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/settings}/test_core_settings_source_cache.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/settings}/test_dotenv.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/settings}/test_environments.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/settings}/test_settings_base.py +37 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_admin_surface.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_audit_links.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_csp_registry.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_design_packs.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_feature_flags.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_feature_flags_decorator.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_health_registry.py +6 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_menu.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_path_rule_registries.py +2 -2
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_public_routes.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_public_routes_rate_precedence.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_redirect_safety.py +1 -1
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/web}/test_registry_overrides.py +9 -5
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/.gitignore +0 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/LICENSE +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/activity_feed.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permission_catalogue.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/access}/permission_denied.py +0 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/__init__.py +0 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_types.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/eventing}/durable_events.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/localization}/_i18n_flatten.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/modules}/_entry_point_errors.py +0 -0
- {simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/py.typed +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/crypto.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/datetimes.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/exceptions.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/runtime}/singleflight.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/dotenv.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/environments.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/settings}/settings_base.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/csp.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/health.py +0 -0
- {simple_module_core-0.0.48/simple_module_core → simple_module_core-0.0.50/simple_module_core/web}/redirect_safety.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/access}/test_tenant_roles.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_css_diagnostics.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_css_scanner.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_db_extensions_diagnostics.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_encoding.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_fd_output.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_output.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_diagnostics_tenancy.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_doctor_cli_overrides.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_heavy_task_imports_diagnostics.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_i18n_diagnostics.py +0 -0
- {simple_module_core-0.0.48/tests → simple_module_core-0.0.50/tests/diagnostics}/test_sm034_durable_names.py +0 -0
- {simple_module_core-0.0.48/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.
|
|
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,19 +1,39 @@
|
|
|
1
1
|
"""SimpleModule Core - Module system, menu, permissions, events, and diagnostics."""
|
|
2
2
|
|
|
3
|
-
from simple_module_core.
|
|
4
|
-
from simple_module_core.
|
|
5
|
-
from simple_module_core.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
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.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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.
|
|
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.
|
|
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
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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.
|
|
67
|
-
from simple_module_core.
|
|
68
|
-
from simple_module_core.
|
|
69
|
-
from simple_module_core.
|
|
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.
|
|
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.
|
|
45
|
-
from simple_module_core.
|
|
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
|
|
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
|
-
|
|
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")
|
{simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_auth.py
RENAMED
|
@@ -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]:
|
{simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_coupling.py
RENAMED
|
@@ -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
|
|
{simple_module_core-0.0.48 → simple_module_core-0.0.50}/simple_module_core/diagnostics/_css.py
RENAMED
|
@@ -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.
|
|
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]:
|