mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 02:29:35 +00:00
Update authz logic for MI
This commit is contained in:
+1
@@ -244,6 +244,7 @@ export const AddMachineIdentityModal = ({
|
||||
|
||||
reset();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
const error = err as any;
|
||||
const text = error?.response?.data?.message
|
||||
?? `Failed to ${popUp?.machineIdentity?.data ? "updated" : "created"} machine identity`;
|
||||
|
||||
+4
-1
@@ -81,8 +81,11 @@ export const MachineIdentityTable = ({
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
const error = err as any;
|
||||
const text = error?.response?.data?.message ?? "Failed to update machine identity role"
|
||||
|
||||
createNotification({
|
||||
text: "Failed to update machine identity role",
|
||||
text,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
|
||||
+11
-8
@@ -35,7 +35,7 @@ export const MachineIdentitySection = withProjectPermission(
|
||||
"upgradePlan"
|
||||
] as const);
|
||||
|
||||
const onRemoveServiceTokenDataSubmit = async (machineId: string) => {
|
||||
const onRemoveMachineIdentitySubmit = async (machineId: string) => {
|
||||
try {
|
||||
|
||||
await deleteMutateAsync({
|
||||
@@ -44,17 +44,20 @@ export const MachineIdentitySection = withProjectPermission(
|
||||
});
|
||||
|
||||
createNotification({
|
||||
text: "Successfully removed service account from project",
|
||||
text: "Successfully removed machine identity from project",
|
||||
type: "success"
|
||||
});
|
||||
|
||||
handlePopUpClose("deleteMachineIdentity");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
createNotification({
|
||||
text: "Failed to delete service account from project",
|
||||
type: "error"
|
||||
});
|
||||
console.error(err);
|
||||
const error = err as any;
|
||||
const text = error?.response?.data?.message ?? "Failed to remove machine identity from project"
|
||||
|
||||
createNotification({
|
||||
text,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +99,7 @@ export const MachineIdentitySection = withProjectPermission(
|
||||
onChange={(isOpen) => handlePopUpToggle("deleteMachineIdentity", isOpen)}
|
||||
deleteKey="confirm"
|
||||
onDeleteApproved={() =>
|
||||
onRemoveServiceTokenDataSubmit(
|
||||
onRemoveMachineIdentitySubmit(
|
||||
(popUp?.deleteMachineIdentity?.data as { machineId: string })?.machineId
|
||||
)
|
||||
}
|
||||
|
||||
+4
-1
@@ -89,8 +89,11 @@ export const MachineIdentityTable = ({
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
const error = err as any;
|
||||
const text = error?.response?.data?.message ?? "Failed to update machine identity role"
|
||||
|
||||
createNotification({
|
||||
text: "Failed to update machine identity role",
|
||||
text,
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user