misc: added configurable env for enabling/disabling encrypt

This commit is contained in:
Sheen Capadngan
2024-11-05 22:08:16 +08:00
parent cfa8770bdc
commit 90f85152bc
3 changed files with 6 additions and 2 deletions
@@ -116,6 +116,7 @@ export const secretRotationQueueFactory = ({
queue.start(QueueName.SecretRotation, async (job) => {
const { rotationId } = job.data;
const appCfg = getConfig();
logger.info(`secretRotationQueue.process: [rotationDocument=${rotationId}]`);
const secretRotation = await secretRotationDAL.findById(rotationId);
const rotationProvider = rotationTemplates.find(({ name }) => name === secretRotation?.provider);
@@ -178,7 +179,7 @@ export const secretRotationQueueFactory = ({
const options =
provider.template.client === TDbProviderClients.MsSqlServer
? ({
encrypt: true,
encrypt: appCfg.ENABLE_MSSQL_SECRET_ROTATION_ENCRYPT,
cryptoCredentialsDetails: ca ? { ca } : {}
} as Record<string, unknown>)
: undefined;