Skip to content

fix(request-logger): redact the x-goog-api-key header - #10

Open
mattpocock wants to merge 1 commit into
mainfrom
fix/redact-x-goog-api-key
Open

fix(request-logger): redact the x-goog-api-key header#10
mattpocock wants to merge 1 commit into
mainfrom
fix/redact-x-goog-api-key

Conversation

@mattpocock

Copy link
Copy Markdown
Contributor

Gemini sends its API key in the x-goog-api-key header. The request-logger REDACT set held only authorization, x-api-key and api-key, so a student running the logger against their own Gemini key got that key written in plain text into the Markdown log — a log the course asks them to read and share.

Changes

  • Add x-goog-api-key to REDACT in request-logger/render.ts.
  • Add a test in request-logger/render.test.ts that proves the value is replaced with [REDACTED].

Verification

pnpm vitest run request-logger — 145 tests pass.

Note for the maintainer

request-logger/render.ts is on main, not in the lesson stack. After this merges, move the 25-commit stack onto the new main:

git branch backup/live-run-through-pre-redact-$(date +%s)
git rebase --onto main <old-main-sha> live-run-through
git push --force-with-lease origin live-run-through

🤖 Generated with Claude Code

Gemini sends its key in x-goog-api-key. Without this the key was written
in plain text into the log the student reads and can share.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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