Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: added region flag

=1407a122b9df
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index d8ca362bd6..231a35d0d6 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -60,12 +60,19 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
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;
const licenseReq = axios.create({
baseURL,
- timeout: 35 * 1000
- // signal: AbortSignal.timeout(60 * 1000)
+ timeout: 35 * 1000,
+ headers: {
+ "x-region": region
+ }
});
const refreshLicense = async () => {
diff --git a/backend/src/ee/services/license/license-service.ts b/backend/src/ee/services/license/license-service.ts
index ceeebbf7a7..cfc42d0388 100644
--- a/backend/src/ee/services/license/license-service.ts
+++ b/backend/src/ee/services/license/license-service.ts
@@ -77,13 +77,15 @@ export const licenseServiceFactory = ({
const licenseServerCloudApi = setupLicenseRequestWithStore(
appCfg.LICENSE_SERVER_URL || "",
LICENSE_SERVER_CLOUD_LOGIN,
- appCfg.LICENSE_SERVER_KEY || ""
+ appCfg.LICENSE_SERVER_KEY || "",
+ appCfg.INTERNAL_REGION
);
const licenseServerOnPremApi = setupLicenseRequestWithStore(
appCfg.LICENSE_SERVER_URL || "",
LICENSE_SERVER_ON_PREM_LOGIN,
- appCfg.LICENSE_KEY || ""
+ appCfg.LICENSE_KEY || "",
+ appCfg.INTERNAL_REGION
);
const syncLicenseKeyOnPremFeatures = async (shouldThrow: boolean = false) => {
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index 198ccb9bfa..29aa682461 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -245,7 +245,6 @@ const envSchema = z
DATADOG_HOSTNAME: zpStr(z.string().optional()),
/* CORS ----------------------------------------------------------------------------- */
-
CORS_ALLOWED_ORIGINS: zpStr(
z
.string()
@@ -255,7 +254,6 @@ const envSchema = z
return JSON.parse(val) as string[];
})
),
-
CORS_ALLOWED_HEADERS: zpStr(
z
.string()
@@ -264,7 +262,10 @@ const envSchema = z
if (!val) return undefined;
return JSON.parse(val) as string[];
})
- )
+ ),
+
+ /* INTERNAL ----------------------------------------------------------------------------- */
+ INTERNAL_REGION: zpStr(z.string().optional())
})
// To ensure that basic encryption is always possible.
.refine(