mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
Added authz logic to MI
This commit is contained in:
@@ -32,7 +32,7 @@ export const MembersPage = withProjectPermission(
|
||||
<Tab value={TabSections.Member}>People</Tab>
|
||||
<Tab value={TabSections.MachineIdentities}>Machine Identities</Tab>
|
||||
<Tab value={TabSections.ServiceTokens}>Service Tokens</Tab>
|
||||
<Tab value={TabSections.Roles}>Roles</Tab>
|
||||
<Tab value={TabSections.Roles}>Project Roles</Tab>
|
||||
</TabList>
|
||||
<TabPanel value={TabSections.Member}>
|
||||
<motion.div
|
||||
|
||||
+3
-3
@@ -26,8 +26,8 @@ import {
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
const schema = yup.object({
|
||||
machineId: yup.string().required("ST V3 id is required"),
|
||||
role: yup.string().required("ST V3 role is required")
|
||||
machineId: yup.string().required("Machine identity id is required"),
|
||||
role: yup.string().required("Machine identity role is required")
|
||||
}).required();
|
||||
|
||||
export type FormData = yup.InferType<typeof schema>;
|
||||
@@ -124,7 +124,7 @@ export const AddMachineIdentityModal = ({
|
||||
defaultValue={filteredMachineMembershipOrgs?.[0]?._id}
|
||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
||||
<FormControl
|
||||
label="Service Account"
|
||||
label="Machine Identity"
|
||||
errorText={error?.message}
|
||||
isError={Boolean(error)}
|
||||
>
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ export const MachineIdentitySection = withProjectPermission(
|
||||
</p>
|
||||
<ProjectPermissionCan
|
||||
I={ProjectPermissionActions.Create}
|
||||
a={ProjectPermissionSub.ServiceTokens}
|
||||
a={ProjectPermissionSub.MachineIdentity}
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<Button
|
||||
@@ -104,5 +104,5 @@ export const MachineIdentitySection = withProjectPermission(
|
||||
</div>
|
||||
);
|
||||
},
|
||||
{ action: ProjectPermissionActions.Read, subject: ProjectPermissionSub.ServiceTokens }
|
||||
{ action: ProjectPermissionActions.Read, subject: ProjectPermissionSub.MachineIdentity }
|
||||
);
|
||||
+3
-3
@@ -135,7 +135,7 @@ export const MachineIdentityTable = ({
|
||||
<Td>
|
||||
<ProjectPermissionCan
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.ServiceTokens}
|
||||
a={ProjectPermissionSub.MachineIdentity}
|
||||
>
|
||||
{(isAllowed) => {
|
||||
return (
|
||||
@@ -156,7 +156,7 @@ export const MachineIdentityTable = ({
|
||||
{(roles || [])
|
||||
.map(({ slug, name: roleName }) => (
|
||||
<SelectItem value={slug} key={`owner-option-${slug}`}>
|
||||
{roleName}
|
||||
{roleName}
|
||||
</SelectItem>
|
||||
))}
|
||||
</Select>
|
||||
@@ -168,7 +168,7 @@ export const MachineIdentityTable = ({
|
||||
<Td className="flex justify-end">
|
||||
<ProjectPermissionCan
|
||||
I={ProjectPermissionActions.Delete}
|
||||
a={ProjectPermissionSub.ServiceTokens}
|
||||
a={ProjectPermissionSub.MachineIdentity}
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
|
||||
Reference in New Issue
Block a user