Skip to content

Commit

Permalink
OIDC interaction details에 client 추가 (#246)
Browse files Browse the repository at this point in the history
* argon2 dependencies에 node-gyp 추가

* OIDC interaction details에 client 추가

* details 엔드포인트에서 노출되는 클라이언트 정보를 제한
  • Loading branch information
tirr-c authored Sep 28, 2023
1 parent 3a8fb42 commit 52144ed
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 15 additions & 2 deletions src/oidc/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 52144ed

Please sign in to comment.