From ca5776e6f31174425f7afeb2cd96bb8bed6e2575 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 2 Dec 2024 10:00:37 +0100 Subject: [PATCH] services: fix oidc usage --- src/services.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/services.js b/src/services.js index 9db6bb13d..0d5bf1d76 100644 --- a/src/services.js +++ b/src/services.js @@ -1801,7 +1801,7 @@ async function setupProxyAuth(app, options) { debug('Creating OpenID client for proxyAuth'); // openid client_id is appId for now - const [error, result] = await safe(oidc.clients.get(app.id)); + const [error, result] = await safe(oidc.getClient(app.id)); if (error) throw error; // ensure we keep the secret @@ -1814,8 +1814,8 @@ async function setupProxyAuth(app, options) { appId: app.id }; - if (result) await oidc.clients.update(app.id, data); - else await oidc.clients.add(app.id, data); + if (result) await oidc.updateClient(app.id, data); + else await oidc.addClient(app.id, data); } async function teardownProxyAuth(app, options) { @@ -1826,7 +1826,7 @@ async function teardownProxyAuth(app, options) { debug('Deleting OpenID client for proxyAuth'); - const [error] = await safe(oidc.clients.del(app.id)); + const [error] = await safe(oidc.delClient(app.id)); if (error && error.reason !== BoxError.NOT_FOUND) throw error; } @@ -2118,7 +2118,7 @@ async function setupOidc(app, options) { debug('Setting up OpenID connect'); // openid client_id is appId for now - const [error, result] = await safe(oidc.clients.get(app.id)); + const [error, result] = await safe(oidc.getClient(app.id)); if (error) throw error; // ensure we keep the secret @@ -2131,8 +2131,8 @@ async function setupOidc(app, options) { appId: app.id }; - if (result) await oidc.clients.update(app.id, data); - else await oidc.clients.add(app.id, data); + if (result) await oidc.updateClient(app.id, data); + else await oidc.addClient(app.id, data); } async function teardownOidc(app, options) { @@ -2141,7 +2141,7 @@ async function teardownOidc(app, options) { debug('Tearing down OpenID connect'); - const [error] = await safe(oidc.clients.del(app.id)); + const [error] = await safe(oidc.delClient(app.id)); if (error && error.reason !== BoxError.NOT_FOUND) throw error; } @@ -2153,7 +2153,7 @@ async function getDynamicEnvironmentOidc(app, options) { if (!app.sso) return {}; - const client = await oidc.clients.get(app.id); + const client = await oidc.getClient(app.id); if (!client) throw new BoxError(BoxError.NOT_FOUND, `OIDC client for ${app.id} has not been allocated yet`); // happens with overzealous scheduler logic const tmp = {};