Repository navigation
feat(obs): spans, PII boundary and audit coverage for the key and docs surface (#869) - #1227
Merged
Merged
Conversation
#869) Records er.org and er.role in the Principal extractor (the request span declared both, and claimed the guard recorded them, but nothing did), and er.key_id / er.key_role in the key mint and revoke handlers. Drops the declared-but-never-recorded er.actor: it embeds the acting user's email. er.api_key and er.api_key_hash are declared Pii::Never, so the existing registry and allowlist gates refuse them. telemetry_secrets.rs scans every tracing call for credential names; pg_key_telemetry.rs asserts the exported spans of a real mint and revoke carry the ids and no secret value, and that both audit rows carry their request's trace id and no secret. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks done
… records #869 (#869) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mint and revoke buttons now begin a named trace, so the click joins the key.issue / key.revoke audit row and the request span carrying er.key_id. Also regenerates the pr-review reference for the new test file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
marked this pull request as ready for review
November 25, 2026 10:23
athvin
temporarily deployed
to
marketing-preview
November 25, 2026 10:28 — with
GitHub Actions
Inactive
This was referenced Nov 25, 2026
This branch was previously deployed
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.
Closes #869
What
The key-minting surface (#866) now carries attribution, and it is provable that it carries no secret.
Principalextractor recordser.organder.role. The mint and revoke handlers recorder.key_id, and mint also recordser.key_role. Each writes onetracing::info!line carrying the key id and role.er.api_key(the plaintext or its secret half) ander.api_key_hashare declaredPii::Never, so the existing registry gate and collector-allowlist gate refuse them. The collector admitser.key_idander.key_role.er.actorremoved from the request span and from the allowlist. It was declared but never recorded, and the actor string embeds the BFF's acting-user email, so recording it would have put an email on an exportable span.keys.mintandkeys.revokejoin the action vocabulary, on the Create and Revoke buttons.observabilityskill: no counter for/docs/apior/api/openapi. A page view is not an engine metric, and neither route makes an upstream call, so there is no trace to continue.Why
#869, part of epic #857. Key minting is the one place a credential passes through handler code with a span open.
Proof
make check: 1,171 passed, 0 failed.make frontend: 964 Playwright passed, 0 failed; the action gate reports 21 declared, all emitted.er-server --testsagainst Postgres: 402 passed.tests/pg_key_telemetry.rs(runtime). It mints and revokes a key with distinct traceparents, under the global span recorder, and checks:er.key_id,er.key_roleander.role;key.issueandkey.revokeaudit rows carry their request'strace_id, and their detail holds no secret.tests/telemetry_secrets.rs(source shape). Every tracing macro and.record(call insrc/**is scanned, with strings and comments stripped. Credential words are banned crate-wide.keyandhashare banned inside the key-surface functions only, because elsewherekeymeans a record key or an S3 object key. Anti-vacuity floors are included.Mutations, each observed failing, then reverted:
er.key_idpg_key_telemetry(key_id mismatch) andtelemetry_secretsSpan::current().record("key", plaintext)telemetry_secretsonly.pg_key_telemetryPASSES, because recording to an undeclared field is a silent no-op. That gap is why the source gate exists.er.key_idrecordpg_key_telemetrypg_key_telemetry(er.role)Audit coverage was already written by the handlers (
pg_auth.rs). It is verified, not rebuilt, as the ticket asked.Risk & rollback
The collector allowlist changes, adding two keys and removing
er.actor, which nothing emitted. A rejected collector config crashloops the new pod while the old one keeps serving, so the post-merge check is collector pod health. Rollback:git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-25T10:38:01Zmainis green with this change on it: merge07964a65. Push runs: frontend 45595254754, devcontainer 45595253510, infra 45595253488, images 45595254171, marketing preview 45595253594, rust 45595253736, all succeeded.imagesbuilt, and succeeded (er-api and er-web).deployconverged: run 45595830577 (DEPLOY_SHA: 07964a65) succeeded. Process proof: the live colour in dev (ci/web-api-green-84566899d6-hzpq7, 10:32:58Z) and prod (app/web-api-blue-649bf78b8-nflb9, 10:33:10Z) both logged"er-server listening".deployis green.driftandkindwere already red on schedule before feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202.observabilityskill (the credential boundary, the docs-counter decision) and thesecurityharness-map row 20 (docs(skills): close the OpenAPI epic's skill sweep (#870) #1228).Specific to this change
configmap/otel-collectorcarrieser.key_idander.key_roleand noer.actor. Podotel-collector-68d969c5d-lmnp6(0 restarts) loggedEverything is ready. Begin running and processing data.at 10:32:15Z, so the new config was not refused.Context — plan, discoveries, measurements, files
Plan
Discoveries
telemetry.rssaider.org,er.actorander.rolewere "recorded by the bearer guard". Nothing recorded any of them. All three were declaredEmptyand exported nothing.otel.name(POST /v1/orgs/{org}/api-keys), nothttp.server, so the test selects the request span by itshttp.routeattribute.Measurements
Files
er-span/src/attr.rs,er-server/src/{lib.rs,telemetry.rs},er-obs/src/testing.rs(CapturedSpan.attributes),infra/k8s/observability/otel-collector-values.yaml,er-server/tests/{pg_key_telemetry,telemetry_secrets,wire_serialization,main}.rs,frontend/src/lib/telemetry/actions.ts,frontend/src/components/settings/api-keys-content.tsx,.claude/skills/observability/SKILL.md