[codex] Structure browser DPoP failures#3277
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Refactors browser DPoP errors from a generic class into three structured, schema-validated error classes with explicit fields. No changes to runtime behavior - just improved error structure and metadata for debugging. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 037f54f
037f54f to
41df172
Compare
Dismissing prior approval to re-evaluate 41df172
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
41df172 to
d8a8df1
Compare
c41bc6c
into
codex/redact-dpop-request-target
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
Stack dependency
redactDpopRequestTargethelper used by this PR.Validation
vp test run apps/web/src/cloud/dpop.test.ts(4 tests)vp check(passes with 20 pre-existing warnings)vp run typecheckNote
Medium Risk
Touches cloud auth DPoP error shapes and messages; callers using
instanceofon the old class or matching message strings may need updates, though behavior on success paths is unchanged.Overview
Replaces the single message-based
BrowserDpopErrorwith three schema-tagged variants:BrowserDpopStorageError(IndexedDB open/read/write),BrowserDpopKeyError(generate/export/import), andBrowserDpopProofError(normalize URL, JTI, sign). Each carries anoperation, preserves the originalcause, and uses fixed user-facing messages that do not echo cause text.Proof failures attach redacted request context via shared
redactDpopRequestTarget(scheme/host/path only, plusurlLengthand thumbprint)—never raw URLs with credentials, query, or fragments. ABrowserDpopErrorschema union andisBrowserDpopErrorguard replace the oldData.TaggedErrorclass for boundary handling.Tests cover happy-path signing, invalid URL handling, redaction on sign failure, and key-generation cause preservation.
Reviewed by Cursor Bugbot for commit d8a8df1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure browser DPoP failures into typed error classes with redacted context
BrowserDpopErrorclass with three structuredSchema.TaggedErrorClasstypes:BrowserDpopStorageError,BrowserDpopKeyError, andBrowserDpopProofError, each carrying operation-specific fields and a cause.BrowserDpopProofErrorredacts credentials, query parameters, and URL fragments fromrequestTargetin error messages to avoid leaking sensitive data.isBrowserDpopErroras a type guard for the union of all three error types.instanceof BrowserDpopErroror specific message strings will break.Macroscope summarized d8a8df1.