Skip to content
Merged
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
5 changes: 3 additions & 2 deletions tests/codex-integration/codex-auth-context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,9 @@ describe("Codex auth context", () => {
// The caller proved admission with one of OUR secrets. That secret must never leave the
// process, so the only acceptable outcome is the stored main credential in its place.
const admissionSecret = "ocx_data_localsecret";
const storedCredential = liveJwt();
writeFileSync(join(testDir, "auth.json"), JSON.stringify({
tokens: { access_token: liveJwt(), account_id: "stored_main_acc" },
tokens: { access_token: storedCredential, account_id: "stored_main_acc" },
}));

const headers = materializeCodexUpstreamAuth(
Expand All @@ -1458,7 +1459,7 @@ describe("Codex auth context", () => {
);

expect(headers.get("authorization")).not.toContain(admissionSecret);
expect(headers.get("authorization")).toBe(`Bearer ${liveJwt()}`);
expect(headers.get("authorization")).toBe(`Bearer ${storedCredential}`);
expect(headers.get("chatgpt-account-id")).toBe("stored_main_acc");
// Unrelated forwarded headers still ride along.
expect(headers.get("openai-beta")).toBe("responses=experimental");
Expand Down
Loading