Repository navigation
fix(providers): redact credentials from HTTP errors (ENG-17069) - #45
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kamescg
marked this pull request as ready for review
October 22, 2026 19:27
…-17069 Add redactProviderDiagnostic and apply it in createPluginError so every errors[] entry the engine emits is credential-free before any consumer persists or returns it. The helper strips query strings, fragments and userinfo from URLs (verbatim or percent-encoded), redacts credential parameters and headers (plain, quoted, JSON-escaped), bare Bearer/Basic tokens, and scheme-less userinfo. Mirrors the Core hotfix so both lineages stay identical. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Provider HTTP errors included full request URLs, allowing Etherscan API keys and URL userinfo to escape into consumer diagnostics. Introduce
ProviderHttpErrorcarrying status, provider hostname, and a URL stripped of query, fragment, and userinfo. Use it in the shared JSON/text helpers and OpenLibrary. Remove upstream response bodies from Amazon/X classification errors because providers can echo credentials there.Refs ENG-17069. This is two commits (
1dc7103,e0a6261) stacked onfeat/atom-runtime-packagesat9d138e8; it is the packages-side companion to Core M0 hotfix #35. The base branch is a parked extraction candidate, not a release-approved implementation. M2 must inherit this fix while rebuilding from the app fork.Package impact
@0xintuition/atom-enrichmentredactProviderDiagnosticapplied to every plugin error the engine emits and exported for consumers@0xintuition/atom-classificationTarget versions
No manifest or lockfile changes. The rebuilt atom runtime packages are intended for
0.1.0-alpha.1after M2; this PR does not authorize publishing the existing alpha.0 extraction.Identity impact
Identity impact: none — existing golden bytes unchanged.
Fixture impact
Adds JSON/text HTTP error tests asserting SECRET is absent from both message and serialized error. No identity/conformance vectors changed.
Contract artifact
n/a
Rollout notes
Ready for review; merge first in the 45 → 46 → 47 order (47 already contains this branch). M2 inherits both the HTTP fix and the engine-level redaction when it rebuilds from the app fork. Core's companion also adds bounded diagnostic redaction at its persistence and API boundaries; those consumer protections are separate from this package change. Rotate
ETHERSCAN_API_KEYin any environment that persisted provider errors; old rows are not rewritten.Validation
bun run --cwd packages/atom-enrichment test: 619 Bun tests and 8 Node tests passed, 0 failures.bun run --cwd packages/atom-classification test: 173 passed, 0 failures.bun run --cwd packages/atom-enrichment typecheckandbun run --cwd packages/atom-classification typecheck: passed.bun test packages/atom-enrichment/__tests__/providers/http.test.ts: 2 passed, 0 failures.These are local checks against the candidate checkout. GitHub CI and publication readiness remain separate gates.
Review fix-ups (2026-10-22)
e0a6261addspackages/atom-enrichment/src/diagnostics.ts(redactProviderDiagnostic), wires it intocreatePluginError, and exports it from the package root. The Core hotfix (feat(iid, iid-spec): floor weak account handles below anchor eligibility, with the spec amendment and conformance rule (P16g) #35) carries the byte-identical file, so the published package and Core redact the same way. The regex covers verbatim and percent-encoded query/fragment separators, userinfo (with or without a scheme), hosts without a dotted TLD, credential parameters and headers in plain, quoted and JSON-escaped form, and bareBearer/Basictokens; 32 table-driven tests plus prose and idempotence checks.e0a6261:bun test packages/atom-enrichment/__tests__/diagnostics.test.ts32 passed;bun run --cwd packages/atom-enrichment testpassed (Bun and Node suites); package typecheck and Biome passed. The branch is also merged into chore: prepare packages for publication (ENG-17072, ENG-17073, ENG-17074) #47, whose full gate covers it.🤖 Generated with Claude Code