use more future proof config for static clients (#11175)

This commit is contained in:
Kerry 2023-07-05 11:10:03 +12:00 committed by GitHub
parent ce332d0f8b
commit 90e65e8490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 13 deletions

View file

@ -27,7 +27,9 @@ describe("getOidcClientId()", () => {
const baseUrl = "https://just.testing";
const dynamicClientId = "xyz789";
const staticOidcClients = {
[issuer]: "abc123",
[issuer]: {
client_id: "abc123",
},
};
const delegatedAuthConfig = {
issuer,
@ -42,9 +44,7 @@ describe("getOidcClientId()", () => {
});
it("should return static clientId when configured", async () => {
expect(await getOidcClientId(delegatedAuthConfig, clientName, baseUrl, staticOidcClients)).toEqual(
staticOidcClients[issuer],
);
expect(await getOidcClientId(delegatedAuthConfig, clientName, baseUrl, staticOidcClients)).toEqual("abc123");
// didn't try to register
expect(fetchMockJest).toHaveFetchedTimes(0);
});