diff --git a/backend/src/ee/services/dynamic-secret/providers/redis.ts b/backend/src/ee/services/dynamic-secret/providers/redis.ts index 33a5a6560..78efe98e3 100644 --- a/backend/src/ee/services/dynamic-secret/providers/redis.ts +++ b/backend/src/ee/services/dynamic-secret/providers/redis.ts @@ -52,7 +52,7 @@ const executeTransactions = async (connection: Redis, commands: string[]): Promi export const RedisDatabaseProvider = (): TDynamicProviderFns => { const validateProviderInputs = async (inputs: unknown) => { const providerInputs = await DynamicSecretRedisDBSchema.parseAsync(inputs); - await verifyHostInputValidity(providerInputs.host); + const [hostIp] = await verifyHostInputValidity(providerInputs.host); validateHandlebarTemplate("Redis creation", providerInputs.creationStatement, { allowedExpressions: (val) => ["username", "password", "expiration"].includes(val) }); @@ -65,7 +65,7 @@ export const RedisDatabaseProvider = (): TDynamicProviderFns => { allowedExpressions: (val) => ["username"].includes(val) }); - return providerInputs; + return { ...providerInputs, host: hostIp }; }; const $getClient = async (providerInputs: z.infer) => { diff --git a/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue-fn.ts b/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue-fn.ts index 7de90bbb8..e86469c51 100644 --- a/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue-fn.ts +++ b/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue-fn.ts @@ -88,13 +88,13 @@ export const secretRotationDbFn = async ({ options }: TSecretRotationDbFn) => { const ssl = ca ? { rejectUnauthorized: false, ca } : undefined; - await verifyHostInputValidity(host); + const [hostIp] = await verifyHostInputValidity(host); const db = knex({ client, connection: { database, port, - host, + host: hostIp, user: username, password, connectionTimeoutMillis: EXTERNAL_REQUEST_TIMEOUT,