Skip to content

Commit 20fd39e

Browse files
committed
fix: unblock GitLab synchronization checks
1 parent 559d15a commit 20fd39e

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/server/src/api/auth/github.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export async function githubOauthRoutes(app: FastifyInstance): Promise<void> {
9292
provider: "github",
9393
});
9494
const isProd = process.env.NODE_ENV === "production";
95+
// The cookie stores only an application-key-encrypted, short-lived CSRF
96+
// nonce, not a provider credential or identity. CodeQL otherwise treats
97+
// the Set-Cookie sink itself as clear-text storage.
98+
// codeql[js/clear-text-storage-of-sensitive-data]
9599
reply.header(
96100
"Set-Cookie",
97101
buildCookie({
@@ -170,6 +174,9 @@ export async function githubOauthRoutes(app: FastifyInstance): Promise<void> {
170174

171175
// A verified state is single-use whether GitHub returns a code, a
172176
// provider denial, or an approval-request setup landing.
177+
// This Set-Cookie value is intentionally empty and expires the nonce; it
178+
// does not persist the verified state or any other sensitive value.
179+
// codeql[js/clear-text-storage-of-sensitive-data]
173180
reply.header(
174181
"Set-Cookie",
175182
buildCookie({

packages/web/src/components/chat/__tests__/agent-hovercard.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ beforeEach(() => {
7171
});
7272

7373
afterEach(() => {
74+
queryClient.clear();
7475
h.cleanup();
7576
});
7677

@@ -218,7 +219,10 @@ describe("AgentHovercard", () => {
218219

219220
it("navigates to agent details from the View profile link", async () => {
220221
seedPassA("chat-1", [AGENT_PARTICIPANT], []);
221-
mocks.getAgent.mockResolvedValue(AGENT_DTO);
222+
// This case verifies routing, not the lazy permission probe covered by the
223+
// surrounding tests. Seed Pass B so unrelated query scheduling cannot
224+
// hide the link before the click assertion runs.
225+
queryClient.setQueryData(["agent", "a1"], AGENT_DTO);
222226
render(
223227
<AgentHovercard agentId="a1" chatId="chat-1" name="Aria">
224228
<span>Aria</span>

packages/web/src/pages/onboarding/steps/__tests__/step-start-chat-scan-fix.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const flowMock = vi.hoisted(() => ({
2424
treeAutoDetectDone: true,
2525
markTreeAutoDetectDone: vi.fn(),
2626
completeAndEnterChat: vi.fn(async () => undefined),
27+
reportStepFailure: vi.fn(),
2728
}));
2829

2930
const resolveAgentMock = vi.hoisted(() => ({
@@ -165,6 +166,7 @@ describe("AdminStartChat — production-scan fix handoff", () => {
165166
await flush();
166167

167168
expect(flowMock.completeAndEnterChat).not.toHaveBeenCalled();
169+
expect(flowMock.reportStepFailure).toHaveBeenCalledWith("start_chat_failed", { step: "start-chat" });
168170
expect(window.sessionStorage.getItem("onboarding:campaignActionHandoff")).not.toBeNull();
169171
});
170172

0 commit comments

Comments
 (0)