mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
export
This commit is contained in:
@@ -26,7 +26,7 @@ interface DNSMadeEasyApiResponse {
|
|||||||
page: number;
|
page: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDNSMadeEasyUrl = (path: string) => {
|
export const getDNSMadeEasyUrl = (path: string) => {
|
||||||
const appCfg = getConfig();
|
const appCfg = getConfig();
|
||||||
return `${appCfg.DNS_MADE_EASY_SANDBOX_ENABLED ? IntegrationUrls.DNS_MADE_EASY_SANDBOX_API_URL : IntegrationUrls.DNS_MADE_EASY_API_URL}${path}`;
|
return `${appCfg.DNS_MADE_EASY_SANDBOX_ENABLED ? IntegrationUrls.DNS_MADE_EASY_SANDBOX_API_URL : IntegrationUrls.DNS_MADE_EASY_API_URL}${path}`;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,36 +1,12 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
import { getConfig } from "@app/lib/config/env";
|
|
||||||
import { request } from "@app/lib/config/request";
|
import { request } from "@app/lib/config/request";
|
||||||
import { crypto } from "@app/lib/crypto/cryptography";
|
|
||||||
import { TDNSMadeEasyConnection } from "@app/services/app-connection/dns-made-easy/dns-made-easy-connection-types";
|
|
||||||
import { IntegrationUrls } from "@app/services/integration-auth/integration-list";
|
|
||||||
import { logger } from "@app/lib/logger";
|
import { logger } from "@app/lib/logger";
|
||||||
|
import {
|
||||||
const getDNSMadeEasyUrl = (path: string) => {
|
getDNSMadeEasyUrl,
|
||||||
const appCfg = getConfig();
|
makeDNSMadeEasyAuthHeaders
|
||||||
return `${appCfg.DNS_MADE_EASY_SANDBOX_ENABLED ? IntegrationUrls.DNS_MADE_EASY_SANDBOX_API_URL : IntegrationUrls.DNS_MADE_EASY_API_URL}${path}`;
|
} from "@app/services/app-connection/dns-made-easy/dns-made-easy-connection-fns";
|
||||||
};
|
import { TDNSMadeEasyConnection } from "@app/services/app-connection/dns-made-easy/dns-made-easy-connection-types";
|
||||||
|
|
||||||
const makeDNSMadeEasyAuthHeaders = (
|
|
||||||
apiKey: string,
|
|
||||||
secretKey: string,
|
|
||||||
currentDate: Date = new Date()
|
|
||||||
): Record<string, string> => {
|
|
||||||
// Format date as "Day, DD Mon YYYY HH:MM:SS GMT" (e.g., "Mon, 01 Jan 2024 12:00:00 GMT")
|
|
||||||
const requestDate = currentDate.toUTCString();
|
|
||||||
|
|
||||||
// Generate HMAC-SHA1 signature
|
|
||||||
const hmac = crypto.nativeCrypto.createHmac("sha1", secretKey);
|
|
||||||
hmac.update(requestDate);
|
|
||||||
const hmacSignature = hmac.digest("hex");
|
|
||||||
|
|
||||||
return {
|
|
||||||
"x-dnsme-apiKey": apiKey,
|
|
||||||
"x-dnsme-hmac": hmacSignature,
|
|
||||||
"x-dnsme-requestDate": requestDate
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const dnsMadeEasyInsertTxtRecord = async (
|
export const dnsMadeEasyInsertTxtRecord = async (
|
||||||
connection: TDNSMadeEasyConnection,
|
connection: TDNSMadeEasyConnection,
|
||||||
|
|||||||
Reference in New Issue
Block a user