feat(migrations): create apify_scraper_runs ownership map (chat#1840)#39
feat(migrations): create apify_scraper_runs ownership map (chat#1840)#39sweetmantech wants to merge 1 commit into
Conversation
Records which account started each Apify scraper run at scrape start, so
GET /api/apify/runs/{runId} can authorize the owning account instead of
being admin-only. Loose ids/no FKs like email_send_log; RLS enabled with
no policies (service-role writes only).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Updates to Preview Branch (feat/apify-scraper-runs-ownership) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
…ision) Design decision 2026-07-03 (supersedes the owner-or-admin draft): scrape datasets are public social content and Apify run ids are unguessable, so possession of a runId plus any valid API key / Bearer token is sufficient. validateAdminAuth -> validateAuthContext; drops the apify_scraper_runs ownership map, the scrape-start insert, and the 403/404 paths. recoupable/database#39 is closed unmerged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Closing unmerged — design decision on chat#1840 (2026-07-03): scraper-run polling moves to the capability model (any valid API key / Bearer token can poll any run id; scrape datasets are public social content and run ids are unguessable), so no runId→account ownership map is needed. api#752 is reworked to a plain |
Part of recoupable/chat#1840 item 1 (account-scope the scrape-results endpoint). Hard dependency: this migration must merge + apply before the api PR that reads/writes the table. Contract: docs#262.
What
public.apify_scraper_runs— ownership map written at scrape start byPOST /api/socials/{id}/scrape, read by theGET /api/apify/runs/{runId}validator:run_idaccount_idsocial_idcreated_atemail_send_log: an ownership log shouldn't cascade-delete with accounts; a dangling row just degrades that run to admin-only polling.account_idfor audits; reads are by PK.Why
Apify run ids carry no account scope, so the results endpoint is admin-only — agents can start scrapes they can never read (7/7 Forbidden polls in the issue's evidence). This table gives the endpoint an ownership chain to authorize against.
🤖 Generated with Claude Code
Summary by cubic
Create
public.apify_scraper_runsto map Apify run IDs to the owning account, enabling account-scoped access forGET /api/apify/runs/{runId}(chat#1840). Must deploy before the API that reads/writes this table.run_idTEXT PK,account_idUUID NOT NULL,social_idUUID,created_attimestamptz default now().account_id; reads by PK.Written for commit c63f2db. Summary will update on new commits.