Repository navigation
Recheck Preset DELETE authority after concurrent revocation - #7360
freeqaz-openai wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesPreset DELETE explicitly uses Read Committed and acquires the existing session and IAM authority hold before authorization. Example: A member deletes “Target Preset” while its delete grant is withdrawn during a Namespace lock wait, using a connection that defaults to Repeatable Read.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open for triage; the focused authority repair has no concrete introduced defect identified. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe HTTP handler delegates authenticated Preset deletion to OCC, which authorizes the exact resource and commits Preset removal, binding cleanup, and mutation audit through PostgreSQL. flowchart TB
A[Authenticated DELETE] --> B[Read Committed transaction]
B --> C[Session and IAM hold]
C --> D[Exact permission check]
D --> E[Namespace lock and recheck]
E -->|Allowed| F[Delete Preset and bindings]
F --> G[Commit mutation audit]
E -->|Denied| H[403 and denial audit]
Technical reviewBest possible solution: Retain the narrow repair through the existing transaction, authority, and Preset owners. Do we have a high-confidence way to reproduce the issue? Source establishes the stale-snapshot path with Native IAM and a Repeatable Read connection default; no target code was executed during this read-only review. Is this the best way to solve the issue? The implementation addresses transaction isolation at both enclosing and nested owners, reuses the existing authority hold, and preserves Namespace cascade deletion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2f586673a76d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 25, 2026, 2:44 AM ET / 07:44 UTC. |
Preset DELETE could wait for a Namespace lock after its initial permission check and miss a concurrent withdrawal of the caller's AccessBinding. It also did not acquire the request's existing session and IAM authority hold.
Use Read Committed for the DELETE transaction, acquire the authority hold before checking permission and locking the Namespace, and recheck
preset:deleteon the exact target after the lock. With Native IAM on PostgreSQL, a binding withdrawal that commits first causes403without deleting the Preset or its remaining bindings. Successful deletion still returns204and commits the mutation audit with the deletion. Namespace deletion keeps its existing cascade path.This change addresses direct Preset DELETE ordering through the existing session and Native IAM mechanisms. It does not establish exact API-key currentness, cover every session invalidation path or grant expiry, serialize external IAM changes, or change Preset POST.
Verification: independent source review, exact patch and byte checks, and the repository-managed formatting check passed. The repository's Markdown counter passed across 714 files. Full workspace/typecheck checks and the real PostgreSQL baseline and candidate runs remain pending; this is a draft for ordinary CI qualification.