Skip to content

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

Address PR comments

Carlos Monastyrski85a03078dd4c
diff --git a/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts b/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
index bbdf96dc8e..0b7148b15c 100644
--- a/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
+++ b/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
@@ -531,7 +531,6 @@ export const pamAccountRotationServiceFactory = (deps: TPamAccountRotationServic
ResourcePermissionPamResourceActions.ManageRotation,
ctx
);
- // Manual rotation follows the same readiness rule as the schedule, so a not-ready account can't be rotated out-of-band.
const readiness = getRotationReadiness({
accountId: account.id,
accountType: account.accountType,
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index c5c77e707d..9bd1cf65c1 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -638,7 +638,7 @@ export const useRotatePamAccount = () => {
const { data } = await apiRequest.post(`/api/v1/pam/accounts/${accountId}/rotation/rotate`);
return data;
},
- onSuccess: (_, { accountId }) => {
+ onSettled: (_, __, { accountId }) => {
queryClient.invalidateQueries({ queryKey: pamKeys.accountRotation(accountId) });
queryClient.invalidateQueries({ queryKey: pamKeys.getAccount(accountId) });
}
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/RotationTab.tsx b/frontend/src/pages/pam/PamAccountsPage/components/RotationTab.tsx
index 41bfa2f111..758f1c6d40 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/RotationTab.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/RotationTab.tsx
@@ -177,7 +177,7 @@ export const RotationTab = ({ accountId, onDirtyChange }: Props) => {
await rotateNow.mutateAsync({ accountId });
createNotification({ type: "success", text: "Credential rotated" });
} catch {
- createNotification({ type: "error", text: "Rotation failed. See the error below." });
+ // A failed rotation returns a 4xx that the global request handler surfaces as a toast
}
};
@@ -242,14 +242,14 @@ export const RotationTab = ({ accountId, onDirtyChange }: Props) => {
>
Rotate now
</Button>
- </div>
- {hasFailure && (
- <Alert variant="danger">
- <AlertTitle>Last rotation failed</AlertTitle>
- <AlertDescription>{rotation.lastRotationError}</AlertDescription>
- </Alert>
- )}
+ {hasFailure && (
+ <Alert variant="danger" className="mt-4">
+ <AlertTitle>Last rotation failed</AlertTitle>
+ <AlertDescription>{rotation.lastRotationError}</AlertDescription>
+ </Alert>
+ )}
+ </div>
<div className="rounded-lg border border-border bg-container p-4">
<h3 className="text-sm font-semibold text-foreground">Rotation account</h3>