Commit 0ede6ea
Supabase: drop legacy saved_workspaces sweeper + harden RPC grants
Two clean-up doc updates triggered by an audit of the prod Supabase
state after the tier-enforcement rollout:
docs/sql/supabase-bootstrap.sql
* Remove cleanup_expired_saved_workspaces RPC + pg_cron block.
Step 8 of tier-enforcement shipped a tier-aware Python sweeper in
backend/maintenance.py that does this same DELETE with Free 7d /
Pro 30d / Business unbounded retention, plus routes through
resolve_user_tier so Stripe wires retention with a single switch.
Both running in parallel raced (pg_cron deleting before the
Python sweep iterated) and broke tier semantics for Business
users. Applied to prod by Supabase migration
`drop_legacy_saved_workspaces_cleanup` (20260514183110).
docs/sql/supabase-resume-builder.sql
* Add `revoke all from public/anon/authenticated` on
cleanup_expired_resume_builder_sessions. Without these, Supabase
grants EXECUTE to all client-facing roles by default on public-
schema functions, which means any caller with the public anon
key could call the RPC via /rest/v1/rpc/<name> and trigger
arbitrary expired-session cleanup. Mirrored the same fix the
tier-enforcement work backported to the quota counters migration.
Applied to prod by `revoke_anon_from_existing_definer_rpcs`
(20260514183200) + `revoke_public_from_existing_definer_rpcs`.
The search_cached_jobs_ranked RPC is locked down the same way on
prod (postgres + service_role only) but lives entirely in the
Supabase migration history rather than in this repo's docs/sql/.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e6f13c3 commit 0ede6ea
2 files changed
Lines changed: 37 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| |||
0 commit comments