Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions request-logger/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,18 @@ describe("renderMarkdown header redaction", () => {
expect(out).not.toContain("secret-token");
expect(out).toContain("[REDACTED]");
});

it("hides the x-goog-api-key header", () => {
const out = renderMarkdown({
...BASE,
agent: "Gemini CLI",
renderer: "gemini",
headers: { "x-goog-api-key": "secret-goog-key" },
path: "/v1beta/models/gemini-2.5-pro:generateContent",
requestBody: body(GEMINI_REQUEST),
responseRaw: "",
});
expect(out).not.toContain("secret-goog-key");
expect(out).toContain("[REDACTED]");
});
});
7 changes: 6 additions & 1 deletion request-logger/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ interface RenderInput {
responseRaw: string;
}

const REDACT = new Set(["authorization", "x-api-key", "api-key"]);
const REDACT = new Set([
"authorization",
"x-api-key",
"api-key",
"x-goog-api-key",
]);

/**
* Turn the raw request bytes into text.
Expand Down