Jun 27 MT-5

This commit is contained in:
2026-06-27 12:56:11 -04:00
parent 668cb645e2
commit 7505e82ab4
6 changed files with 344 additions and 10 deletions
+16 -10
View File
@@ -1,18 +1,24 @@
"""
app/tenancy/
============
Host-based tenant resolution and per-tenant database routing (MT-1).
app/tenancy/__init__.py
-----------------------
Public exports for the tenancy package.
Public surface:
RoutingSession — tenant-aware session class (installed on `db`)
init_tenancy — registers the before_request resolver hook
TenantContext — detached descriptor carried on g.tenant
Inert unless config MULTI_TENANT_ENABLED is True.
MT-1: RoutingSession, init_tenancy, TenantContext
MT-5: feature_required, quota_soft_check, check_quota, check_feature
"""
from app.tenancy.routing import RoutingSession
from app.tenancy.middleware import init_tenancy
from app.tenancy.context import TenantContext
from app.tenancy.gates import feature_required, quota_soft_check
from app.tenancy.quota import check_quota, check_feature
__all__ = ['RoutingSession', 'init_tenancy', 'TenantContext']
__all__ = [
'RoutingSession',
'init_tenancy',
'TenantContext',
'feature_required',
'quota_soft_check',
'check_quota',
'check_feature',
]