simple-module-settings 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_settings-0.0.48 → simple_module_settings-0.0.50}/PKG-INFO +6 -6
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/README.md +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/pyproject.toml +4 -4
- simple_module_settings-0.0.50/settings/__main__.py +6 -0
- simple_module_settings-0.0.50/settings/cli.py +187 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/accessor.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/events.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/schemas.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_announce.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_listing.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_row_masking.py +4 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_secrets.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_unique_write.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/constants.py +4 -16
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/errors.py +8 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/invalidation.py +7 -7
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/service.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/services.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/settings.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/tenant_scope.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/tenant_view.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/locales/de.json +46 -25
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/locales/en.json +46 -25
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/models.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module.py +9 -9
- simple_module_settings-0.0.50/settings/module_settings/connection.py +49 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/discovery.py +21 -9
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/props.py +2 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/reload.py +45 -5
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/store.py +21 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/Browse.tsx +1 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/Edit.tsx +2 -1
- simple_module_settings-0.0.50/settings/pages/ModulesEdit.tsx +222 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/api.generated.ts +95 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/i18n.generated.ts +67 -25
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/FieldInput.tsx +57 -39
- simple_module_settings-0.0.50/settings/ui/components/FieldSource.tsx +107 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/JsonInput.tsx +23 -4
- simple_module_settings-0.0.50/settings/ui/components/ModuleFieldRow.tsx +170 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/ModuleForm.tsx +139 -86
- simple_module_settings-0.0.50/settings/ui/components/ModuleNav.tsx +150 -0
- simple_module_settings-0.0.50/settings/ui/components/SaveBar.tsx +58 -0
- simple_module_settings-0.0.50/settings/ui/components/SecretInput.tsx +73 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/StoreTable.tsx +2 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/TestConnectionButton.tsx +7 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/ValueInput.tsx +2 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/validation-errors.ts +35 -1
- simple_module_settings-0.0.50/settings/ui/utils/field-text.ts +122 -0
- simple_module_settings-0.0.50/settings/ui/utils/form-state.ts +26 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/deps.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/_create_form.py +4 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/api.py +8 -6
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/module_api.py +70 -34
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/tenant_api.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/views.py +28 -42
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/known_keys.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/contracts/test_settings_events.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/contracts/test_settings_framework_reexports.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/contracts/test_settings_schemas.py +1 -1
- simple_module_settings-0.0.50/tests/core/module/test_settings_cli_entrypoint.py +50 -0
- simple_module_settings-0.0.50/tests/core/module/test_settings_cli_options.py +269 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/module/test_settings_host_restart_flags.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/module/test_settings_module.py +2 -5
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/secrets/test_settings_secret_json_roundtrip.py +4 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/secrets/test_settings_secret_masking.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/secrets/test_settings_secret_urls.py +4 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/secrets/test_settings_store_secret_masking.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/secrets/test_settings_typed_secret_masking.py +60 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_commit_invalidation.py +9 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_duplicate_and_race.py +4 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_generic_module_guard.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_group_metadata.py +4 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_internal_metadata.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_service.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/tenant/test_settings_tenant_settings.py +5 -5
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_control_hint.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_env_pinned.py +29 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_env_unprefixed.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_field_sources.py +32 -2
- simple_module_settings-0.0.50/tests/module_settings/fields/test_settings_field_title.py +22 -0
- simple_module_settings-0.0.50/tests/module_settings/fields/test_settings_field_translations.py +96 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_lenient_related_fields_validators.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_module_settings.py +2 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_module_settings_render.py +1 -1
- simple_module_settings-0.0.50/tests/module_settings/fields/test_settings_secret_presence.py +29 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_testable_checks.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/hydrate/test_settings_hydrate.py +4 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/hydrate/test_settings_hydrate_related_fields.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/hydrate/test_settings_module_registry.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/hydrate/test_settings_registration.py +4 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/hydrate/test_settings_reload.py +29 -4
- simple_module_settings-0.0.50/tests/module_settings/hydrate/test_settings_url_save.py +152 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/store/test_settings_store.py +48 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/store/test_settings_store_filters.py +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_clear_route_per_scope.py +1 -1
- simple_module_settings-0.0.50/tests/web/api/test_settings_error_surrogates.py +68 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_module_api.py +47 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_module_api_json_fields.py +1 -1
- simple_module_settings-0.0.50/tests/web/api/test_settings_mutation_needs_view.py +60 -0
- simple_module_settings-0.0.50/tests/web/api/test_settings_test_connection_token.py +65 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_upload_key_delete.py +1 -1
- simple_module_settings-0.0.50/tests/web/api/test_settings_url_validation.py +62 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_view_authz.py +1 -1
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/FieldInput.extensions.test.tsx +14 -2
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/JsonFields.test.tsx +4 -4
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/ModuleForm.test.tsx +19 -17
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/ModulesEdit.test.tsx +3 -3
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/RestartHint.test.tsx +1 -1
- simple_module_settings-0.0.50/tests-js/admin_shell_a11y.test.tsx +158 -0
- simple_module_settings-0.0.50/tests-js/field-text.test.tsx +98 -0
- simple_module_settings-0.0.50/tests-js/settings_BoolDescription.test.tsx +56 -0
- simple_module_settings-0.0.50/tests-js/settings_EditorNavigation.test.tsx +284 -0
- simple_module_settings-0.0.50/tests-js/settings_FieldDescription.test.tsx +98 -0
- simple_module_settings-0.0.50/tests-js/settings_FieldErrors.test.tsx +138 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/settings_ModuleFieldLayout.test.tsx +22 -11
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/settings_ModuleFormRevert.test.tsx +53 -19
- simple_module_settings-0.0.50/tests-js/settings_SecretInput.test.tsx +181 -0
- simple_module_settings-0.0.50/tests-js/settings_TranslatedEditor.test.tsx +184 -0
- simple_module_settings-0.0.50/tests-js/settings_validation-errors.test.ts +157 -0
- simple_module_settings-0.0.48/settings/cli.py +0 -78
- simple_module_settings-0.0.48/settings/pages/ModulesEdit.tsx +0 -160
- simple_module_settings-0.0.48/settings/ui/components/FieldSource.tsx +0 -77
- simple_module_settings-0.0.48/settings/ui/components/ModuleFieldRow.tsx +0 -85
- simple_module_settings-0.0.48/tests-js/settings_validation-errors.test.ts +0 -37
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/.gitignore +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/LICENSE +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/package.json +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/invalidation.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/registry.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_managed_keys.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/env_vars.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/exceptions.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/module_settings/_field_meta.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/Create.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/routes.ts +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/pages/types.ts +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/py.typed +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/FormLevelError.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/KeyField.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/ResolvedValue.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/ScopeTabs.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/StoreCards.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/ui/components/last-test.ts +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/browse_query.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/web/endpoints/__init__.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/contracts/test_settings_accessor.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/module/test_settings_cli_import.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_concurrent_overrides.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_default_clears_override.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/core/service/test_settings_domain_errors.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/module_settings/fields/test_settings_module_settings_serialize.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_api.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests/web/api/test_settings_known_keys_meta.py +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/ScopeTabs.test.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/settings_FormLevelError.test.tsx +0 -0
- {simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/tests-js/settings_TestConnectionButton.test.tsx +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_settings
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.50
|
|
4
4
|
Summary: Runtime settings UI — modules plug their own settings panels into a shared admin view
|
|
5
5
|
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
@@ -21,9 +21,9 @@ Classifier: Topic :: Internet :: WWW/HTTP
|
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
22
|
Classifier: Typing :: Typed
|
|
23
23
|
Requires-Python: >=3.12
|
|
24
|
-
Requires-Dist: simple-module-core==0.0.
|
|
25
|
-
Requires-Dist: simple-module-db==0.0.
|
|
26
|
-
Requires-Dist: simple-module-hosting==0.0.
|
|
24
|
+
Requires-Dist: simple-module-core==0.0.50
|
|
25
|
+
Requires-Dist: simple-module-db==0.0.50
|
|
26
|
+
Requires-Dist: simple-module-hosting==0.0.50
|
|
27
27
|
Requires-Dist: typer<0.28,>=0.12
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
|
|
@@ -55,7 +55,7 @@ class OrdersModule(ModuleBase):
|
|
|
55
55
|
meta = ModuleMeta(name="orders")
|
|
56
56
|
|
|
57
57
|
def register_settings(self, app: FastAPI) -> None:
|
|
58
|
-
from simple_module_core.module_settings import register_module_settings
|
|
58
|
+
from simple_module_core.settings.module_settings import register_module_settings
|
|
59
59
|
from orders.settings import OrdersSettings
|
|
60
60
|
from orders.services import OrdersServices
|
|
61
61
|
|
|
@@ -64,7 +64,7 @@ class OrdersModule(ModuleBase):
|
|
|
64
64
|
)
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
That surfaces the module's settings fields under `/admin/settings/`, hydrated from the DB store at startup. The settings class is normally a `simple_module_core.settings_base.DbBackedSettings` (DB is the only source). Registration and hydration live in the framework (#500); this module adds the admin editor, hot reload and the key/value API.
|
|
67
|
+
That surfaces the module's settings fields under `/admin/settings/`, hydrated from the DB store at startup. The settings class is normally a `simple_module_core.settings.settings_base.DbBackedSettings` (DB is the only source). Registration and hydration live in the framework (#500); this module adds the admin editor, hot reload and the key/value API.
|
|
68
68
|
|
|
69
69
|
## Depends on
|
|
70
70
|
|
|
@@ -26,7 +26,7 @@ class OrdersModule(ModuleBase):
|
|
|
26
26
|
meta = ModuleMeta(name="orders")
|
|
27
27
|
|
|
28
28
|
def register_settings(self, app: FastAPI) -> None:
|
|
29
|
-
from simple_module_core.module_settings import register_module_settings
|
|
29
|
+
from simple_module_core.settings.module_settings import register_module_settings
|
|
30
30
|
from orders.settings import OrdersSettings
|
|
31
31
|
from orders.services import OrdersServices
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ class OrdersModule(ModuleBase):
|
|
|
35
35
|
)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
That surfaces the module's settings fields under `/admin/settings/`, hydrated from the DB store at startup. The settings class is normally a `simple_module_core.settings_base.DbBackedSettings` (DB is the only source). Registration and hydration live in the framework (#500); this module adds the admin editor, hot reload and the key/value API.
|
|
38
|
+
That surfaces the module's settings fields under `/admin/settings/`, hydrated from the DB store at startup. The settings class is normally a `simple_module_core.settings.settings_base.DbBackedSettings` (DB is the only source). Registration and hydration live in the framework (#500); this module adds the admin editor, hot reload and the key/value API.
|
|
39
39
|
|
|
40
40
|
## Depends on
|
|
41
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_settings"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.50"
|
|
4
4
|
description = "Runtime settings UI — modules plug their own settings panels into a shared admin view"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -21,9 +21,9 @@ classifiers = [
|
|
|
21
21
|
"Typing :: Typed",
|
|
22
22
|
]
|
|
23
23
|
dependencies = [
|
|
24
|
-
"simple_module_core==0.0.
|
|
25
|
-
"simple_module_db==0.0.
|
|
26
|
-
"simple_module_hosting==0.0.
|
|
24
|
+
"simple_module_core==0.0.50",
|
|
25
|
+
"simple_module_db==0.0.50",
|
|
26
|
+
"simple_module_hosting==0.0.50",
|
|
27
27
|
"typer>=0.12,<0.28",
|
|
28
28
|
]
|
|
29
29
|
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""One-shot migration of legacy environment variables into DB settings."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
import os
|
|
7
|
+
from collections.abc import Mapping, Sequence
|
|
8
|
+
from typing import Annotated
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
from fastapi import FastAPI
|
|
12
|
+
from pydantic import ValidationError
|
|
13
|
+
from pydantic_settings import BaseSettings
|
|
14
|
+
from simple_module_core.settings.dotenv import find_env_file, parse_dotenv
|
|
15
|
+
from simple_module_core.settings.module_settings import module_settings_registry
|
|
16
|
+
from simple_module_core.settings.settings_hydrate import value_type_for_field
|
|
17
|
+
from simple_module_core.settings.stored_settings import parse_stored_value
|
|
18
|
+
|
|
19
|
+
from settings.contracts.schemas import SettingUpsert, SettingValueType
|
|
20
|
+
from settings.core.env_vars import env_prefix_for
|
|
21
|
+
from settings.module_settings.store import SettingsStore
|
|
22
|
+
|
|
23
|
+
app = typer.Typer(help="Settings module administration.", no_args_is_help=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.callback()
|
|
27
|
+
def settings_commands() -> None:
|
|
28
|
+
"""Keep the command group when used standalone or mounted under smpy."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _validate_import(
|
|
32
|
+
package: str,
|
|
33
|
+
cls: type[BaseSettings],
|
|
34
|
+
existing: dict[str, tuple[str, str]],
|
|
35
|
+
candidates: dict[str, tuple[str, str]],
|
|
36
|
+
) -> bool:
|
|
37
|
+
"""Check stored payloads and the merged model before any writes."""
|
|
38
|
+
prefix = env_prefix_for(package)
|
|
39
|
+
merged = {}
|
|
40
|
+
valid = True
|
|
41
|
+
for field_name, (raw, vtype) in {**existing, **candidates}.items():
|
|
42
|
+
if field_name not in cls.model_fields:
|
|
43
|
+
continue
|
|
44
|
+
env_name = f"{prefix}{field_name.upper()}"
|
|
45
|
+
try:
|
|
46
|
+
merged[field_name] = parse_stored_value(raw, vtype)
|
|
47
|
+
if field_name in candidates:
|
|
48
|
+
SettingUpsert(value=raw, value_type=SettingValueType(vtype))
|
|
49
|
+
except ValidationError as exc:
|
|
50
|
+
valid = False
|
|
51
|
+
for error in exc.errors(include_input=False, include_context=False, include_url=False):
|
|
52
|
+
typer.echo(f"Error {env_name}: invalid stored value ({error['type']}).", err=True)
|
|
53
|
+
except ValueError:
|
|
54
|
+
valid = False
|
|
55
|
+
typer.echo(f"Error {env_name}: cannot parse as {vtype}.", err=True)
|
|
56
|
+
if not valid:
|
|
57
|
+
return False
|
|
58
|
+
try:
|
|
59
|
+
# Hydration skips env-pinned fields; imports must validate their future DB values too.
|
|
60
|
+
# Bypass BaseSettings sources: unselected env/dotenv must not validate this batch.
|
|
61
|
+
cls.__pydantic_validator__.validate_python(merged, self_instance=cls.__new__(cls))
|
|
62
|
+
except ValidationError as exc:
|
|
63
|
+
for error in exc.errors(include_input=False, include_context=False, include_url=False):
|
|
64
|
+
loc = error["loc"]
|
|
65
|
+
fields = [str(loc[0])] if loc and loc[0] in cls.model_fields else list(candidates)
|
|
66
|
+
# Like stored_settings, omit messages: validators can embed transformed secrets.
|
|
67
|
+
for field_name in fields:
|
|
68
|
+
typer.echo(
|
|
69
|
+
f"Error {prefix}{field_name.upper()}: validation failed ({error['type']}).",
|
|
70
|
+
err=True,
|
|
71
|
+
)
|
|
72
|
+
return False
|
|
73
|
+
return True
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
async def import_from_env_impl(
|
|
77
|
+
app_inst: FastAPI,
|
|
78
|
+
store: SettingsStore,
|
|
79
|
+
environ: Mapping[str, str] | None = None,
|
|
80
|
+
*,
|
|
81
|
+
only: Sequence[str] = (),
|
|
82
|
+
prefixes: Sequence[str] = (),
|
|
83
|
+
) -> int:
|
|
84
|
+
"""Validate a selected batch, then write SYSTEM overrides and print names.
|
|
85
|
+
|
|
86
|
+
The project .env is overlaid by process env (real env wins). Filters are
|
|
87
|
+
additive. Only registered DB settings fields are eligible: there is no
|
|
88
|
+
general env-only field marker. Any validation failure aborts all writes.
|
|
89
|
+
"""
|
|
90
|
+
if environ is None:
|
|
91
|
+
environ = {**parse_dotenv(find_env_file()), **os.environ}
|
|
92
|
+
registry = module_settings_registry(app_inst)
|
|
93
|
+
selected = {name.lower() for name in only}
|
|
94
|
+
known = {name.lower() for name in registry.all_packages()}
|
|
95
|
+
if unknown := selected - known:
|
|
96
|
+
raise typer.BadParameter(
|
|
97
|
+
f"Unknown module(s): {', '.join(sorted(unknown))}. "
|
|
98
|
+
f"Known modules: {', '.join(registry.all_packages())}",
|
|
99
|
+
param_hint="--only",
|
|
100
|
+
)
|
|
101
|
+
prefixes = tuple(prefix.upper() for prefix in prefixes)
|
|
102
|
+
|
|
103
|
+
def matches(package: str, env_name: str) -> bool:
|
|
104
|
+
return (
|
|
105
|
+
not (selected or prefixes)
|
|
106
|
+
or package.lower() in selected
|
|
107
|
+
or env_name.startswith(prefixes)
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
known_vars: set[str] = set()
|
|
111
|
+
pending: list[tuple[str, str, str, str]] = []
|
|
112
|
+
failed = False
|
|
113
|
+
for package, cls in registry.items():
|
|
114
|
+
prefix = env_prefix_for(package)
|
|
115
|
+
candidates = {}
|
|
116
|
+
for field_name in cls.model_fields:
|
|
117
|
+
env_name = f"{prefix}{field_name.upper()}"
|
|
118
|
+
known_vars.add(env_name)
|
|
119
|
+
if env_name in environ and matches(package, env_name):
|
|
120
|
+
candidates[field_name] = (environ[env_name], value_type_for_field(cls, field_name))
|
|
121
|
+
if not candidates:
|
|
122
|
+
continue
|
|
123
|
+
existing = await store.get_overrides(package)
|
|
124
|
+
if not _validate_import(package, cls, existing, candidates):
|
|
125
|
+
failed = True
|
|
126
|
+
continue
|
|
127
|
+
pending.extend((package, name, raw, vtype) for name, (raw, vtype) in candidates.items())
|
|
128
|
+
|
|
129
|
+
selected_prefixes = tuple(env_prefix_for(name) for name in known if name in selected)
|
|
130
|
+
for env_name in sorted(environ):
|
|
131
|
+
if (
|
|
132
|
+
env_name.startswith("SM_")
|
|
133
|
+
and env_name not in known_vars
|
|
134
|
+
and (not (selected or prefixes) or env_name.startswith(selected_prefixes + prefixes))
|
|
135
|
+
):
|
|
136
|
+
typer.echo(
|
|
137
|
+
f"Skipped {env_name}: no registered DB settings field (env-only or unknown)."
|
|
138
|
+
)
|
|
139
|
+
if failed:
|
|
140
|
+
raise typer.Exit(code=1)
|
|
141
|
+
for package, field_name, raw, vtype in pending:
|
|
142
|
+
await store.set_override(package, field_name, raw, vtype)
|
|
143
|
+
typer.echo(f"Stored {package}.{field_name}")
|
|
144
|
+
return len(pending)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@app.command("import-from-env")
|
|
148
|
+
def import_from_env(
|
|
149
|
+
only: Annotated[
|
|
150
|
+
list[str] | None, typer.Option("--only", help="Settings package to import; repeatable.")
|
|
151
|
+
] = None,
|
|
152
|
+
prefix: Annotated[
|
|
153
|
+
list[str] | None,
|
|
154
|
+
typer.Option("--prefix", help="Environment variable prefix to import; repeatable."),
|
|
155
|
+
] = None,
|
|
156
|
+
) -> None:
|
|
157
|
+
"""Validate and import selected SM_<PREFIX>_<FIELD> variables into the DB."""
|
|
158
|
+
from simple_module_hosting.boot.app_builder import create_app
|
|
159
|
+
from simple_module_hosting.config.settings import Settings
|
|
160
|
+
|
|
161
|
+
from settings.core.service import SettingService
|
|
162
|
+
|
|
163
|
+
fastapi_app = create_app(Settings())
|
|
164
|
+
|
|
165
|
+
async def run() -> int:
|
|
166
|
+
async with (
|
|
167
|
+
fastapi_app.router.lifespan_context(fastapi_app),
|
|
168
|
+
fastapi_app.state.sm.db.session_factory() as session,
|
|
169
|
+
):
|
|
170
|
+
store = SettingsStore(SettingService(session))
|
|
171
|
+
try:
|
|
172
|
+
n = await import_from_env_impl(
|
|
173
|
+
fastapi_app, store, only=only or (), prefixes=prefix or ()
|
|
174
|
+
)
|
|
175
|
+
except typer.Exit:
|
|
176
|
+
typer.echo("Imported 0 override(s) from environment.")
|
|
177
|
+
raise
|
|
178
|
+
await session.commit()
|
|
179
|
+
typer.echo(f"Imported {n} override(s) from environment.")
|
|
180
|
+
if n == 0 and find_env_file().is_file():
|
|
181
|
+
typer.echo(
|
|
182
|
+
"Hint: variables must be named SM_<MODULE>_<FIELD> "
|
|
183
|
+
"(e.g. SM_MAIL_SMTP_PORT); none in the environment or .env matched the filters."
|
|
184
|
+
)
|
|
185
|
+
return 0
|
|
186
|
+
|
|
187
|
+
raise typer.Exit(code=asyncio.run(run()))
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/accessor.py
RENAMED
|
@@ -23,7 +23,7 @@ import json
|
|
|
23
23
|
from collections.abc import Callable
|
|
24
24
|
from typing import TYPE_CHECKING, Any, Final
|
|
25
25
|
|
|
26
|
-
from simple_module_db.stored_settings import SYSTEM_SCOPE_ID
|
|
26
|
+
from simple_module_db.queries.stored_settings import SYSTEM_SCOPE_ID
|
|
27
27
|
|
|
28
28
|
from settings.contracts.registry import SettingsRegistry
|
|
29
29
|
from settings.contracts.schemas import (
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/contracts/schemas.py
RENAMED
|
@@ -7,7 +7,7 @@ from datetime import datetime
|
|
|
7
7
|
from enum import StrEnum
|
|
8
8
|
|
|
9
9
|
from pydantic import ConfigDict, model_validator
|
|
10
|
-
from simple_module_db.stored_settings import (
|
|
10
|
+
from simple_module_db.queries.stored_settings import (
|
|
11
11
|
DESCRIPTION_MAX_LENGTH,
|
|
12
12
|
KEY_MAX_LENGTH,
|
|
13
13
|
SCOPE_ID_MAX_LENGTH,
|
|
@@ -8,14 +8,14 @@ from __future__ import annotations
|
|
|
8
8
|
|
|
9
9
|
from typing import TYPE_CHECKING
|
|
10
10
|
|
|
11
|
-
from simple_module_db.callbacks import register_on_commit
|
|
12
|
-
from simple_module_db.stored_settings import SCOPE_SYSTEM, SCOPE_TENANT
|
|
11
|
+
from simple_module_db.engine.callbacks import register_on_commit
|
|
12
|
+
from simple_module_db.queries.stored_settings import SCOPE_SYSTEM, SCOPE_TENANT
|
|
13
13
|
|
|
14
14
|
from settings.contracts.invalidation import invalidation_key
|
|
15
15
|
from settings.core.constants import INVALIDATION_CHANNEL
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
|
-
from simple_module_core.invalidation import InvalidationBus
|
|
18
|
+
from simple_module_core.eventing.invalidation import InvalidationBus
|
|
19
19
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
20
20
|
|
|
21
21
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from simple_module_db import LIKE_ESCAPE_CHAR, like_contains_pattern
|
|
6
|
-
from simple_module_db.stored_settings import INTERNAL_SETTING_KEYS, SYSTEM_SCOPE_ID, Setting
|
|
6
|
+
from simple_module_db.queries.stored_settings import INTERNAL_SETTING_KEYS, SYSTEM_SCOPE_ID, Setting
|
|
7
7
|
from sqlalchemy import func, select
|
|
8
8
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
9
9
|
from sqlmodel import col
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_row_masking.py
RENAMED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Split out of ``service`` so the "is this a secret, and is this write the mask
|
|
4
4
|
being echoed back?" question lives in one file, next to the field-level rules in
|
|
5
|
-
``simple_module_core.secret_fields`` that it delegates to.
|
|
5
|
+
``simple_module_core.settings.secret_fields`` that it delegates to.
|
|
6
|
+
``service`` imports these; nothing else
|
|
6
7
|
should need to, because the point of funnelling every read through ``out`` is
|
|
7
8
|
that there is no second way to serialize a row.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
11
|
from __future__ import annotations
|
|
11
12
|
|
|
12
|
-
from simple_module_core.secret_fields import conceals_secret
|
|
13
|
-
from simple_module_db.stored_settings import Setting
|
|
13
|
+
from simple_module_core.settings.secret_fields import conceals_secret
|
|
14
|
+
from simple_module_db.queries.stored_settings import Setting
|
|
14
15
|
|
|
15
16
|
from settings.contracts.schemas import SettingOut
|
|
16
17
|
from settings.core.constants import SENSITIVE_PLACEHOLDER
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"""Re-export of :mod:`simple_module_core.secret_fields` (moved there in #500)."""
|
|
1
|
+
"""Re-export of :mod:`simple_module_core.settings.secret_fields` (moved there in #500)."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from simple_module_core.secret_fields import ( # noqa: F401
|
|
5
|
+
from simple_module_core.settings.secret_fields import ( # noqa: F401
|
|
6
6
|
_NEVER_SECRET_TYPES,
|
|
7
7
|
_SECRET_PATTERNS,
|
|
8
8
|
_TYPED_SECRET_KEYS,
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/_unique_write.py
RENAMED
|
@@ -8,7 +8,7 @@ savepoint, leaving the request's transaction (and its session) usable.
|
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
-
from simple_module_db.stored_settings import Setting
|
|
11
|
+
from simple_module_db.queries.stored_settings import Setting
|
|
12
12
|
from sqlalchemy.exc import IntegrityError
|
|
13
13
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
14
14
|
|
|
@@ -10,11 +10,10 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
from typing import Final
|
|
12
12
|
|
|
13
|
-
from simple_module_core.
|
|
14
|
-
from simple_module_core.permissions import PermissionCatalogue
|
|
13
|
+
from simple_module_core.access.permissions import PermissionCatalogue
|
|
15
14
|
|
|
16
15
|
# Re-exported (#500): these now live with the table in the framework.
|
|
17
|
-
from simple_module_db.stored_settings import ( # noqa: F401
|
|
16
|
+
from simple_module_db.queries.stored_settings import ( # noqa: F401
|
|
18
17
|
ALL_VALUE_TYPES,
|
|
19
18
|
DESCRIPTION_MAX_LENGTH,
|
|
20
19
|
KEY_MAX_LENGTH,
|
|
@@ -43,12 +42,12 @@ LOCALE_NAMESPACE: Final = MODULE_PACKAGE
|
|
|
43
42
|
|
|
44
43
|
# ── Scopes ───────────────────────────────────────────────────────────
|
|
45
44
|
# Scope, value-type, table and field-limit constants moved to
|
|
46
|
-
# ``simple_module_db.stored_settings`` with the table itself (#500); they are
|
|
45
|
+
# ``simple_module_db.queries.stored_settings`` with the table itself (#500); they are
|
|
47
46
|
# re-exported from the import block at the top of this file.
|
|
48
47
|
ALL_SCOPES: Final = (SCOPE_SYSTEM, SCOPE_TENANT, SCOPE_USER)
|
|
49
48
|
|
|
50
49
|
# ── Secrets ──────────────────────────────────────────────────────────
|
|
51
|
-
# The sensitive-key allowlist lives in ``simple_module_core.secret_fields``.
|
|
50
|
+
# The sensitive-key allowlist lives in ``simple_module_core.settings.secret_fields``.
|
|
52
51
|
SENSITIVE_PLACEHOLDER: Final = "********"
|
|
53
52
|
|
|
54
53
|
# ── Routing ──────────────────────────────────────────────────────────
|
|
@@ -97,17 +96,6 @@ class Permissions(PermissionCatalogue, group=PERM_GROUP, label_key="settings.per
|
|
|
97
96
|
TENANT_EDIT = "settings.tenant.edit"
|
|
98
97
|
|
|
99
98
|
|
|
100
|
-
deprecate(
|
|
101
|
-
"settings PERM_* constants",
|
|
102
|
-
remove_in="0.0.50",
|
|
103
|
-
use="settings.core.constants.Permissions",
|
|
104
|
-
)
|
|
105
|
-
PERM_VIEW: Final = Permissions.VIEW
|
|
106
|
-
PERM_CREATE: Final = Permissions.CREATE
|
|
107
|
-
PERM_EDIT: Final = Permissions.EDIT
|
|
108
|
-
PERM_DELETE: Final = Permissions.DELETE
|
|
109
|
-
PERM_TENANT_EDIT: Final = Permissions.TENANT_EDIT
|
|
110
|
-
|
|
111
99
|
ALL_PERMISSIONS: Final = tuple(Permissions)
|
|
112
100
|
|
|
113
101
|
# ── Cache invalidation ───────────────────────────────────────────────
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from fastapi import FastAPI, Request
|
|
6
6
|
from fastapi.responses import JSONResponse, Response
|
|
7
|
+
from simple_module_hosting.error_handling.sanitization import sanitize_error_payload
|
|
7
8
|
|
|
8
9
|
from settings.core._managed_keys import ManagedKeyError, ModuleKeyError
|
|
9
10
|
from settings.core.constants import STATUS_UNPROCESSABLE
|
|
@@ -13,14 +14,16 @@ from settings.core.exceptions import InternalKeyError
|
|
|
13
14
|
async def _managed_key(request: Request, exc: Exception) -> Response:
|
|
14
15
|
assert isinstance(exc, ManagedKeyError)
|
|
15
16
|
return JSONResponse(
|
|
16
|
-
{"detail": str(exc), "clear_via": exc.clear_via},
|
|
17
|
+
sanitize_error_payload({"detail": str(exc), "clear_via": exc.clear_via}),
|
|
18
|
+
status_code=STATUS_UNPROCESSABLE,
|
|
17
19
|
)
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
async def _module_key(request: Request, exc: Exception) -> Response:
|
|
21
23
|
assert isinstance(exc, ModuleKeyError)
|
|
22
24
|
return JSONResponse(
|
|
23
|
-
{"detail": str(exc), "edit_via": exc.edit_via},
|
|
25
|
+
sanitize_error_payload({"detail": str(exc), "edit_via": exc.edit_via}),
|
|
26
|
+
status_code=STATUS_UNPROCESSABLE,
|
|
24
27
|
)
|
|
25
28
|
|
|
26
29
|
|
|
@@ -31,4 +34,6 @@ def install_exception_handlers(app: FastAPI) -> None:
|
|
|
31
34
|
|
|
32
35
|
|
|
33
36
|
async def _internal_key(request: Request, exc: Exception) -> Response:
|
|
34
|
-
return JSONResponse(
|
|
37
|
+
return JSONResponse(
|
|
38
|
+
sanitize_error_payload({"detail": str(exc)}), status_code=STATUS_UNPROCESSABLE
|
|
39
|
+
)
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/invalidation.py
RENAMED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
5
|
from fastapi import FastAPI
|
|
6
|
-
from simple_module_core.
|
|
7
|
-
from simple_module_core.
|
|
8
|
-
from simple_module_core.
|
|
9
|
-
from simple_module_core.
|
|
10
|
-
from simple_module_core.module_settings import module_settings_registry
|
|
11
|
-
from simple_module_core.settings_hydrate import hydrate_settings
|
|
12
|
-
from simple_module_db.stored_settings import settings_table_exists
|
|
6
|
+
from simple_module_core.eventing.events import EventBus
|
|
7
|
+
from simple_module_core.eventing.invalidation import InvalidationBus
|
|
8
|
+
from simple_module_core.eventing.invalidation_refresh import InvalidationRefresh
|
|
9
|
+
from simple_module_core.modules.app_state import get_services
|
|
10
|
+
from simple_module_core.settings.module_settings import module_settings_registry
|
|
11
|
+
from simple_module_core.settings.settings_hydrate import hydrate_settings
|
|
12
|
+
from simple_module_db.queries.stored_settings import settings_table_exists
|
|
13
13
|
|
|
14
14
|
from settings.contracts.events import SettingsReloaded
|
|
15
15
|
from settings.module_settings.store import SettingsStore
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import TYPE_CHECKING
|
|
6
6
|
|
|
7
|
-
from simple_module_db.stored_settings import (
|
|
7
|
+
from simple_module_db.queries.stored_settings import (
|
|
8
8
|
INTERNAL_SETTING_KEYS,
|
|
9
9
|
SYSTEM_SCOPE_ID,
|
|
10
10
|
VALUE_TYPE_STRING,
|
|
@@ -30,8 +30,8 @@ from settings.core.constants import VIEW_PREFIX
|
|
|
30
30
|
from settings.core.exceptions import InternalKeyError
|
|
31
31
|
|
|
32
32
|
if TYPE_CHECKING:
|
|
33
|
-
from simple_module_core.invalidation import InvalidationBus
|
|
34
|
-
from simple_module_core.module_settings import ModuleSettingsRegistry
|
|
33
|
+
from simple_module_core.eventing.invalidation import InvalidationBus
|
|
34
|
+
from simple_module_core.settings.module_settings import ModuleSettingsRegistry
|
|
35
35
|
|
|
36
36
|
from settings.contracts.registry import SettingsRegistry
|
|
37
37
|
|
|
@@ -12,7 +12,7 @@ from __future__ import annotations
|
|
|
12
12
|
|
|
13
13
|
from dataclasses import dataclass, field
|
|
14
14
|
|
|
15
|
-
from simple_module_core.module_settings import ModuleSettingsRegistry
|
|
15
|
+
from simple_module_core.settings.module_settings import ModuleSettingsRegistry
|
|
16
16
|
|
|
17
17
|
from settings.contracts.registry import SettingsRegistry
|
|
18
18
|
from settings.core.settings import SettingsSettings
|
|
@@ -28,7 +28,7 @@ class SettingsServices:
|
|
|
28
28
|
declared defaults.
|
|
29
29
|
|
|
30
30
|
``module_registry`` is the framework's registry of per-module
|
|
31
|
-
``BaseSettings`` classes (``simple_module_core.module_settings``), the
|
|
31
|
+
``BaseSettings`` classes (``simple_module_core.settings.module_settings``), the
|
|
32
32
|
same object the hosting lifespan hydrates from the DB before
|
|
33
33
|
``on_startup`` runs.
|
|
34
34
|
"""
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from pydantic_settings import SettingsConfigDict
|
|
6
|
-
from simple_module_core.settings_base import DbBackedSettings
|
|
6
|
+
from simple_module_core.settings.settings_base import DbBackedSettings
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class SettingsSettings(DbBackedSettings):
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/tenant_scope.py
RENAMED
|
@@ -21,7 +21,7 @@ Both run the definition's ``check`` (:func:`run_check`) before writing.
|
|
|
21
21
|
from __future__ import annotations
|
|
22
22
|
|
|
23
23
|
from fastapi import HTTPException, Request
|
|
24
|
-
from simple_module_core.tenancy import tenant_exists
|
|
24
|
+
from simple_module_core.access.tenancy import tenant_exists
|
|
25
25
|
|
|
26
26
|
from settings.contracts.registry import SettingDefinition, SettingsRegistry
|
|
27
27
|
from settings.contracts.schemas import SettingOut, SettingScope
|
{simple_module_settings-0.0.48 → simple_module_settings-0.0.50}/settings/core/tenant_view.py
RENAMED
|
@@ -8,8 +8,8 @@ Used by the self-service list endpoint and by the tenant settings page.
|
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
-
from simple_module_core.secret_fields import conceals_secret, mask
|
|
12
|
-
from simple_module_db.stored_settings import SYSTEM_SCOPE_ID
|
|
11
|
+
from simple_module_core.settings.secret_fields import conceals_secret, mask
|
|
12
|
+
from simple_module_db.queries.stored_settings import SYSTEM_SCOPE_ID
|
|
13
13
|
from sqlmodel import SQLModel
|
|
14
14
|
|
|
15
15
|
from settings.contracts.registry import SettingsRegistry
|