Merge pull request #3659 from akhilmhdh/feat/cloud-region-flag

feat: added region flag
This commit is contained in:
Maidul Islam
2025-05-27 10:49:55 -04:00
committed by GitHub
3 changed files with 18 additions and 8 deletions
+10 -3
View File
@@ -60,12 +60,19 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
enterpriseAppConnections: false enterpriseAppConnections: false
}); });
export const setupLicenseRequestWithStore = (baseURL: string, refreshUrl: string, licenseKey: string) => { export const setupLicenseRequestWithStore = (
baseURL: string,
refreshUrl: string,
licenseKey: string,
region?: string
) => {
let token: string; let token: string;
const licenseReq = axios.create({ const licenseReq = axios.create({
baseURL, baseURL,
timeout: 35 * 1000 timeout: 35 * 1000,
// signal: AbortSignal.timeout(60 * 1000) headers: {
"x-region": region
}
}); });
const refreshLicense = async () => { const refreshLicense = async () => {
@@ -77,13 +77,15 @@ export const licenseServiceFactory = ({
const licenseServerCloudApi = setupLicenseRequestWithStore( const licenseServerCloudApi = setupLicenseRequestWithStore(
appCfg.LICENSE_SERVER_URL || "", appCfg.LICENSE_SERVER_URL || "",
LICENSE_SERVER_CLOUD_LOGIN, LICENSE_SERVER_CLOUD_LOGIN,
appCfg.LICENSE_SERVER_KEY || "" appCfg.LICENSE_SERVER_KEY || "",
appCfg.INTERNAL_REGION
); );
const licenseServerOnPremApi = setupLicenseRequestWithStore( const licenseServerOnPremApi = setupLicenseRequestWithStore(
appCfg.LICENSE_SERVER_URL || "", appCfg.LICENSE_SERVER_URL || "",
LICENSE_SERVER_ON_PREM_LOGIN, LICENSE_SERVER_ON_PREM_LOGIN,
appCfg.LICENSE_KEY || "" appCfg.LICENSE_KEY || "",
appCfg.INTERNAL_REGION
); );
const syncLicenseKeyOnPremFeatures = async (shouldThrow: boolean = false) => { const syncLicenseKeyOnPremFeatures = async (shouldThrow: boolean = false) => {
+4 -3
View File
@@ -245,7 +245,6 @@ const envSchema = z
DATADOG_HOSTNAME: zpStr(z.string().optional()), DATADOG_HOSTNAME: zpStr(z.string().optional()),
/* CORS ----------------------------------------------------------------------------- */ /* CORS ----------------------------------------------------------------------------- */
CORS_ALLOWED_ORIGINS: zpStr( CORS_ALLOWED_ORIGINS: zpStr(
z z
.string() .string()
@@ -255,7 +254,6 @@ const envSchema = z
return JSON.parse(val) as string[]; return JSON.parse(val) as string[];
}) })
), ),
CORS_ALLOWED_HEADERS: zpStr( CORS_ALLOWED_HEADERS: zpStr(
z z
.string() .string()
@@ -264,7 +262,10 @@ const envSchema = z
if (!val) return undefined; if (!val) return undefined;
return JSON.parse(val) as string[]; return JSON.parse(val) as string[];
}) })
) ),
/* INTERNAL ----------------------------------------------------------------------------- */
INTERNAL_REGION: zpStr(z.enum(["us", "eu"]).optional())
}) })
// To ensure that basic encryption is always possible. // To ensure that basic encryption is always possible.
.refine( .refine(