Repository navigation
fix(registry): preserve exact crawl requester credentials - #7530
Conversation
31e43f1 to
0e825e3
Compare
7c3d8d3 to
cf5c79e
Compare
c306073 to
6536b94
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — server-only fix aligns write and read ownership semantics.
PR #7530 captures a frozen RegistryPrincipal at POST /registry/crawl-request entry and persists requestedByUserId as the exact authenticating credential (authWorkosUserId ?? id), aligning the write with the read-path ownership check and closing the 202-then-404 self-read gap for linked credentials. The principal.user! assertion is guarded, and reservation/release key on the same frozen memberId. Two new >200-line test files cover mutation-across-await, quota isolation, and reservation release.
Checked:
- Server-only diff (routes + tests) — no schema/protocol/dist/docs surface touched, so no changeset required (correctly none added).
- high_risk is true only because server/src/routes/registry-api.ts is (modified) matching server/src/routes/**; no critical/high/medium findings on that file, so the modification is presumed safe (not an escalation trigger on the flag alone).
- gated_paths is false; no author no-auto-approve team match.
- No blocking or medium findings reported.
Decision table: rows 1–8 do not fire (no findings, gated_paths false, no deletions, no team gate). Falls through to row 9 → approve. Note: review_decision is REVIEW_REQUIRED, but row 2 only applies when gated_paths is true, which it is not here.
A linked secondary credential could receive
202fromPOST /registry/crawl-request, have its request stored under the canonical credential, then receive404when polling it. This change captures the immutableRegistryPrincipalat POST entry and persists its exact credential ID, so the creating credential can read its request while another linked credential receives the same response as a missing request.This is a provenance/self-read availability follow-up for #6827; it does not close #6827.
The durable queue already counts
requested_by_user_idfor its requester quota. This route now passes the same frozen exact credential to the existing in-memory reservation and release overrides. Linked credentials therefore have separate requester quotas. The 30/hour threshold and five-minute domain cooldown are unchanged, and canonical-keyed brand/manager callers retain their existing behavior. Static-admin requests still persiststatic_admin/null.Scope is limited to the POST handler and regressions. There is no migration, schema, protocol, dependency, or identity-management change. The fix applies to new submissions; existing rows retain their recorded ownership.
The branch was refreshed on current
mainas one commit after its former stacked parents landed. A current-main API drift in audit logging was resolved by readingprincipal.staticAdminfrom the captured principal.Validation on refreshed head:
registry-crawl-request-route.test.tsregistry-brand-force-crawl-route.test.tsgit diff --checkThe earlier candidate also passed its broader PostgreSQL integration and full server test matrices before the current-main refresh. GitHub CI is authoritative for the refreshed head.
Open workspace in Conductor