You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For per-IP throttling, the cleanest option is an upstash/ratelimit-style table or a small in-memory cache (acceptable for single-region Supabase functions).
Verification
Hit the throttled endpoints in a loop; confirm 429 after the configured budget is exhausted.
Part of #213.
Risk
Several Edge Function endpoints perform expensive or external-traffic-generating operations with no per-caller throttling beyond Supabase's gateway:
manage-question-links(refresh)manage-question-links(unfurl)question-opengraphsync-discourse-topicsReference good pattern:
calculate-readiness/index.ts:128-145has a 30s cache-freshness gate that prevents repeated computation per user.Fix
Per function, the simplest mechanism:
sync-discourse-topics,manage-question-links/refresh— already admin-gated (or will be after Security C2: manage-question-links Edge Function — unauthenticated service_role + SSRF via unfurl #215); add alast_run_attimestamp column or a single-row table to enforce "not run more than once per N minutes globally."question-opengraph— already cached at CDN level by Vercel/Supabase; ensureCache-Control: public, max-age=3600is set on success responses.unfurl— bound by the auth fix in Security C2: manage-question-links Edge Function — unauthenticated service_role + SSRF via unfurl #215; additionally cap loop iterations per request to N URLs.For per-IP throttling, the cleanest option is an
upstash/ratelimit-style table or a small in-memory cache (acceptable for single-region Supabase functions).Verification