Repository navigation
feat(api): give every request an id and log under a written privacy policy - #597
Merged
Merged
Conversation
|
Deployment failed for project playground with the following error: Learn More: https://vercel.com/salazarsebas?upgradeToPro=build-rate-limit |
|
Deployment failed for project lumenwipe with the following error: Learn More: https://vercel.com/salazarsebas?upgradeToPro=build-rate-limit |
salazarsebas
force-pushed
the
feat/api-request-id-and-log-privacy
branch
from
October 10, 2026 18:32
b011428 to
52caf33
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
What
x-request-id; every error body repeats it aserror.requestId. The id is generated server-side per request (a caller-supplied value is ignored) and is set by the first middleware, ahead of the rate limiter, body parsing and auth, so a 429, a 401, a 404 and body errors carry it, together withCache-Control: no-storeand the rate-limit headers.severitymapped to Cloud Logging levels,requestId,time,context). One access line per request:requestId,route(pattern, never the path),status,latencyMs,keyLabel,network. No IP, headers or bodies.LOG_HASH_KEY, random per process when unset); any address in the exchange registry becomes the fixed token[exchange]; the memo a request carried (body field or inside a signed envelope) is removed from every line that request writes.docs/reference/logging-and-privacy.mdx(in the docs navigation), plus request-id notes in the API intro and SDK errors page.StructuredApiError.error.requestIdand the OpenAPI error schema gain the optional field. SDK bumped to 0.4.3 with a changelog entry (it already readX-Request-Id; no runtime change).ApiRequestErrorcarries it, and the failed-close alert shows "Reference: " beside the unchanged message (toUserMessageoutput is identical; test asserts it).Closes #488
Tests
requestId.format:check, sdkcheck-apiand the docs nav check pass.Risks
res.jsonto inject the id; chosen over editing each of the ~10 emit sites so none can be missed.Security review
Security-sensitive (what reaches logs).
security-reviewwas run from the worktree before the commits; it received an empty diff because the skill diffs the main checkout, so the change was hand-reviewed instead: id is server-generated and header-safe (UUID), the web relays an id only when it matches^[A-Za-z0-9-]{8,64}$, rendered through React text, no new endpoint or auth change, no secret reaches logs, scrub regexes are linear. No findings.