From f0b9f05c4cbadd75a30a1a9075a547b62eb2c1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= Date: Wed, 14 Aug 2024 16:26:56 +0200 Subject: [PATCH] feat(gatekeeper): allow license bypass in testing envs --- .../server/modules/gatekeeper/services/validateLicense.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/modules/gatekeeper/services/validateLicense.ts b/packages/server/modules/gatekeeper/services/validateLicense.ts index df39a9e65e..225dfbe2b2 100644 --- a/packages/server/modules/gatekeeper/services/validateLicense.ts +++ b/packages/server/modules/gatekeeper/services/validateLicense.ts @@ -2,7 +2,8 @@ import * as jose from 'jose' import { isDevEnv, getServerOrigin, - getLicenseToken + getLicenseToken, + isTestEnv } from '@/modules/shared/helpers/envHelper' import { LicenseTokenClaims, EnabledModules } from '@/modules/gatekeeper/domain/types' @@ -69,7 +70,7 @@ export const validateModuleLicense = async ({ }: { requiredModules: LicensedModuleNames }): Promise => { - if (isDevEnv()) return true + if (isDevEnv() || isTestEnv()) return true const licenseToken = getLicenseToken() if (!licenseToken) return false const publicKey = await getPublicKey()