mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 13:56:43 +00:00
Update MI authz logic
This commit is contained in:
@@ -33,7 +33,7 @@ export const LogsTableRow = ({
|
||||
return (
|
||||
<Td>
|
||||
<p>{`${actor.metadata.name}`}</p>
|
||||
<p>Service token V3</p>
|
||||
<p>Machine identity</p>
|
||||
</Td>
|
||||
);
|
||||
default:
|
||||
|
||||
+3
-2
@@ -27,7 +27,7 @@ import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
const schema = yup.object({
|
||||
machineId: yup.string().required("Machine identity id is required"),
|
||||
role: yup.string().required("Machine identity role is required")
|
||||
role: yup.string()
|
||||
}).required();
|
||||
|
||||
export type FormData = yup.InferType<typeof schema>;
|
||||
@@ -85,10 +85,11 @@ export const AddMachineIdentityModal = ({
|
||||
role
|
||||
}: FormData) => {
|
||||
try {
|
||||
|
||||
await addMachineToWorkspaceMutateAsync({
|
||||
workspaceId,
|
||||
machineId,
|
||||
role
|
||||
role: role || undefined
|
||||
});
|
||||
|
||||
createNotification({
|
||||
|
||||
+9
-2
@@ -9,6 +9,7 @@ import {
|
||||
faLock,
|
||||
faNetworkWired,
|
||||
faPuzzlePiece,
|
||||
faServer,
|
||||
faShield,
|
||||
faTags,
|
||||
faUser,
|
||||
@@ -59,6 +60,12 @@ const SINGLE_PERMISSION_LIST = [
|
||||
icon: faUser,
|
||||
formName: "member"
|
||||
},
|
||||
{
|
||||
title: "Machine identity management",
|
||||
subtitle: "Add, view, update and remove machine identities from the project",
|
||||
icon: faServer,
|
||||
formName: "machine-identity"
|
||||
},
|
||||
{
|
||||
title: "Webhooks",
|
||||
subtitle: "Webhook management control",
|
||||
@@ -109,7 +116,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => {
|
||||
const isNonEditable = ["admin", "member", "viewer"].includes(role?.slug || "");
|
||||
const isNonEditable = ["admin", "member", "viewer", "no-access"].includes(role?.slug || "");
|
||||
const isNewRole = !role?.slug;
|
||||
|
||||
const { createNotification } = useNotificationContext();
|
||||
@@ -133,7 +140,7 @@ export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => {
|
||||
|
||||
const handleRoleUpdate = async (el: TFormSchema) => {
|
||||
if (!role?._id) return;
|
||||
|
||||
|
||||
try {
|
||||
await updateRole({
|
||||
orgId,
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ export const formSchema = z.object({
|
||||
.object({
|
||||
secrets: z.record(multiEnvPermissionSchema).optional(),
|
||||
member: generalPermissionSchema,
|
||||
"machine-identity": generalPermissionSchema,
|
||||
role: generalPermissionSchema,
|
||||
integrations: generalPermissionSchema,
|
||||
webhooks: generalPermissionSchema,
|
||||
|
||||
Reference in New Issue
Block a user