Skip to content

Add HttpApi.RedactedNames for span redaction of query and header names - #9995

Merged
tim-smart merged 1 commit into
mainfrom
agent/nelson/62fad96349a3
Nov 10, 2026
Merged

tim-smart merged 1 commit into
mainfrom
agent/nelson/62fad96349a3

Conversation

@tim-smart

@tim-smart tim-smart commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds HttpApi.RedactedNames, an annotation that lists query parameter and header wire names to redact in spans. It covers values that are only sometimes secret, like Docker's buildargs or remote, which aren't modelled as Redacted. Requested in a comment on #9882.

const Build = HttpApiEndpoint.post("build", "/build", { query: { buildargs, remote, t } })
  .annotate(HttpApi.RedactedNames, { query: ["buildargs", "remote"], headers: ["x-registry-config"] })
  • Names can be set on the API, a group or an endpoint, and all levels are combined. They add to UrlParams.CurrentRedactedNames and Headers.CurrentRedactedNames instead of replacing them, so defaults like sig still apply. A string query name also matches nested keys such as buildargs[NPM_TOKEN].
  • Client: the request of the endpoint runs with both redacted-name references extended.
  • Server: HttpApiBuilder writes the names into the request state before middleware and decoding run, so a 400 is redacted too. HttpMiddleware.tracer adds them to the fiber refs for the URL and header attributes. The tracer records attributes after the handler has restored its context, so a scoped update wouldn't reach them.

Out of scope, and documented on the annotation: addHttpApi treats RedactedNames like any other annotation, and user_agent.original and span error messages are recorded as is. Dropping the query string from server error messages is tracked separately.

Closes EFF-2975

@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bc81b81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 34 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-cloudflare Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.61 KB 39.61 KB 0.00 KB (0.00%)
basic.ts 7.31 KB 7.31 KB 0.00 KB (0.00%)
batching.ts 11.21 KB 11.21 KB 0.00 KB (0.00%)
brand.ts 7.00 KB 7.00 KB 0.00 KB (0.00%)
cache.ts 11.73 KB 11.73 KB 0.00 KB (0.00%)
config.ts 23.06 KB 23.06 KB 0.00 KB (0.00%)
differ.ts 22.20 KB 22.20 KB 0.00 KB (0.00%)
http-client.ts 27.44 KB 27.44 KB 0.00 KB (0.00%)
http-router.ts 37.34 KB 37.28 KB +0.06 KB (+0.17%)
logger.ts 12.19 KB 12.19 KB 0.00 KB (0.00%)
metric.ts 9.64 KB 9.64 KB 0.00 KB (0.00%)
optic.ts 7.21 KB 7.21 KB 0.00 KB (0.00%)
pubsub.ts 16.21 KB 16.21 KB 0.00 KB (0.00%)
queue.ts 13.09 KB 13.09 KB 0.00 KB (0.00%)
schedule.ts 11.99 KB 11.99 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.29 KB 14.29 KB 0.00 KB (0.00%)
schema-binary.ts 42.44 KB 42.44 KB 0.00 KB (0.00%)
schema-class.ts 21.96 KB 21.96 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.56 KB 30.56 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.22 KB 28.22 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.54 KB 15.54 KB 0.00 KB (0.00%)
schema-string.ts 12.50 KB 12.50 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.42 KB 16.42 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.16 KB 39.16 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.39 KB 26.39 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.11 KB 21.11 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.28 KB 21.28 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.37 KB 21.37 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.38 KB 26.38 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.45 KB 21.45 KB 0.00 KB (0.00%)
schema.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
stm.ts 14.40 KB 14.40 KB 0.00 KB (0.00%)
stream.ts 10.56 KB 10.56 KB 0.00 KB (0.00%)

@tim-smart
tim-smart force-pushed the agent/nelson/62fad96349a3 branch from 26057be to bc81b81 Compare November 10, 2026 20:51
@effect-janitor effect-janitor Bot added the 4.0 label Nov 10, 2026
@tim-smart
tim-smart enabled auto-merge (squash) November 10, 2026 20:53
@tim-smart
tim-smart merged commit 7fce132 into main Nov 10, 2026
18 checks passed
@tim-smart
tim-smart deleted the agent/nelson/62fad96349a3 branch November 10, 2026 21:03
@effect-bot effect-bot mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant