Skip to content

Commit 9948ee8

Browse files
stop caching guest jwks response (#1615)
1 parent da80d02 commit 9948ee8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mcpjam-inspector/server/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ export function createHonoApp() {
186186
return c.json({ status: "ok", timestamp: new Date().toISOString() });
187187
});
188188

189-
// Guest JWT JWKS endpoint — public, cacheable, no auth required.
189+
// Guest JWT JWKS endpoint — public, no auth required, avoid edge caching.
190190
// Convex uses this to verify guest JWTs natively.
191191
app.get("/guest/jwks", (c) => {
192-
c.header("Cache-Control", "public, max-age=3600");
192+
c.header("Cache-Control", "no-store");
193193
return c.json(getGuestJwks());
194194
});
195195

mcpjam-inspector/server/routes/web/__tests__/guest-jwks.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ describe("GET /api/web/guest-jwks", () => {
4242
rmSync(testGuestKeyDir, { recursive: true, force: true });
4343
});
4444

45-
it("returns a public, cacheable JWKS document", async () => {
45+
it("returns a non-cacheable JWKS document", async () => {
4646
const response = await app.request("/api/web/guest-jwks");
4747

4848
expect(response.status).toBe(200);
49-
expect(response.headers.get("cache-control")).toBe("public, max-age=3600");
49+
expect(response.headers.get("cache-control")).toBe("no-store");
5050
expect(response.headers.get("content-type")).toContain("application/json");
5151

5252
const body = await response.json();

mcpjam-inspector/server/routes/web/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ web.route("/guest-session", guestSession);
3939

4040
// Public JWKS endpoint for guest JWT verification.
4141
web.get("/guest-jwks", (c) => {
42-
c.header("Cache-Control", "public, max-age=3600");
42+
c.header("Cache-Control", "no-store");
4343
return c.json(getGuestJwks());
4444
});
4545

0 commit comments

Comments
 (0)