refactor: update LDAP password rotation functions to use executeWithPotentialGateway for connection handling and improve error management

This commit is contained in:
Victor Santos
2025-11-06 20:17:18 -03:00
parent e2e0c374b0
commit 8fd516d78e
3 changed files with 136 additions and 188 deletions
+2 -2
View File
@@ -8,10 +8,10 @@ import { getConfig } from "@app/lib/config/env";
import { BadRequestError } from "../errors";
import { isPrivateIp } from "../ip/ipRange";
export const blockLocalAndPrivateIpAddresses = async (url: string) => {
export const blockLocalAndPrivateIpAddresses = async (url: string, isGateway = false) => {
const appCfg = getConfig();
if (appCfg.isDevelopmentMode) return;
if (appCfg.isDevelopmentMode || isGateway) return;
const validUrl = new URL(url);