From 14a65070dc6fe281f60452e612057dab4975a905 Mon Sep 17 00:00:00 2001 From: Daniel Doynov Date: Fri, 9 Dec 2022 13:00:49 +0000 Subject: [PATCH 1/2] fix: add openid-configuration endpoint --- integration-tests/server.test.ts | 16 ++++++++++++++++ src/server/server.ts | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/integration-tests/server.test.ts b/integration-tests/server.test.ts index 98d3561e..83de3487 100644 --- a/integration-tests/server.test.ts +++ b/integration-tests/server.test.ts @@ -126,4 +126,20 @@ describe("HTTP server", () => { }); }); }); + + describe("OpenId Configuration Endpoint", () => { + it("responds with open id configuration", async () => { + const server = createServer(jest.fn(), MockLogger as any); + + const response = await supertest(server.application).get( + "/any-user-pool/.well-known/openid-configuration" + ); + expect(response.status).toEqual(200); + expect(response.body).toEqual({ + id_token_signing_alg_values_supported: ["RS256"], + jwks_uri: `http://localhost:9229/any-user-pool/.well-known/jwks.json`, + issuer: `http://localhost:9229/any-user-pool`, + }); + }); + }); }); diff --git a/src/server/server.ts b/src/server/server.ts index e6e8afab..a662bd69 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -55,6 +55,14 @@ export const createServer = ( }); }); + app.get("/:userPoolId/.well-known/openid-configuration", (req, res) => { + res.status(200).json({ + id_token_signing_alg_values_supported: ["RS256"], + jwks_uri: `http://localhost:9229/${req.params.userPoolId}/.well-known/jwks.json`, + issuer: `http://localhost:9229/${req.params.userPoolId}`, + }); + }); + app.get("/health", (req, res) => { res.status(200).json({ ok: true }); }); From 006a7dc420f358b427c7633287cc50d1c06127c8 Mon Sep 17 00:00:00 2001 From: root0x <6894127+root0x@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:08:56 +0000 Subject: [PATCH 2/2] Bump version to Node 16 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c22eda2..8040ebdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-alpine as builder +FROM node:16-alpine as builder WORKDIR /app # dependencies @@ -20,4 +20,4 @@ EXPOSE 9229 ENV HOST 0.0.0.0 ENV PORT 9229 VOLUME /app/.cognito -ENTRYPOINT ["node", "/app/start.js"] \ No newline at end of file +ENTRYPOINT ["node", "/app/start.js"]