simple-module-hosting 0.0.45__tar.gz → 0.0.46__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_hosting-0.0.45 → simple_module_hosting-0.0.46}/PKG-INFO +4 -4
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/pyproject.toml +4 -4
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_build.py +2 -2
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_openapi.py +1 -1
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_route_guard.py +1 -1
- simple_module_hosting-0.0.46/simple_module_hosting/admin_overview/__init__.py +42 -0
- simple_module_hosting-0.0.46/simple_module_hosting/admin_overview/pages/Overview.tsx +93 -0
- simple_module_hosting-0.0.46/simple_module_hosting/admin_overview/routes.py +55 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/app_builder.py +2 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/assets.py +22 -16
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/host_cli.py +5 -1
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/de.json +5 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/en.json +5 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/es.json +5 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/manifest.py +15 -6
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/migrations.py +6 -2
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_host_cli.py +13 -0
- simple_module_hosting-0.0.46/tests/test_hosting_framework_pages_reserved.py +21 -0
- simple_module_hosting-0.0.46/tests-js/hosting_AdminOverview.test.tsx +51 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tsconfig.json +2 -2
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/.gitignore +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/LICENSE +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/README.md +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/__init__.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/__main__.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_anonymous.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_api_version.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_app_boot.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_body_limit.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_boot_checks.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_cors.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_csp_dynamic.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_db_health.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_deferred_startup.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_dev_boot.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_error_handlers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_error_negotiation.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_error_page.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_favicon.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_forwarded_host.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_host_services.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_host_settings_support.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_hydrate_step.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_json.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_target.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_inertia_setup.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_inertia_shared.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_insecure_transport.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_lease_redis.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_lifespan.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_middleware_pipeline.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_module_routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_observability.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_phase_helpers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_preapp_config.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_process_services.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_project_root.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_rate_limit.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_rate_limit_keys.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_rate_limit_store.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_registrations.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_request_guard_responses.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_route_access.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_route_paths.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_secret_key.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_security_headers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_server_timing.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_settings_registration.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_spa_mount.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_table_coverage.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_tenant.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/bootstrap_settings.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/csrf.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/data_compatibility.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/db_options.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/errors.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/health.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/host_settings.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/i18n_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/i18n_manifest.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/i18n_middleware.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/i18n_routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/inertia_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/inertia_utils.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/leases.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/log_sinks.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/logging.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/maintenance.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/middleware.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/page_globs.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/pagination.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/path_matching.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/permissions.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/public_access.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/py.typed +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/rate_limit_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/redirects.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/resource_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/sentry.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/sentry_scrub.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/sentry_scrub_text.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/session.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/settings.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_gate.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/__init__.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/_migration_lock.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/components/ConnectionList.tsx +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/components/StepForm.tsx +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/migrate.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/pages/Wizard.tsx +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/payloads.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/setup_wizard/routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/shared_props.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/static_files.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/tenancy.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/token_guard.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/ui_locales/de.json +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/ui_locales/en.json +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/ui_locales/es.json +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/_hosting_settings_db.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/_resacc_models.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/_sentry_transport.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/conftest.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_api_error_negotiation.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_app.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_auth_provider_setting.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_boot_config_hardening.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_boot_drift_check.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_branding_head.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_build_time_settings_marked.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_check_migrations.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_check_migrations_expression_note.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_csp_module_sources.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_db_health_check.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_design_packs_wiring.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_diagnostics_state.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_error_page_shared_props.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_error_status_coverage.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_favicon_default.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_forwarded_host.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_grant_sources.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_health.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_home_url_default.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_host_settings_fields.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_api_version_cache.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_asset_version.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_catalog_json_cache.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_config_sources.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_cors_api.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_cors_unset.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_csp_nonce.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_csp_providers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_csrf.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_csrf_shared_prop.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_data_compatibility.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_error_handling_policy.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_error_json_and_session_cookie.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_health_bounded.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_inertia_body_validation.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_inertia_cache.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_inertia_validation_errors.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_lazy_layout_catalogs.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_lease_backends.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_lease_selection.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_lease_timeouts.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_lifespan_cleanup.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_log_sinks.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_migration_target.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_openapi.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_openapi_security.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_pagination_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_permissions.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_platform_permissions.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_public_access.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_public_error_page.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_public_path_boundaries.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_security_static_headers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_sentry.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_sentry_scrub.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_sentry_scrub_gaps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_server_timing.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_spa_mount_nonce.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_table_coverage.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_hosting_ui_assets.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_build_overrides.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_manifest.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_manifest_published_target.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_types_cover_installed_modules.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_i18n_ui_namespace.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_inertia_i18n_shared_props.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_inertia_protocol_middleware.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_inertia_shared_providers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_insecure_transport_warning.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_invalidation_wiring.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_lifespan_deferred_startup.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_lifespan_order.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_locale_middleware.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_logging.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_maintenance_mode.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_manifest.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_menu_providers_wiring.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_menu_urls_are_canonical.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_merge_host_settings_strict.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_middleware_order.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_migration_listing.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_migration_multihead.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_migration_script_cache.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_native_link_prefixes_strip.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_preapp_config.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_preapp_invalid_values.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_preapp_read_failures.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_precompressed_static.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_principal_permissions_claim.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_proxy_headers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_rate_limit_rules_redis.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_rate_limit_rules_registry.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_rate_limit_store_shared.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_redirects.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_request_guard_auth_parity.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_request_guard_body_limit.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_request_guard_body_limit_middleware_read.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_request_guard_body_limit_started.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_request_guard_rate_limit.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_resource_deps.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_resource_policy_owned.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_resource_policy_parity.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_resource_types_wiring.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_response_compression.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_route_guard.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_route_guard_fastapi_contract.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_route_paths.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_secret_key_bootstrap.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_server_rendered_head.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_session_cookie_secure.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_session_cookie_security.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_session_cookie_window.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_session_vary_dedupe.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_settings_i18n.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_settings_secrets.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_gate.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_gate_single_flight.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_migrate_error_redaction.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_migrate_worker_lock.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_public_routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_registry.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_setup_routes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_spa_mounts_541.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_sqlite_path_anchor.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_static_caching.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_strict_discovery_wiring.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenancy_api.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenant_middleware.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenant_resolver_diagnostic.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenant_resolver_types.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenant_scope_helpers.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_tenant_source.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_token_guard_effective_route.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_token_route_guard.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_translator_dep.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests/test_view_prefixes.py +0 -0
- {simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/tests-js/hosting_SetupWizard.test.tsx +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_hosting
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.46
|
|
4
4
|
Summary: FastAPI + Inertia.js host runtime for simple_module — app_builder, middleware stack, CLI (sm / simple-module), scaffolding
|
|
5
5
|
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
@@ -26,9 +26,9 @@ Requires-Dist: fastapi<0.163,>=0.140
|
|
|
26
26
|
Requires-Dist: httpx<0.29,>=0.27
|
|
27
27
|
Requires-Dist: itsdangerous<3,>=2.0
|
|
28
28
|
Requires-Dist: jinja2<4,>=3.1
|
|
29
|
-
Requires-Dist: simple-module-core==0.0.
|
|
30
|
-
Requires-Dist: simple-module-db==0.0.
|
|
31
|
-
Requires-Dist: simple-module-inertia==0.0.
|
|
29
|
+
Requires-Dist: simple-module-core==0.0.46
|
|
30
|
+
Requires-Dist: simple-module-db==0.0.46
|
|
31
|
+
Requires-Dist: simple-module-inertia==0.0.46
|
|
32
32
|
Requires-Dist: starlette<2,>=0.44
|
|
33
33
|
Requires-Dist: tomlkit<0.16,>=0.13
|
|
34
34
|
Requires-Dist: uvicorn[standard]<0.55,>=0.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_hosting"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.46"
|
|
4
4
|
description = "FastAPI + Inertia.js host runtime for simple_module — app_builder, middleware stack, CLI (sm / simple-module), scaffolding"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -29,9 +29,9 @@ dependencies = [
|
|
|
29
29
|
# it directly — out-of-tree hosts have nothing else pulling it in.
|
|
30
30
|
"itsdangerous>=2.0,<3",
|
|
31
31
|
"jinja2>=3.1,<4",
|
|
32
|
-
"simple_module_core==0.0.
|
|
33
|
-
"simple_module_db==0.0.
|
|
34
|
-
"simple_module_inertia==0.0.
|
|
32
|
+
"simple_module_core==0.0.46",
|
|
33
|
+
"simple_module_db==0.0.46",
|
|
34
|
+
"simple_module_inertia==0.0.46",
|
|
35
35
|
"starlette>=0.44,<2",
|
|
36
36
|
"tomlkit>=0.13,<0.16",
|
|
37
37
|
"uvicorn[standard]>=0.34,<0.55",
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_build.py
RENAMED
|
@@ -32,8 +32,8 @@ def build_i18n_registry(
|
|
|
32
32
|
for namespace, locale_dir in mod.locale_dirs().items():
|
|
33
33
|
registry.add_source(namespace, locale_dir, audience=audience)
|
|
34
34
|
|
|
35
|
-
# The framework's own catalog — the setup wizard
|
|
36
|
-
# so
|
|
35
|
+
# The framework's own catalog — the setup wizard and the admin overview ship
|
|
36
|
+
# with this package, so their strings must too, whatever host is serving it.
|
|
37
37
|
hosting_locales = Path(__file__).resolve().parent / "locales"
|
|
38
38
|
registry.add_source("hosting", hosting_locales)
|
|
39
39
|
extra_sources.append(("simple_module_hosting", "hosting", hosting_locales))
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_route_guard.py
RENAMED
|
@@ -96,7 +96,7 @@ def guard_included_routers(app: FastAPI, *, warm: bool = True) -> None:
|
|
|
96
96
|
if isinstance(route, _IncludedRouter) and not isinstance(route.matches, _PrefixGuard):
|
|
97
97
|
guard = _PrefixGuard(route)
|
|
98
98
|
guard._current_prefix()
|
|
99
|
-
route.matches = guard
|
|
99
|
+
route.matches = guard
|
|
100
100
|
if warm:
|
|
101
101
|
for _ in route.effective_route_contexts():
|
|
102
102
|
pass
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""The ``/admin`` overview, shipped with the framework.
|
|
2
|
+
|
|
3
|
+
The sidebar's "Administration" link and the AdminLayout badge point every app
|
|
4
|
+
at ``/admin``. The page used to live in this repository's own host, so an app
|
|
5
|
+
made by ``smpy new`` answered 404 there (GH #914). ``create_app`` now mounts
|
|
6
|
+
it for every host, the way it mounts the setup wizard (GH #351).
|
|
7
|
+
|
|
8
|
+
No module owns the admin section as a whole — it is assembled from whatever
|
|
9
|
+
modules happen to be installed — so the framework serves it rather than one
|
|
10
|
+
plugin claiming ``/admin`` as its ``view_prefix``.
|
|
11
|
+
|
|
12
|
+
The page is registered in ``modules.generated.ts`` under :data:`PAGES_NAME`,
|
|
13
|
+
like a module's ``pages/``, so a host's Vite build picks it up from the wheel.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
#: The ``modules.generated.ts`` key the overview's pages are registered under.
|
|
21
|
+
PAGES_NAME = "Admin"
|
|
22
|
+
|
|
23
|
+
#: ``pages/Overview.tsx`` as an Inertia page key.
|
|
24
|
+
PAGE_OVERVIEW = f"{PAGES_NAME}/Overview"
|
|
25
|
+
|
|
26
|
+
_PACKAGE_DIR = Path(__file__).resolve().parent
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def package_dir() -> Path:
|
|
30
|
+
"""The overview's frontend root."""
|
|
31
|
+
return _PACKAGE_DIR
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def pages_dir() -> Path:
|
|
35
|
+
return _PACKAGE_DIR / "pages"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def mount_admin_overview(app) -> None:
|
|
39
|
+
"""Mount ``/admin``; every other ``/admin/*`` path belongs to a module."""
|
|
40
|
+
from simple_module_hosting.admin_overview.routes import router
|
|
41
|
+
|
|
42
|
+
app.include_router(router)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Head, Link } from '@inertiajs/react';
|
|
2
|
+
import { keys, useT } from '@simple-module-py/i18n';
|
|
3
|
+
import { NavIcon } from '@simple-module-py/ui/components/NavIcon';
|
|
4
|
+
import { PageShell } from '@simple-module-py/ui/components/PageShell';
|
|
5
|
+
import { usePageProps } from '@simple-module-py/ui/hooks/usePageProps';
|
|
6
|
+
import { AdminLayout } from '@simple-module-py/ui/layouts/AdminLayout';
|
|
7
|
+
import type { MenuItem } from '@simple-module-py/ui/types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Admin section landing page.
|
|
11
|
+
*
|
|
12
|
+
* Built from the `adminSidebar` shared prop rather than a list of its own:
|
|
13
|
+
* that prop is already filtered by the viewer's roles and permissions, so a
|
|
14
|
+
* card here can never advertise a screen its owner cannot open — and adding a
|
|
15
|
+
* module contributes a card with no change to this file.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** Group entries in registration order, so cards match sidebar order. */
|
|
19
|
+
function groupItems(items: MenuItem[]): [string, MenuItem[]][] {
|
|
20
|
+
const groups = new Map<string, MenuItem[]>();
|
|
21
|
+
for (const item of items) {
|
|
22
|
+
const key = item.group || '';
|
|
23
|
+
const existing = groups.get(key);
|
|
24
|
+
if (existing) existing.push(item);
|
|
25
|
+
else groups.set(key, [item]);
|
|
26
|
+
}
|
|
27
|
+
return [...groups.entries()];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ToolCard({ item }: { item: MenuItem }) {
|
|
31
|
+
return (
|
|
32
|
+
<Link
|
|
33
|
+
href={item.url}
|
|
34
|
+
className="group flex items-start gap-3 rounded-lg border border-border bg-card p-4 transition-colors hover:border-primary/40 hover:bg-accent/40"
|
|
35
|
+
>
|
|
36
|
+
<span className="mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary">
|
|
37
|
+
<NavIcon name={item.icon} />
|
|
38
|
+
</span>
|
|
39
|
+
<span className="min-w-0">
|
|
40
|
+
<span className="block truncate font-medium text-foreground group-hover:text-primary">
|
|
41
|
+
{item.label}
|
|
42
|
+
</span>
|
|
43
|
+
{/* The url is the card's only disambiguator when two tools share a
|
|
44
|
+
label, so clipping it silently makes them indistinguishable. */}
|
|
45
|
+
<span title={item.url} className="block truncate text-sm text-muted-foreground">
|
|
46
|
+
{item.url}
|
|
47
|
+
</span>
|
|
48
|
+
</span>
|
|
49
|
+
</Link>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function AdminPage() {
|
|
54
|
+
const { t } = useT();
|
|
55
|
+
const { menus } = usePageProps();
|
|
56
|
+
const items = menus?.adminSidebar ?? [];
|
|
57
|
+
const grouped = groupItems(items);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<Head title={t(keys.hosting.admin.title)} />
|
|
62
|
+
<PageShell
|
|
63
|
+
title={t(keys.hosting.admin.title)}
|
|
64
|
+
description={t(keys.hosting.admin.description)}
|
|
65
|
+
>
|
|
66
|
+
{items.length === 0 ? (
|
|
67
|
+
<p className="text-sm text-muted-foreground">{t(keys.hosting.admin.empty)}</p>
|
|
68
|
+
) : (
|
|
69
|
+
<div className="space-y-8">
|
|
70
|
+
{grouped.map(([group, cards]) => (
|
|
71
|
+
<section key={group || 'ungrouped'}>
|
|
72
|
+
{group && (
|
|
73
|
+
<h2 className="mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
74
|
+
{group}
|
|
75
|
+
</h2>
|
|
76
|
+
)}
|
|
77
|
+
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
78
|
+
{cards.map((item) => (
|
|
79
|
+
<ToolCard key={item.url} item={item} />
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
</section>
|
|
83
|
+
))}
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
</PageShell>
|
|
87
|
+
</>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
AdminPage.layout = [AdminLayout];
|
|
92
|
+
|
|
93
|
+
export default AdminPage;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""``GET /admin`` — the landing page of the admin section."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from fastapi import APIRouter, HTTPException, Request
|
|
6
|
+
from simple_module_core.permissions import is_admin_principal
|
|
7
|
+
from simple_module_inertia import InertiaResponse
|
|
8
|
+
|
|
9
|
+
from simple_module_hosting.admin_overview import PAGE_OVERVIEW
|
|
10
|
+
from simple_module_hosting.inertia_deps import InertiaDep
|
|
11
|
+
|
|
12
|
+
router = APIRouter()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@router.get("/admin", response_model=None, include_in_schema=False)
|
|
16
|
+
@router.get("/admin/", response_model=None, include_in_schema=False)
|
|
17
|
+
async def admin_overview(request: Request, inertia: InertiaDep) -> InertiaResponse:
|
|
18
|
+
"""Landing page for the admin section.
|
|
19
|
+
|
|
20
|
+
Renders no list of its own — the page reads the ``adminSidebar`` shared
|
|
21
|
+
prop, which is already filtered by the viewer's roles and permissions. A
|
|
22
|
+
second hand-maintained list here would drift from the sidebar the moment
|
|
23
|
+
a module was added.
|
|
24
|
+
|
|
25
|
+
AuthMiddleware has already rejected anonymous visitors by this point; the
|
|
26
|
+
check below is the authorisation half, which it does not do.
|
|
27
|
+
|
|
28
|
+
Admission mirrors what the page renders: anyone with at least one entry in
|
|
29
|
+
the admin sidebar can open it. Gating on the ``admin`` role alone was
|
|
30
|
+
inconsistent — the sidebar is filtered by roles *and* permissions, so a
|
|
31
|
+
custom role holding, say, ``settings.view`` reaches ``/admin/settings/``,
|
|
32
|
+
sees the AdminLayout badge pointing here, and would be met with a 403 for
|
|
33
|
+
a page that would have listed the one tool they can use.
|
|
34
|
+
|
|
35
|
+
Admins are admitted regardless, so an install with no admin modules still
|
|
36
|
+
reaches the page's own empty state rather than a 403.
|
|
37
|
+
"""
|
|
38
|
+
user = getattr(request.state, "user", None)
|
|
39
|
+
if user is None:
|
|
40
|
+
raise HTTPException(status_code=403, detail="Administrator access required")
|
|
41
|
+
if not (is_admin_principal(user) or _has_admin_entries(request)):
|
|
42
|
+
raise HTTPException(status_code=403, detail="Administrator access required")
|
|
43
|
+
return await inertia.render(PAGE_OVERVIEW, {})
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _has_admin_entries(request: Request) -> bool:
|
|
47
|
+
"""Whether the viewer has any admin sidebar entry.
|
|
48
|
+
|
|
49
|
+
Read from the shared props ``InertiaLayoutDataMiddleware`` already built
|
|
50
|
+
for this request, so admission and rendering cannot disagree — recomputing
|
|
51
|
+
the filter here is how the two drift apart.
|
|
52
|
+
"""
|
|
53
|
+
shared = getattr(request.state, "inertia_shared", None) or {}
|
|
54
|
+
menus = shared.get("menus") or {}
|
|
55
|
+
return bool(menus.get("adminSidebar"))
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/app_builder.py
RENAMED
|
@@ -48,6 +48,7 @@ from simple_module_hosting._settings_registration import (
|
|
|
48
48
|
check_settings_registration,
|
|
49
49
|
register_host_settings,
|
|
50
50
|
)
|
|
51
|
+
from simple_module_hosting.admin_overview import mount_admin_overview
|
|
51
52
|
from simple_module_hosting.health import router as health_router
|
|
52
53
|
from simple_module_hosting.i18n_manifest import build_i18n_registry
|
|
53
54
|
from simple_module_hosting.i18n_routes import router as i18n_router
|
|
@@ -217,6 +218,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
217
218
|
app.include_router(health_router)
|
|
218
219
|
app.include_router(i18n_router) # /i18n/set-locale — LocaleSwitcher posts here
|
|
219
220
|
mount_setup_wizard(app, setup_registry) # /setup — what SetupMiddleware redirects to
|
|
221
|
+
mount_admin_overview(app) # /admin — where the sidebar and AdminLayout badge link
|
|
220
222
|
|
|
221
223
|
mount_host_static(app, _PROJECT_ROOT)
|
|
222
224
|
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/assets.py
RENAMED
|
@@ -143,26 +143,32 @@ def compute_module_assets(modules: Sequence[ModuleBase]) -> list[ModuleAssets]:
|
|
|
143
143
|
return result
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def framework_assets() -> ModuleAssets:
|
|
147
|
-
"""The
|
|
146
|
+
def framework_assets() -> list[ModuleAssets]:
|
|
147
|
+
"""The frontends the framework itself ships: ``/setup`` and ``/admin``.
|
|
148
148
|
|
|
149
149
|
Emitted through the same records as a module's assets so a host's
|
|
150
|
-
``vite.config.ts`` treats
|
|
151
|
-
bare imports resolved against the host's ``node_modules``,
|
|
150
|
+
``vite.config.ts`` treats them identically — allowed in ``server.fs``, their
|
|
151
|
+
bare imports resolved against the host's ``node_modules``, their classes
|
|
152
152
|
scanned by Tailwind — with nothing for the host to add by hand.
|
|
153
153
|
"""
|
|
154
|
-
from simple_module_hosting
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
154
|
+
from simple_module_hosting import admin_overview, setup_wizard
|
|
155
|
+
|
|
156
|
+
result = []
|
|
157
|
+
for package in (setup_wizard, admin_overview):
|
|
158
|
+
root = package.package_dir()
|
|
159
|
+
components = root / COMPONENTS_DIR
|
|
160
|
+
result.append(
|
|
161
|
+
ModuleAssets(
|
|
162
|
+
name=package.PAGES_NAME,
|
|
163
|
+
package_name=package.__name__,
|
|
164
|
+
package_dir=root,
|
|
165
|
+
pages_dir=package.pages_dir(),
|
|
166
|
+
theme_css=None,
|
|
167
|
+
styles_css=None,
|
|
168
|
+
components_dir=components if components.is_dir() else None,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
return result
|
|
166
172
|
|
|
167
173
|
|
|
168
174
|
_CSS_HEADER = """\
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/host_cli.py
RENAMED
|
@@ -45,7 +45,11 @@ def gen_pages(
|
|
|
45
45
|
# Skip the auth provider the host won't boot — its pages would otherwise
|
|
46
46
|
# ship in the bundle with no view endpoint able to render them.
|
|
47
47
|
modules = select_auth_provider(discover_modules(), resolve_auth_provider())
|
|
48
|
-
|
|
48
|
+
try:
|
|
49
|
+
written = write_module_pages_manifest(modules, host_dir)
|
|
50
|
+
except ValueError as exc:
|
|
51
|
+
typer.echo(f"ERROR: {exc}", err=True)
|
|
52
|
+
raise typer.Exit(code=1) from exc
|
|
49
53
|
typer.echo(
|
|
50
54
|
f"Module pages manifest: {len(modules)} module(s) "
|
|
51
55
|
f"→ {written['manifest'].name}, {written['generated'].name}, "
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/de.json
RENAMED
|
@@ -24,5 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"errors": {
|
|
26
26
|
"token_not_allowed": "API-Tokens können auf dieser Route nicht verwendet werden. Verwenden Sie eine angemeldete Sitzung oder eine Route, deren Berechtigung zum Geltungsbereich des Tokens gehört."
|
|
27
|
+
},
|
|
28
|
+
"admin": {
|
|
29
|
+
"title": "Administration",
|
|
30
|
+
"description": "Benutzer, Zugriff, Darstellung und Systemeinstellungen verwalten.",
|
|
31
|
+
"empty": "Für Ihr Konto sind keine Administrationswerkzeuge verfügbar."
|
|
27
32
|
}
|
|
28
33
|
}
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/en.json
RENAMED
|
@@ -24,5 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"errors": {
|
|
26
26
|
"token_not_allowed": "API tokens cannot be used on this route. Use a signed-in session, or a route gated by a permission the token is scoped to."
|
|
27
|
+
},
|
|
28
|
+
"admin": {
|
|
29
|
+
"title": "Administration",
|
|
30
|
+
"description": "Manage users, access, appearance and system configuration.",
|
|
31
|
+
"empty": "No admin tools are available to your account."
|
|
27
32
|
}
|
|
28
33
|
}
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/locales/es.json
RENAMED
|
@@ -24,5 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"errors": {
|
|
26
26
|
"token_not_allowed": "Los tokens de API no se pueden usar en esta ruta. Usa una sesión iniciada o una ruta protegida por un permiso incluido en el token."
|
|
27
|
+
},
|
|
28
|
+
"admin": {
|
|
29
|
+
"title": "Administración",
|
|
30
|
+
"description": "Gestiona usuarios, accesos, apariencia y configuración del sistema.",
|
|
31
|
+
"empty": "No hay herramientas de administración disponibles para tu cuenta."
|
|
27
32
|
}
|
|
28
33
|
}
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/manifest.py
RENAMED
|
@@ -160,13 +160,22 @@ def write_module_pages_manifest(
|
|
|
160
160
|
if repo_root is None:
|
|
161
161
|
repo_root = repo_root_from_client_app(output_dir)
|
|
162
162
|
|
|
163
|
-
# The framework's own
|
|
164
|
-
# modules', so every host's resolver finds
|
|
165
|
-
#
|
|
163
|
+
# The framework's own frontends (the setup wizard, the admin overview) are
|
|
164
|
+
# emitted alongside the modules', so every host's resolver finds
|
|
165
|
+
# ``Setup/Wizard`` and ``Admin/Overview`` and its Vite config serves them
|
|
166
|
+
# from the wheel — with no host-side file to add.
|
|
166
167
|
framework = framework_assets()
|
|
167
168
|
pages_map = dict(compute_module_pages(modules))
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
for entry in framework:
|
|
170
|
+
if entry.pages_dir is None:
|
|
171
|
+
continue
|
|
172
|
+
if entry.name in pages_map:
|
|
173
|
+
# Overwriting would silently unregister the module's pages.
|
|
174
|
+
raise ValueError(
|
|
175
|
+
f"Module name {entry.name!r} is reserved for the framework's own pages "
|
|
176
|
+
f"({entry.package_name}); rename the module's ModuleMeta.name."
|
|
177
|
+
)
|
|
178
|
+
pages_map[entry.name] = entry.pages_dir
|
|
170
179
|
|
|
171
180
|
manifest_path = output_dir / "modules.manifest.json"
|
|
172
181
|
manifest_payload = {name: path.as_posix() for name, path in pages_map.items()}
|
|
@@ -193,7 +202,7 @@ def write_module_pages_manifest(
|
|
|
193
202
|
|
|
194
203
|
# Rendered from the richer asset record rather than pages_map, so that a
|
|
195
204
|
# module shipping CSS but no pages/ still contributes its stylesheets.
|
|
196
|
-
assets = [*compute_module_assets(modules), framework]
|
|
205
|
+
assets = [*compute_module_assets(modules), *framework]
|
|
197
206
|
css_path = output_dir / "modules.generated.css"
|
|
198
207
|
css_text = render_modules_css(assets, in_repo=lambda p: _is_in_repo_module(p, repo_root))
|
|
199
208
|
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/migrations.py
RENAMED
|
@@ -248,7 +248,10 @@ def _note_unverifiable_expression_indexes(engine) -> None:
|
|
|
248
248
|
if engine.dialect.name != "sqlite":
|
|
249
249
|
return
|
|
250
250
|
try:
|
|
251
|
-
from simple_module_core.diagnostics._expression_index import
|
|
251
|
+
from simple_module_core.diagnostics._expression_index import (
|
|
252
|
+
expression_index_advice,
|
|
253
|
+
find_expression_indexes,
|
|
254
|
+
)
|
|
252
255
|
from simple_module_db.base import all_module_bases
|
|
253
256
|
|
|
254
257
|
found = find_expression_indexes(
|
|
@@ -260,8 +263,9 @@ def _note_unverifiable_expression_indexes(engine) -> None:
|
|
|
260
263
|
if found:
|
|
261
264
|
logger.info(
|
|
262
265
|
"Migrations are at head, but SQLite cannot verify expression indexes (%s); "
|
|
263
|
-
"
|
|
266
|
+
"%s. See SM026.",
|
|
264
267
|
", ".join(f"{index} ({table})" for table, index in found),
|
|
268
|
+
expression_index_advice(),
|
|
265
269
|
)
|
|
266
270
|
|
|
267
271
|
|
|
@@ -31,6 +31,19 @@ def test_gen_pages_errors_on_missing_client_app(tmp_path: Path) -> None:
|
|
|
31
31
|
assert "not found" in result.output.lower() or "not found" in (result.stderr or "").lower()
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
def test_gen_pages_reports_manifest_error_without_traceback(
|
|
35
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
36
|
+
) -> None:
|
|
37
|
+
def _boom(*_args: object, **_kwargs: object) -> None:
|
|
38
|
+
raise ValueError("duplicate page 'X'")
|
|
39
|
+
|
|
40
|
+
monkeypatch.setattr("simple_module_hosting.host_cli.write_module_pages_manifest", _boom)
|
|
41
|
+
result = CliRunner().invoke(app, ["gen-pages", "--host-dir", str(tmp_path)])
|
|
42
|
+
assert result.exit_code == 1
|
|
43
|
+
assert "ERROR: duplicate page 'X'" in result.output
|
|
44
|
+
assert not isinstance(result.exception, ValueError)
|
|
45
|
+
|
|
46
|
+
|
|
34
47
|
@pytest.mark.parametrize(
|
|
35
48
|
"module_target",
|
|
36
49
|
["simple_module_hosting", "simple_module_hosting.host_cli"],
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""The framework's own page names cannot be taken by a module.
|
|
2
|
+
|
|
3
|
+
``gen-pages`` registers the setup wizard and the admin overview next to the
|
|
4
|
+
modules' pages, keyed by name. A module named ``Admin`` or ``Setup`` would
|
|
5
|
+
otherwise have its entry overwritten and its pages stop resolving, silently.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import pytest
|
|
11
|
+
from simple_module_hosting import manifest
|
|
12
|
+
from simple_module_hosting.admin_overview import PAGES_NAME
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_a_module_named_like_framework_pages_is_refused(tmp_path, monkeypatch) -> None:
|
|
16
|
+
pages = tmp_path / "pages"
|
|
17
|
+
pages.mkdir()
|
|
18
|
+
monkeypatch.setattr(manifest, "compute_module_pages", lambda modules: {PAGES_NAME: pages})
|
|
19
|
+
|
|
20
|
+
with pytest.raises(ValueError, match="reserved"):
|
|
21
|
+
manifest.write_module_pages_manifest([], tmp_path / "client_app", repo_root=tmp_path)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
|
+
import { configureI18n, keys } from '@simple-module-py/i18n';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
6
|
+
import en from '../simple_module_hosting/locales/en.json';
|
|
7
|
+
|
|
8
|
+
// The real catalog, so a missing or misspelt string fails here rather than
|
|
9
|
+
// rendering its key.
|
|
10
|
+
configureI18n({
|
|
11
|
+
locale: 'en',
|
|
12
|
+
messages: Object.fromEntries(
|
|
13
|
+
Object.entries(en.admin).map(([key, value]) => [`hosting.admin.${key}`, value]),
|
|
14
|
+
),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const props = vi.hoisted(() => ({ menus: { adminSidebar: [] as unknown[] } }));
|
|
18
|
+
|
|
19
|
+
vi.mock('@inertiajs/react', async (importOriginal) => ({
|
|
20
|
+
...(await importOriginal<typeof import('@inertiajs/react')>()),
|
|
21
|
+
usePage: () => ({ props, url: '/admin' }),
|
|
22
|
+
Head: () => null,
|
|
23
|
+
Link: ({ href, children, ...rest }: { href: string; children: React.ReactNode }) => (
|
|
24
|
+
<a href={href} {...rest}>
|
|
25
|
+
{children}
|
|
26
|
+
</a>
|
|
27
|
+
),
|
|
28
|
+
}));
|
|
29
|
+
vi.mock('@simple-module-py/ui/hooks/usePageProps', () => ({ usePageProps: () => props }));
|
|
30
|
+
|
|
31
|
+
import Overview from '../simple_module_hosting/admin_overview/pages/Overview';
|
|
32
|
+
|
|
33
|
+
describe('Admin overview', () => {
|
|
34
|
+
it('shows the empty state when the viewer has no admin tools', () => {
|
|
35
|
+
props.menus.adminSidebar = [];
|
|
36
|
+
render(<Overview />);
|
|
37
|
+
expect(screen.getByText(en.admin.empty)).toBeInTheDocument();
|
|
38
|
+
expect(screen.queryByText(keys.hosting.admin.empty)).not.toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('renders one card per admin sidebar entry, grouped', () => {
|
|
42
|
+
props.menus.adminSidebar = [
|
|
43
|
+
{ label: 'Users', url: '/admin/users', icon: 'users', group: 'Access' },
|
|
44
|
+
{ label: 'Settings', url: '/admin/settings', icon: 'settings', group: 'System' },
|
|
45
|
+
];
|
|
46
|
+
render(<Overview />);
|
|
47
|
+
expect(screen.getByRole('link', { name: /Users/ })).toHaveAttribute('href', '/admin/users');
|
|
48
|
+
expect(screen.getByText('Access')).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByText('System')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
// Type-checks the pages simple_module_hosting ships itself (the /setup
|
|
3
|
-
// wizard). They are bundled by each host's Vite
|
|
4
|
-
// wheel, so nothing else in the repo would compile them.
|
|
3
|
+
// wizard and the /admin overview). They are bundled by each host's Vite
|
|
4
|
+
// build from the installed wheel, so nothing else in the repo would compile them.
|
|
5
5
|
"extends": "@simple-module-py/tsconfig/base.json",
|
|
6
6
|
"compilerOptions": {
|
|
7
7
|
"paths": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/__init__.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/__main__.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_anonymous.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_api_version.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_app_boot.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_body_limit.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_boot_checks.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_cors.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_csp_dynamic.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_db_health.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_dev_boot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_error_page.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_favicon.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_hydrate_step.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_json.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_i18n_target.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_lease_redis.py
RENAMED
|
File without changes
|
{simple_module_hosting-0.0.45 → simple_module_hosting-0.0.46}/simple_module_hosting/_lifespan.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|