Skip to content

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

Add sandbox switch for dns made easy

Fang-Pen Lin0d721686e6d5
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index 11de576670..21e83c2b79 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -119,6 +119,7 @@ const envSchema = z
})
.default("{}")
),
+ DNS_MADE_EASY_SANDBOX_ENABLED: zodStrBool.default("false").optional(),
// smtp options
SMTP_HOST: zpStr(z.string().optional()),
SMTP_IGNORE_TLS: zodStrBool.default("false"),
diff --git a/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts b/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
index fc34940b8c..40bbe945ba 100644
--- a/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
+++ b/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
@@ -5,7 +5,9 @@ import { crypto } from "@app/lib/crypto/cryptography";
import { BadRequestError } from "@app/lib/errors";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { IntegrationUrls } from "@app/services/integration-auth/integration-list";
+import https from "https";
+import { getConfig } from "@app/lib/config/env";
import { DNSMadeEasyConnectionMethod } from "./dns-made-easy-connection-enum";
import {
TDNSMadeEasyConnection,
@@ -24,6 +26,11 @@ interface DNSMadeEasyApiResponse {
page: number;
}
+const getDNSMadeEasyUrl = (path: string) => {
+ const appCfg = getConfig();
+ return `${appCfg.DNS_MADE_EASY_SANDBOX_ENABLED ? IntegrationUrls.DNS_MADE_EASY_SANDBOX_API_URL : IntegrationUrls.DNS_MADE_EASY_API_URL}${path}`;
+};
+
export const makeDNSMadeEasyAuthHeaders = (
apiKey: string,
secretKey: string,
@@ -92,7 +99,11 @@ export const validateDNSMadeEasyConnectionCredentials = async (config: TDNSMadeE
const { apiKey, secretKey } = config.credentials;
try {
- const resp = await request.get(`${IntegrationUrls.DNS_MADE_EASY_API_URL}/V2.0/dns/managed/`, {
+ const resp = await request.get(getDNSMadeEasyUrl("/V2.0/dns/managed/"), {
+ httpAgent: new https.Agent({
+ minVersion: "TLSv1.2",
+ maxVersion: "TLSv1.2"
+ }),
headers: {
...makeDNSMadeEasyAuthHeaders(apiKey, secretKey),
Accept: "application/json"