Initialize identity module
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from govoplan_core.core.identity import CAPABILITY_IDENTITY_DIRECTORY
|
||||
from govoplan_core.core.module_guards import persistent_table_uninstall_guard
|
||||
from govoplan_core.core.modules import DocumentationTopic, MigrationSpec, ModuleContext, ModuleManifest
|
||||
from govoplan_core.db.base import Base
|
||||
from govoplan_identity.backend.db import models as identity_models # noqa: F401 - populate metadata
|
||||
|
||||
|
||||
def _identity_directory(context: ModuleContext) -> object:
|
||||
del context
|
||||
from govoplan_identity.backend.directory import SqlIdentityDirectory
|
||||
|
||||
return SqlIdentityDirectory()
|
||||
|
||||
|
||||
manifest = ModuleManifest(
|
||||
id="identity",
|
||||
name="Identity",
|
||||
version="0.1.6",
|
||||
migration_spec=MigrationSpec(module_id="identity", metadata=Base.metadata),
|
||||
uninstall_guard_providers=(
|
||||
persistent_table_uninstall_guard(
|
||||
identity_models.Identity,
|
||||
identity_models.IdentityAccountLink,
|
||||
label="Identity",
|
||||
),
|
||||
),
|
||||
capability_factories={
|
||||
CAPABILITY_IDENTITY_DIRECTORY: _identity_directory,
|
||||
},
|
||||
documentation=(
|
||||
DocumentationTopic(
|
||||
id="identity.model",
|
||||
title="Identity directory",
|
||||
summary="Identity owns normalized subjects and links them to platform accounts. Access owns authorization.",
|
||||
body=(
|
||||
"An identity can have multiple accounts. Identity facts remain separate from authentication sessions, "
|
||||
"organization functions, and permission decisions."
|
||||
),
|
||||
layer="configured",
|
||||
documentation_types=("admin", "user"),
|
||||
audience=("tenant_admin", "access_admin", "operator"),
|
||||
order=24,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def get_manifest() -> ModuleManifest:
|
||||
return manifest
|
||||
Reference in New Issue
Block a user