mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat(secret-rotation): updated lottie and added side effect on successfully
This commit is contained in:
@@ -859,6 +859,14 @@ export const createSecretByNameBatch = async (req: Request, res: Response) => {
|
||||
authData: req.authData
|
||||
});
|
||||
|
||||
await EventService.handleEvent({
|
||||
event: eventPushSecrets({
|
||||
workspaceId: new Types.ObjectId(workspaceId),
|
||||
environment,
|
||||
secretPath
|
||||
})
|
||||
});
|
||||
|
||||
return res.status(200).send({
|
||||
secrets: createdSecrets
|
||||
});
|
||||
@@ -903,6 +911,14 @@ export const updateSecretByNameBatch = async (req: Request, res: Response) => {
|
||||
authData: req.authData
|
||||
});
|
||||
|
||||
await EventService.handleEvent({
|
||||
event: eventPushSecrets({
|
||||
workspaceId: new Types.ObjectId(workspaceId),
|
||||
environment,
|
||||
secretPath
|
||||
})
|
||||
});
|
||||
|
||||
return res.status(200).send({
|
||||
secrets: updatedSecrets
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Client as PgClient } from "pg";
|
||||
import mysql from "mysql";
|
||||
|
||||
import { client, getRootEncryptionKey } from "../../config";
|
||||
import { BotService, TelemetryService } from "../../services";
|
||||
import { BotService, EventService, TelemetryService } from "../../services";
|
||||
import { SecretRotation } from "./models";
|
||||
import { rotationTemplates } from "./templates";
|
||||
import {
|
||||
@@ -26,6 +26,7 @@ import { ISecret, Secret } from "../../models";
|
||||
import { SECRET_SHARED } from "../../variables";
|
||||
import { EESecretService } from "../services";
|
||||
import { SecretVersion } from "../models";
|
||||
import { eventPushSecrets } from "../../events";
|
||||
|
||||
const REGEX = /\${([^}]+)}/g;
|
||||
const SLUG_ALPHABETS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
@@ -380,8 +381,15 @@ secretRotationQueue.process(async (job: Job) => {
|
||||
folderId
|
||||
});
|
||||
|
||||
const postHogClient = await TelemetryService.getPostHogClient();
|
||||
await EventService.handleEvent({
|
||||
event: eventPushSecrets({
|
||||
workspaceId: secretRotation.workspace,
|
||||
environment: secretRotation.environment,
|
||||
secretPath: secretRotation.secretPath
|
||||
})
|
||||
});
|
||||
|
||||
const postHogClient = await TelemetryService.getPostHogClient();
|
||||
if (postHogClient) {
|
||||
postHogClient.capture({
|
||||
event: "secrets rotated",
|
||||
@@ -401,6 +409,7 @@ secretRotationQueue.process(async (job: Job) => {
|
||||
lastRotatedAt: new Date().toUTCString()
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -505,7 +505,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
||||
}
|
||||
icon="rotation"
|
||||
>
|
||||
Secret rotation
|
||||
Secret Rotation
|
||||
</MenuItem>
|
||||
</a>
|
||||
</Link>
|
||||
@@ -517,7 +517,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
||||
}
|
||||
icon="system-outline-189-domain-verification"
|
||||
>
|
||||
Secret approvals
|
||||
Secret Approvals
|
||||
{Boolean(secretApprovalReqCount?.open) && (
|
||||
<span className="ml-2 rounded border border-primary-400 bg-primary-600 py-0.5 px-1 text-xs font-semibold text-black">
|
||||
{secretApprovalReqCount?.open}
|
||||
|
||||
Reference in New Issue
Block a user