From 52144ed52b16bfffa68ad07bf294997ef8d102ac Mon Sep 17 00:00:00 2001 From: Wonwoo Choi Date: Thu, 28 Sep 2023 17:47:13 +0900 Subject: [PATCH] =?UTF-8?q?OIDC=20interaction=20details=EC=97=90=20client?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#246)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * argon2 dependencies에 node-gyp 추가 * OIDC interaction details에 client 추가 * details 엔드포인트에서 노출되는 클라이언트 정보를 제한 --- .yarnrc.yml | 5 +++++ src/oidc/routes.ts | 17 +++++++++++++++-- yarn.lock | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index bdfa846..0af3db8 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,8 @@ +packageExtensions: + "argon2@^0.31.1": + dependencies: + node-gyp: "^9.4.0" + plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: "@yarnpkg/plugin-workspace-tools" diff --git a/src/oidc/routes.ts b/src/oidc/routes.ts index c5caa02..2e00c0f 100644 --- a/src/oidc/routes.ts +++ b/src/oidc/routes.ts @@ -44,10 +44,23 @@ export default (model: Model, provider: OIDCProvider) => { router.get('/oauth/:uid/details', async ctx => { const { prompt, - params, + params: paramsRaw, } = await provider.interactionDetails(ctx.req, ctx.res); + const params = paramsSchema.parse(paramsRaw); + const client = await provider.Client.find(params.client_id); ctx.status = 200; - ctx.body = { prompt, params }; + ctx.body = { + prompt, + params: paramsRaw, + client: client && { + name: client.clientName, + uri: client.clientUri, + policyUri: client.policyUri, + tosUri: client.tosUri, + logoUri: client.logoUri, + contacts: client.contacts, + }, + }; }); router.post('/oauth/:uid/action/login', async ctx => { diff --git a/yarn.lock b/yarn.lock index 4cd6ae4..75cac3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3987,7 +3987,7 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:latest": +"node-gyp@npm:^9.4.0, node-gyp@npm:latest": version: 9.4.0 resolution: "node-gyp@npm:9.4.0" dependencies: