Skip to content

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

Fix type issues

Tuan Dangec1ce3dc06ef
diff --git a/frontend/src/context/OrgPermissionContext/index.tsx b/frontend/src/context/OrgPermissionContext/index.tsx
index 10d7703b89..730fe55b1c 100644
--- a/frontend/src/context/OrgPermissionContext/index.tsx
+++ b/frontend/src/context/OrgPermissionContext/index.tsx
@@ -1,6 +1,3 @@
export { OrgPermissionProvider, useOrgPermission } from "./OrgPermissionContext";
export type { TOrgPermission } from "./types";
-export {
- OrgPermissionActions,
- OrgPermissionSshCertificateTemplateActions,
- OrgPermissionSubjects} from "./types";
+export { OrgPermissionActions, OrgPermissionSubjects } from "./types";
diff --git a/frontend/src/context/OrgPermissionContext/types.ts b/frontend/src/context/OrgPermissionContext/types.ts
index c0bdd80295..ae2c957361 100644
--- a/frontend/src/context/OrgPermissionContext/types.ts
+++ b/frontend/src/context/OrgPermissionContext/types.ts
@@ -53,6 +53,6 @@ export type OrgPermissionSet =
| [OrgPermissionActions, OrgPermissionSubjects.ProjectTemplates]
| [OrgPermissionActions, OrgPermissionSubjects.SshCertificateAuthorities]
| [OrgPermissionActions, OrgPermissionSubjects.SshCertificates]
- | [OrgPermissionSshCertificateTemplateActions, OrgPermissionSubjects.SshCertificateTemplates];
+ | [OrgPermissionActions, OrgPermissionSubjects.SshCertificateTemplates];
export type TOrgPermission = MongoAbility<OrgPermissionSet>;
diff --git a/frontend/src/context/index.tsx b/frontend/src/context/index.tsx
index 83e7711113..91dae5d2d2 100644
--- a/frontend/src/context/index.tsx
+++ b/frontend/src/context/index.tsx
@@ -4,7 +4,6 @@ export type { TOrgPermission } from "./OrgPermissionContext";
export {
OrgPermissionActions,
OrgPermissionProvider,
- OrgPermissionSshCertificateTemplateActions,
OrgPermissionSubjects,
useOrgPermission
} from "./OrgPermissionContext";
diff --git a/frontend/src/views/Org/RolePage/components/OrgRoleModifySection.utils.ts b/frontend/src/views/Org/RolePage/components/OrgRoleModifySection.utils.ts
index b155e21cb8..b9da49ca70 100644
--- a/frontend/src/views/Org/RolePage/components/OrgRoleModifySection.utils.ts
+++ b/frontend/src/views/Org/RolePage/components/OrgRoleModifySection.utils.ts
@@ -13,13 +13,6 @@ const generalPermissionSchema = z
})
.optional();
-const sshCertificateSchema = z
- .object({
- read: z.boolean().optional(),
- create: z.boolean().optional()
- })
- .optional();
-
const adminConsolePermissionSchmea = z
.object({
"access-all-projects": z.boolean().optional()
@@ -58,7 +51,7 @@ export const formSchema = z.object({
[OrgPermissionSubjects.Kms]: generalPermissionSchema,
[OrgPermissionSubjects.ProjectTemplates]: generalPermissionSchema,
[OrgPermissionSubjects.SshCertificateAuthorities]: generalPermissionSchema,
- [OrgPermissionSubjects.SshCertificates]: sshCertificateSchema,
+ [OrgPermissionSubjects.SshCertificates]: generalPermissionSchema,
[OrgPermissionSubjects.SshCertificateTemplates]: generalPermissionSchema
})
.optional()
diff --git a/frontend/src/views/Org/RolePage/components/RolePermissionsSection/RolePermissionRow.tsx b/frontend/src/views/Org/RolePage/components/RolePermissionsSection/RolePermissionRow.tsx
index 4a5699ec6e..3a50dc9762 100644
--- a/frontend/src/views/Org/RolePage/components/RolePermissionsSection/RolePermissionRow.tsx
+++ b/frontend/src/views/Org/RolePage/components/RolePermissionsSection/RolePermissionRow.tsx
@@ -51,11 +51,6 @@ const PROJECT_TEMPLATES_PERMISSIONS = [
{ action: "delete", label: "Remove" }
] as const;
-const SSH_CERTIFICATES_PERMISSIONS = [
- { action: "read", label: "View" },
- { action: "create", label: "Create" }
-] as const;
-
const getPermissionList = (option: string) => {
switch (option) {
case "secret-scanning":
@@ -68,8 +63,6 @@ const getPermissionList = (option: string) => {
return MEMBERS_PERMISSIONS;
case OrgPermissionSubjects.ProjectTemplates:
return PROJECT_TEMPLATES_PERMISSIONS;
- case OrgPermissionSubjects.SshCertificates:
- return SSH_CERTIFICATES_PERMISSIONS;
default:
return PERMISSIONS;
}
diff --git a/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesSection.tsx b/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesSection.tsx
index 75db07ff61..9a66f66229 100644
--- a/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesSection.tsx
+++ b/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesSection.tsx
@@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import { DeleteActionModal, IconButton } from "@app/components/v2";
-import { OrgPermissionSshCertificateTemplateActions, OrgPermissionSubjects } from "@app/context";
+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
import { usePopUp } from "@app/hooks";
import { useDeleteSshCertTemplate } from "@app/hooks/api";
@@ -52,7 +52,7 @@ export const SshCertificateTemplatesSection = ({ caId }: Props) => {
<div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">
<h3 className="text-lg font-semibold text-mineshaft-100">Certificate Templates</h3>
<OrgPermissionCan
- I={OrgPermissionSshCertificateTemplateActions.Create}
+ I={OrgPermissionActions.Create}
a={OrgPermissionSubjects.SshCertificateTemplates}
>
{(isAllowed) => (
diff --git a/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesTable.tsx b/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesTable.tsx
index 62cf1a8b4d..8104a64421 100644
--- a/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesTable.tsx
+++ b/frontend/src/views/Org/SshCaPage/components/SshCertificateTemplatesTable.tsx
@@ -1,4 +1,4 @@
-import { faCertificate,faEllipsis, faFileAlt, faTrash } from "@fortawesome/free-solid-svg-icons";
+import { faCertificate, faEllipsis, faFileAlt, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { twMerge } from "tailwind-merge";
@@ -19,7 +19,7 @@ import {
Tooltip,
Tr
} from "@app/components/v2";
-import { OrgPermissionSshCertificateTemplateActions, OrgPermissionSubjects } from "@app/context";
+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
import { useGetSshCaCertTemplates } from "@app/hooks/api";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -69,7 +69,7 @@ export const SshCertificateTemplatesTable = ({ handlePopUpOpen, sshCaId }: Props
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="p-1">
<OrgPermissionCan
- I={OrgPermissionSshCertificateTemplateActions.Edit}
+ I={OrgPermissionActions.Edit}
a={OrgPermissionSubjects.SshCertificateTemplates}
>
<DropdownMenuItem
@@ -87,7 +87,7 @@ export const SshCertificateTemplatesTable = ({ handlePopUpOpen, sshCaId }: Props
</DropdownMenuItem>
</OrgPermissionCan>
<OrgPermissionCan
- I={OrgPermissionSshCertificateTemplateActions.Edit}
+ I={OrgPermissionActions.Edit}
a={OrgPermissionSubjects.SshCertificateTemplates}
>
<DropdownMenuItem
@@ -102,7 +102,7 @@ export const SshCertificateTemplatesTable = ({ handlePopUpOpen, sshCaId }: Props
</DropdownMenuItem>
</OrgPermissionCan>
<OrgPermissionCan
- I={OrgPermissionSshCertificateTemplateActions.Delete}
+ I={OrgPermissionActions.Delete}
a={OrgPermissionSubjects.SshCertificateTemplates}
>
{(isAllowed) => (
diff --git a/frontend/src/views/Org/SshPage/components/SshCertificatesTable.tsx b/frontend/src/views/Org/SshPage/components/SshCertificatesTable.tsx
index 4ef0e78abf..c696919bbe 100644
--- a/frontend/src/views/Org/SshPage/components/SshCertificatesTable.tsx
+++ b/frontend/src/views/Org/SshPage/components/SshCertificatesTable.tsx
@@ -11,7 +11,8 @@ import {
Td,
Th,
THead,
- Tr} from "@app/components/v2";
+ Tr
+} from "@app/components/v2";
import { useOrganization } from "@app/context";
import { useListOrgSshCertificates } from "@app/hooks/api";
import { sshCertTypeToNameMap } from "@app/hooks/api/ssh-ca/constants";
@@ -29,6 +30,8 @@ export const SshCertificatesTable = () => {
limit: perPage
});
+ console.log("SSH Certificates Table data: ", data);
+
return (
<TableContainer>
<Table>