From 3878d6b0227d74a256ba3548d187777b6c25e527 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 7 Feb 2024 12:26:43 +0000 Subject: [PATCH] feat: add config options --- packages/nc-gui/composables/useGlobal/state.ts | 2 ++ packages/nc-gui/composables/useGlobal/types.ts | 2 ++ packages/nocodb/src/services/utils.service.ts | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/packages/nc-gui/composables/useGlobal/state.ts b/packages/nc-gui/composables/useGlobal/state.ts index 318dea2a43..3275bd7e1d 100644 --- a/packages/nc-gui/composables/useGlobal/state.ts +++ b/packages/nc-gui/composables/useGlobal/state.ts @@ -96,6 +96,8 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State { googleAuthEnabled: false, oidcAuthEnabled: false, oidcProviderName: null, + samlAuthEnabled: false, + samlProviderName: null, ncMin: false, oneClick: false, baseHasAdmin: false, diff --git a/packages/nc-gui/composables/useGlobal/types.ts b/packages/nc-gui/composables/useGlobal/types.ts index 4604994b3e..1739ad02f2 100644 --- a/packages/nc-gui/composables/useGlobal/types.ts +++ b/packages/nc-gui/composables/useGlobal/types.ts @@ -35,6 +35,8 @@ export interface AppInfo { mainSubDomain?: string dashboardPath: string inviteOnlySignup: boolean + samlAuthEnabled: boolean + samlProviderName: string | null } export interface StoredState { diff --git a/packages/nocodb/src/services/utils.service.ts b/packages/nocodb/src/services/utils.service.ts index a21e6215a5..dd613af719 100644 --- a/packages/nocodb/src/services/utils.service.ts +++ b/packages/nocodb/src/services/utils.service.ts @@ -383,6 +383,15 @@ export class UtilsService { ? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect' : null; + const samlAuthEnabled = !!( + process.env.NC_SAML_ISSUER && + process.env.NC_SAML_ENTRY_POINT && + process.env.NC_SAML_CERT + ); + const samlProviderName = samlAuthEnabled + ? process.env.NC_SAML_PROVIDER_NAME ?? 'SAML' + : null; + const result = { authType: 'jwt', baseHasAdmin, @@ -422,6 +431,8 @@ export class UtilsService { mainSubDomain: this.configService.get('mainSubDomain', { infer: true }), dashboardPath: this.configService.get('dashboardPath', { infer: true }), inviteOnlySignup: settings.invite_only_signup, + samlProviderName, + samlAuthEnabled, }; return result;