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

1"""Tenant-aware graph isolation strategy and collection resolver types.""" 

2 

3from __future__ import annotations 

4 

5from enum import Enum 

6 

7 

8class GraphTenancyStrategy(str, Enum): 

9 """Strategy for isolating tenant data in a graph store. 

10 

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. 

15 

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 """ 

21 

22 NODE_PROPERTY = "node_property" 

23 GRAPH_PER_TENANT = "graph_per_tenant" 

24 

25 

26__all__ = ["GraphTenancyStrategy"]