feat: multi-region rule isolation — region column + config + queries

- DB: add region column to leaudit_rule_sets + leaudit_rule_type_bindings
- DB: change UNIQUE constraint from (rule_type) to (rule_type, region)
- Config: add APP_REGION to app.toml + AppSettings + __init__.pyi
- AuditServiceImpl: filter bindings by APP_REGION
- RuleServiceImpl: ListBindings/CreateBinding use APP_REGION
- Seed script: accept --region arg, tag rules by region
- OssPathUtils: BuildRuleYamlKey already accepts Region parameter

Each region can now have its own independent copy of the same rule_type,
stored in separate OSS paths and DB rows, keyed by region.
This commit is contained in:
wren
2026-04-28 13:15:26 +08:00
parent 4e706f0d19
commit e80e8febd8
5 changed files with 38 additions and 18 deletions
+1
View File
@@ -4,6 +4,7 @@
APP_NAME: str
APP_HOST: str
APP_PORT: int
APP_REGION: str
APP_CORS_ORIGINS: str
# JWT
+1
View File
@@ -19,6 +19,7 @@ class AppSettings(_Base):
APP_NAME: str = "LeAudit Platform"
APP_HOST: str = "0.0.0.0"
APP_PORT: int = 8000
APP_REGION: str = "default"
APP_CORS_ORIGINS: str = "*"