autoresearch iter 30: enforce user lookup column allow-list instead of trusting a comment

This commit is contained in:
ryan
2026-08-29 18:49:37 +08:00
parent f29ac19673
commit 9ea0e2bdff
3 changed files with 88 additions and 1 deletions
@@ -20,6 +20,10 @@ var (
// ErrRecordNotFound maps GORM's missing-row sentinel at the repository boundary so
// upper layers never import gorm. Its text matches gorm.ErrRecordNotFound verbatim.
ErrRecordNotFound = errors.New("record not found")
// ErrUnsupportedUserLookupField rejects a column name that the repository is not
// allowed to interpolate into a WHERE clause.
ErrUnsupportedUserLookupField = errors.New("unsupported user lookup field")
)
// User-facing validation and error message constants.