Commit 3ff5306
committed
[recipes] Fix REVIEW-MEDIUM-1: filter restricted thoughts from preview views
Why: ops_recent_thoughts and ops_enrichment_gaps both emit left(content, 180)
as a preview column without filtering on sensitivity_tier. Today the views
are service_role-only, so there is no blast radius -- but the README markets
them as queryable via PostgREST and "your dashboard", which primes a future
maintainer to add GRANT SELECT ... TO authenticated. The moment that happens,
the first 180 chars of every restricted thought flow out through these views.
Add WHERE sensitivity_tier IS DISTINCT FROM 'restricted' to both views. This
matches the convention used by search_thoughts_text(p_exclude_restricted) in
schemas/enhanced-thoughts/schema.sql and costs one clause per view. Cheap
insurance against a future "widen the grants for the dashboard" regression.1 parent d9d9405 commit 3ff5306
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments