Repository navigation
refactor(capture): reuse credential header classification - #140855
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. Reviewed September 7, 2026, 1:38 AM ET / 05:38 UTC. ClawSweeper reviewWhat this changesDebug proxy capture reuses the shared credential-header classifier while retaining cookie and session redaction. Merge readiness✅ Ready for maintainer review The refactor preserves header-redaction behavior and removes duplication still present on current main. No actionable correctness or security defect was found; this maintainer-authored PR remains a useful landing candidate. Priority: P3 Review scores
Verification
How this fits togetherDebug proxy capture records HTTP requests and responses from the runtime and standalone proxy. Both writers sanitize headers before storing diagnostic events. flowchart LR
A[Runtime HTTP capture] --> C[Header redaction]
B[Standalone proxy capture] --> C
D[Shared credential classification] --> C
E[Cookie and session rules] --> C
C --> F[Registered secret masking]
F --> G[Stored diagnostic events]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -23. Total -23 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep credential-name classification in its existing shared owner and preserve capture-specific cookie, session, and value-redaction protections. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, and source comparison establishes equivalent classification. Is this the best way to solve the issue? Yes. Reusing the existing leaf classifier removes duplication without changing capture's public contract or storage behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b7848ca6b197. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Keep capture's cookie/session extension, caller-sensitive names, and exact-value masking while delegating credential names to the secrets policy. Proof: node scripts/run-vitest.mjs src/proxy-capture passed 99 tests. Independent review with unchanged owner context found no actionable P0-P2 findings.
12ab1aa to
b48208b
Compare
|
Merged via squash.
|
…40855) Keep capture's cookie/session extension, caller-sensitive names, and exact-value masking while delegating credential names to the secrets policy. Proof: node scripts/run-vitest.mjs src/proxy-capture passed 99 tests. Independent review with unchanged owner context found no actionable P0-P2 findings.
What Problem This Solves
Debug proxy capture independently repeats the credential-header names and fragments used by the secrets audit. Keeping both lists makes future credential-name updates prone to drift.
Why This Change Was Made
Capture delegates credential-name classification to the secrets-owned
isLikelySensitiveModelProviderHeaderNameand retains its cookie, set-cookie, and session-name extension. Caller-declared sensitive names, array flattening, output keys, and registered-secret value masking stay unchanged.The matched header-name set is identical: the secrets owner's extra exact
secret-keynames were already matched by capture'ssecretfragment.User Impact
None intended. Request and response captures retain the same redacted output. No configuration, dependency, schema, persistence, or public-export change.
Evidence
node scripts/run-vitest.mjs src/proxy-capture: 99 tests passed across nine files, covering header forms and runtime request/response persistence and streams.src/secrets/model-provider-header-policyfilter has no standalone test file; the wrapper rejected that target before running tests. The existing capture suites exercise the shared classifier through the changed boundary.node scripts/check-changed.mjs --base 5e550555920fe6ccc0c0e8924b6d11435ed971fc: passed.Required fresh-main rebase onto
038acb2695d298ac671c3b886647025abdbfd22cpreserved the patch exactly. The unchanged policy and normalization dependencies also have no diff. Current headb48208bd72f5c7012a793f65f04f6e15ef44a52dpassed CI 34087090712.