mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
feat: updated redis and rotation
This commit is contained in:
@@ -52,7 +52,7 @@ const executeTransactions = async (connection: Redis, commands: string[]): Promi
|
|||||||
export const RedisDatabaseProvider = (): TDynamicProviderFns => {
|
export const RedisDatabaseProvider = (): TDynamicProviderFns => {
|
||||||
const validateProviderInputs = async (inputs: unknown) => {
|
const validateProviderInputs = async (inputs: unknown) => {
|
||||||
const providerInputs = await DynamicSecretRedisDBSchema.parseAsync(inputs);
|
const providerInputs = await DynamicSecretRedisDBSchema.parseAsync(inputs);
|
||||||
await verifyHostInputValidity(providerInputs.host);
|
const [hostIp] = await verifyHostInputValidity(providerInputs.host);
|
||||||
validateHandlebarTemplate("Redis creation", providerInputs.creationStatement, {
|
validateHandlebarTemplate("Redis creation", providerInputs.creationStatement, {
|
||||||
allowedExpressions: (val) => ["username", "password", "expiration"].includes(val)
|
allowedExpressions: (val) => ["username", "password", "expiration"].includes(val)
|
||||||
});
|
});
|
||||||
@@ -65,7 +65,7 @@ export const RedisDatabaseProvider = (): TDynamicProviderFns => {
|
|||||||
allowedExpressions: (val) => ["username"].includes(val)
|
allowedExpressions: (val) => ["username"].includes(val)
|
||||||
});
|
});
|
||||||
|
|
||||||
return providerInputs;
|
return { ...providerInputs, host: hostIp };
|
||||||
};
|
};
|
||||||
|
|
||||||
const $getClient = async (providerInputs: z.infer<typeof DynamicSecretRedisDBSchema>) => {
|
const $getClient = async (providerInputs: z.infer<typeof DynamicSecretRedisDBSchema>) => {
|
||||||
|
|||||||
+2
-2
@@ -88,13 +88,13 @@ export const secretRotationDbFn = async ({
|
|||||||
options
|
options
|
||||||
}: TSecretRotationDbFn) => {
|
}: TSecretRotationDbFn) => {
|
||||||
const ssl = ca ? { rejectUnauthorized: false, ca } : undefined;
|
const ssl = ca ? { rejectUnauthorized: false, ca } : undefined;
|
||||||
await verifyHostInputValidity(host);
|
const [hostIp] = await verifyHostInputValidity(host);
|
||||||
const db = knex({
|
const db = knex({
|
||||||
client,
|
client,
|
||||||
connection: {
|
connection: {
|
||||||
database,
|
database,
|
||||||
port,
|
port,
|
||||||
host,
|
host: hostIp,
|
||||||
user: username,
|
user: username,
|
||||||
password,
|
password,
|
||||||
connectionTimeoutMillis: EXTERNAL_REQUEST_TIMEOUT,
|
connectionTimeoutMillis: EXTERNAL_REQUEST_TIMEOUT,
|
||||||
|
|||||||
Reference in New Issue
Block a user