2 Commits
Author SHA1 Message Date
viettranx 2ce975af73 fix(store): restore alias validation guard in WhereClauseAlias
Re-add character-by-character alias validation that was present in the
old tenantClauseNAlias but missing from the new WhereClauseAlias.
Defense-in-depth against SQL injection via table alias parameter.
2026-03-25 08:20:10 +07:00
viettranx deb821063a refactor(store): add QueryScope abstraction for composable multi-level isolation
Introduce store.QueryScope struct that generates WHERE clauses for
tenant + optional project scoping. Add scopeClause/scopeClauseAlias
wrappers in pg/helpers.go as drop-in replacements for tenantClauseN.

Old tenant-only helpers remain for existing callers (76 occurrences).
Migrate providers.go (4 calls) as proof-of-concept. Future callers
should use scopeClause for project-scope readiness.
2026-03-25 08:20:10 +07:00