refactor: remove legacy models/schema/auth.py re-export file
Some checks failed
CI / ruff (push) Successful in 10s
CI / pytest (push) Failing after 44m56s
CI / validate (push) Successful in 22s
CI / dependency-scanning (push) Successful in 27s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped

All 84 import sites now use the canonical path
app.modules.tenancy.schemas.auth directly — no need
for backwards-compatibility re-exports.

Update audit validator to check module schemas locations
instead of only the legacy models/schema/ path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 23:59:46 +01:00
parent 4aa6f76e46
commit e3a52f6536
3 changed files with 27 additions and 46 deletions

View File

@@ -205,20 +205,37 @@ class AuditValidator(BaseValidator):
)
# Check input validation (Pydantic)
schema_path = self.project_root / "models" / "schema"
if schema_path.exists():
has_validation = False
for file in schema_path.glob("*.py"):
# Check both legacy models/schema/ and module schemas locations
schema_paths = [
self.project_root / "models" / "schema",
self.project_root / "app" / "modules",
]
has_validation = False
for schema_path in schema_paths:
if not schema_path.exists():
continue
for file in schema_path.rglob("schemas/*.py"):
content = file.read_text()
if re.search(r"Field|validator|field_validator", content):
has_validation = True
break
if not has_validation:
self.add_error(
"DATA-INT-001",
"Pydantic validation required for data integrity",
str(schema_path),
)
if has_validation:
break
# Also check legacy location
if schema_path == self.project_root / "models" / "schema":
for file in schema_path.glob("*.py"):
content = file.read_text()
if re.search(r"Field|validator|field_validator", content):
has_validation = True
break
if has_validation:
break
if not has_validation:
self.add_error(
"DATA-INT-001",
"Pydantic validation required for data integrity",
str(self.project_root / "app" / "modules"),
)
# Check user data access endpoint exists (GDPR)
users_api = self.project_root / "app" / "api" / "v1" / "users.py"