Skip to content

Commit 3c6907c

Browse files
author
kjgbot
committed
test: fail closed on invalid OIDC config
1 parent 25b098c commit 3c6907c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

packages/server/src/__tests__/sponsor-oidc-binding.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,20 @@ test("sponsor proof refuses an id_token with the wrong audience", async (t) => {
321321
const body = await assertJsonResponse<{ code: string }>(response, 403);
322322
assert.equal(body.code, "invalid_id_token");
323323
});
324+
325+
test("malformed sponsor federation configuration fails closed", async () => {
326+
const org = "org_misconfigured_binding";
327+
const app = createTestApp({ RELAYAUTH_SPONSOR_FEDERATIONS: "{" });
328+
const response = await app.request(
329+
createTestRequest(
330+
"POST",
331+
"/v1/identities",
332+
{ name: "must-not-fall-back", sponsorId: "user_alice" },
333+
adminAuthorization(org),
334+
),
335+
undefined,
336+
app.bindings,
337+
);
338+
const body = await assertJsonResponse<{ code: string }>(response, 503);
339+
assert.equal(body.code, "sponsor_binding_misconfigured");
340+
});

0 commit comments

Comments
 (0)