Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: resolved rotation and dynamic lease mail not working.

=81b6c02365f8
diff --git a/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts b/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts
index 6bbf3d900e..ef1eac56e6 100644
--- a/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts
+++ b/backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-queue.ts
@@ -123,7 +123,7 @@ export const dynamicSecretLeaseQueueServiceFactory = ({
leaseId
},
{
- jobId: `dynamic-secret-lease-revocation-failed-email-${dynamicSecretId}`,
+ jobId: `dynamic-secret-lease-revocation-failure-email-${dynamicSecretId}`,
delay,
attempts: 3,
backoff: {
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
index 856cadd540..1b00b0f521 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
@@ -193,12 +193,14 @@ export const secretRotationV2ServiceFactory = ({
const appCfg = getConfig();
if (!appCfg.isSmtpConfigured) return; // comment out if testing email sending
+ const { name, type, projectId, lastRotationAttemptedAt, folder, environment, id } = secretRotation;
+
await queueService.queue(
QueueName.SecretRotationV2,
QueueJobs.SecretRotationV2SendNotification,
- { secretRotation },
+ { secretRotation: { name, type, projectId, lastRotationAttemptedAt, folder, environment, id } },
{
- jobId: `secret-rotation-v2-notification-${secretRotation.id}`,
+ jobId: `secret-rotation-v2-notifications-${secretRotation.id}`,
attempts: 5,
backoff: {
type: "exponential",
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
index d5f39e3d1c..12f136e8d4 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
@@ -307,9 +307,16 @@ export type TSecretRotationRotateGeneratedCredentials = {
};
export type TSecretRotationRotateSecretsJobPayload = { rotationId: string; queuedAt: Date; isManualRotation?: boolean };
-
export type TSecretRotationSendNotificationJobPayload = {
- secretRotation: TSecretRotationV2Raw;
+ secretRotation: {
+ id: string;
+ name: string;
+ type: string;
+ projectId: string;
+ folder: { path: string };
+ lastRotationAttemptedAt: Date;
+ environment: { name: string; slug: string };
+ };
};
// scott: the reason for the callback structure of the rotation factory is to facilitate, when possible,
diff --git a/backend/src/queue/queue-service.ts b/backend/src/queue/queue-service.ts
index 45154ea5fc..c67162342f 100644
--- a/backend/src/queue/queue-service.ts
+++ b/backend/src/queue/queue-service.ts
@@ -1005,7 +1005,8 @@ export const queueServiceFactory = (
removeOnFail: true,
removeOnComplete: true,
...opts,
- repeat: repeat ? { ...repeat, utc: true } : undefined
+ repeat: repeat ? { ...repeat, utc: true } : undefined,
+ jobId
};
if (persistantQueues.has(name)) {
@@ -1024,12 +1025,12 @@ export const queueServiceFactory = (
tx
);
// if this fails transaction rollback happens
- await q.add(job, data, { ...opts, jobId });
+ await q.add(job, data, finalOptions);
});
return;
}
- await q.add(job, data, { ...opts, jobId });
+ await q.add(job, data, finalOptions);
};
const stopRepeatableJob: TQueueServiceFactory["stopRepeatableJob"] = async (name, job, repeatOpt, jobId) => {