Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Refactor: Remove redundant IP address blocking calls
Akhil Mohand1c360829604
diff --git a/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts b/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.tsindex ddfd4b0851..9aaf412c3c 100644--- a/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts+++ b/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts@@ -106,8 +106,6 @@ const createConcurrencyLimiter = (limit: number) => {export const getHCVaultInstanceUrl = async (config: THCVaultConnectionConfig) => {const instanceUrl = removeTrailingSlash(config.credentials.instanceUrl);- await blockLocalAndPrivateIpAddresses(instanceUrl);-return instanceUrl;};@@ -133,15 +131,14 @@ export const requestWithHCVaultGateway = async <T>(): Promise<AxiosResponse<T>> => {const { gatewayId } = appConnection;+ const url = new URL(requestConfig.url as string);+ await blockLocalAndPrivateIpAddresses(url.toString(), Boolean(gatewayId));+// If gateway isn't set up, don't proxy requestif (!gatewayId) {return request.request(requestConfig);}- const url = new URL(requestConfig.url as string);-- await blockLocalAndPrivateIpAddresses(url.toString());-const [targetHost] = await verifyHostInputValidity({ host: url.hostname, isGateway: true, isDynamicSecret: false });const relayDetails = await gatewayService.fnGetGatewayClientTlsByGatewayId(gatewayId);const [relayHost, relayPort] = relayDetails.relayAddress.split(":");