Skip to content

fix(providers): redact credentials from HTTP errors (ENG-17069) - #45

Merged
kamescg merged 2 commits into
feat/atom-runtime-packagesfrom
fix/http-error-redaction
Oct 22, 2026
Merged

kamescg merged 2 commits into
feat/atom-runtime-packagesfrom
fix/http-error-redaction

Conversation

@kamescg

@kamescg kamescg commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Provider HTTP errors included full request URLs, allowing Etherscan API keys and URL userinfo to escape into consumer diagnostics. Introduce ProviderHttpError carrying 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 on feat/atom-runtime-packages at 9d138e8; 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

Package Change
@0xintuition/atom-enrichment Typed HTTP errors with sanitized endpoints; OpenLibrary uses the same error; redactProviderDiagnostic applied to every plugin error the engine emits and exported for consumers
@0xintuition/atom-classification Amazon/X errors omit raw upstream response bodies

Target versions

No manifest or lockfile changes. The rebuilt atom runtime packages are intended for 0.1.0-alpha.1 after 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_KEY in 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 typecheck and bun run --cwd packages/atom-classification typecheck: passed.
  • bun test packages/atom-enrichment/__tests__/providers/http.test.ts: 2 passed, 0 failures.
  • Biome check on all five changed files: passed.

These are local checks against the candidate checkout. GitHub CI and publication readiness remain separate gates.

Review fix-ups (2026-10-22)

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@linear

linear Bot commented Oct 22, 2026

Copy link
Copy Markdown

ENG-17069

…-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>
@kamescg
kamescg merged commit 477f0a5 into feat/atom-runtime-packages Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant