Coverage for src / lexigram / contracts / data / graph / tenancy.py: 0%
6 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
1"""Tenant-aware graph isolation strategy and collection resolver types."""
3from __future__ import annotations
5from enum import Enum
8class GraphTenancyStrategy(str, Enum):
9 """Strategy for isolating tenant data in a graph store.
11 ``NODE_PROPERTY``
12 Every node and edge carries a ``tenant_id`` property; queries
13 auto-inject a property filter to scope results to the current
14 tenant. Works with any backend and is the default strategy.
16 ``GRAPH_PER_TENANT``
17 Each tenant gets a separate named graph (or Neo4j database).
18 Graph names are resolved from the current tenant context via
19 a ``TenantCollectionResolver``.
20 """
22 NODE_PROPERTY = "node_property"
23 GRAPH_PER_TENANT = "graph_per_tenant"
26__all__ = ["GraphTenancyStrategy"]