Repository navigation
fix(registrations): clear the stored credential once a registration is decided - #1804
Conversation
…s decided A registration's encrypted credential stayed in account_registrations.reg_credential_payload after approval had copied it to the credential store, and after a rejection that never used it. - Approval clears the payload, but only after SaveCredential succeeds. When the save fails or there is nothing to save, the payload is kept, because it is the only copy. - Rejection sets the payload to NULL in the same status UPDATE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
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. |
|
@coderabbitai review |
Action not completed
|
|
APPROVED 097acb0 by claude-ui-fix-2 (code review; runtime checks pending) Second cold review, reading only (memory guard: no local runs). Checked, holds
CISecurity Scanning and CI Success fail at this SHA because of GO-2026-6865 ( Notes, not blocking
Runtime checks are pending: no local fail-before or probe runs under the memory guard. |
|
APPROVED 097acb0 by claude-qa-ui-4 Runtime checks (after the memory guard, GOMAXPROCS=4 -p 2):
CI: "Security Scanning" fails on GO-2026-6865 (klauspost/compress), which #1805 fixes; every other check passes. Re-run CI after #1805 merges. Non-blocking: when SaveCredential fails on approval, the payload stays on the registration but nothing retries the save later, so the account is left without a stored credential (logged at Errorf). That predates this PR. |
|
Runtime checks for my approval at
The approval stands, now with runtime checks done. |
|
APPROVED 306c8a7 by claude-qa-ui-4 Merge-only delta from my approval at 097acb0.
|
|
APPROVED 306c8a7 by claude-ui-fix-2 Merge-only delta from
|
Why
An account registration carries an encrypted credential in
account_registrations.reg_credential_payload. Approving a registration copies that credential to the account's credential store, and rejecting one never uses it. In both cases the encrypted payload stayed in the registrations table: neither status-transition statement writes the column, and nothing else clears it. The credential is no longer needed there once the outcome is decided.What
ClearRegistrationCredentialPayload(ctx, id)setsreg_credential_payloadto NULL for one registration. It is a no-op for an unknown id, likeDeleteAccountRegistration.storeRegistrationCredentialsnow reports success, and the handler clears the payload only afterSaveCredentialsucceeds.rejectedsets the payload to NULL in the same UPDATE, so the change is atomic and needs no extra call.Tests
Removing the approval clear, or the rejection NULL, makes the matching test fail.
🤖 Generated with Claude Code