Skip to content

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

Made required adjustments based on review

Tuan Dang9ce6fd3f8ec2
diff --git a/backend/src/server/routes/v1/certificate-authority-router.ts b/backend/src/server/routes/v1/certificate-authority-router.ts
index 3c14b851e9..77ee70e570 100644
--- a/backend/src/server/routes/v1/certificate-authority-router.ts
+++ b/backend/src/server/routes/v1/certificate-authority-router.ts
@@ -45,7 +45,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
.describe(CERTIFICATE_AUTHORITIES.CREATE.keyAlgorithm),
requireTemplateForIssuance: z
.boolean()
- .default(true)
+ .default(false)
.describe(CERTIFICATE_AUTHORITIES.CREATE.requireTemplateForIssuance)
})
.refine(
diff --git a/backend/src/server/routes/v1/certificate-router.ts b/backend/src/server/routes/v1/certificate-router.ts
index 2558b49709..91ae85982d 100644
--- a/backend/src/server/routes/v1/certificate-router.ts
+++ b/backend/src/server/routes/v1/certificate-router.ts
@@ -101,7 +101,7 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
.refine(
(data) =>
(data.caId !== undefined && data.certificateTemplateId === undefined) ||
- (data.caId === undefined && data.pkiCollectionId === undefined && data.certificateTemplateId !== undefined),
+ (data.caId === undefined && data.certificateTemplateId !== undefined),
{
message: "Either CA ID or Certificate Template ID must be present, but not both",
path: ["caId", "certificateTemplateId"]
@@ -192,7 +192,7 @@ export const registerCertRouter = async (server: FastifyZodProvider) => {
.refine(
(data) =>
(data.caId !== undefined && data.certificateTemplateId === undefined) ||
- (data.caId === undefined && data.pkiCollectionId === undefined && data.certificateTemplateId !== undefined),
+ (data.caId === undefined && data.certificateTemplateId !== undefined),
{
message: "Either CA ID or Certificate Template ID must be present, but not both",
path: ["caId", "certificateTemplateId"]
diff --git a/frontend/src/views/Project/CaPage/components/CaDetailsSection.tsx b/frontend/src/views/Project/CaPage/components/CaDetailsSection.tsx
index 4bff132255..9d5d203374 100644
--- a/frontend/src/views/Project/CaPage/components/CaDetailsSection.tsx
+++ b/frontend/src/views/Project/CaPage/components/CaDetailsSection.tsx
@@ -36,7 +36,7 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
<ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Identity}>
{(isAllowed) => {
return (
- <Tooltip content="Edit Identity">
+ <Tooltip content="Edit CA">
<IconButton
isDisabled={!isAllowed}
ariaLabel="copy icon"
diff --git a/frontend/src/views/Project/CertificatesPage/components/CaTab/components/CaModal.tsx b/frontend/src/views/Project/CertificatesPage/components/CaTab/components/CaModal.tsx
index c32eaa9f13..1241ff1c96 100644
--- a/frontend/src/views/Project/CertificatesPage/components/CaTab/components/CaModal.tsx
+++ b/frontend/src/views/Project/CertificatesPage/components/CaTab/components/CaModal.tsx
@@ -446,26 +446,24 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
);
}}
/>
- {/* {!ca && ( */}
- <div className="flex items-center">
- <Button
- className="mr-4"
- size="sm"
- type="submit"
- isLoading={isSubmitting}
- isDisabled={isSubmitting}
- >
- {popUp?.ca?.data ? "Update" : "Create"}
- </Button>
- <Button
- colorSchema="secondary"
- variant="plain"
- onClick={() => handlePopUpToggle("ca", false)}
- >
- Cancel
- </Button>
- </div>
- {/* )} */}
+ <div className="flex items-center">
+ <Button
+ className="mr-4"
+ size="sm"
+ type="submit"
+ isLoading={isSubmitting}
+ isDisabled={isSubmitting}
+ >
+ {popUp?.ca?.data ? "Update" : "Create"}
+ </Button>
+ <Button
+ colorSchema="secondary"
+ variant="plain"
+ onClick={() => handlePopUpToggle("ca", false)}
+ >
+ Cancel
+ </Button>
+ </div>
</form>
</ModalContent>
</Modal>
diff --git a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesSection.tsx b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesSection.tsx
index e76d2ce332..b1cce918f0 100644
--- a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesSection.tsx
+++ b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesSection.tsx
@@ -59,25 +59,6 @@ export const CertificateTemplatesSection = ({ caId }: Props) => {
return (
<div className="mt-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- {/* <div className="mb-4 flex justify-between">
- <p className="text-xl font-semibold text-mineshaft-100">Certificate Templates</p>
- <ProjectPermissionCan
- I={ProjectPermissionActions.Create}
- a={ProjectPermissionSub.CertificateTemplates}
- >
- {(isAllowed) => (
- <Button
- colorSchema="primary"
- type="submit"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() => handlePopUpOpen("certificateTemplate")}
- isDisabled={!isAllowed}
- >
- Create
- </Button>
- )}
- </ProjectPermissionCan>
- </div> */}
<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>
<ProjectPermissionCan
diff --git a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx
index 0f284097e0..026689231b 100644
--- a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx
+++ b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx
@@ -47,10 +47,6 @@ export const CertificateTemplatesTable = ({ handlePopUpOpen, caId }: Props) => {
const { subscription } = useSubscription();
const { data, isLoading } = useGetCaCertTemplates(caId);
-
- // const { data, isLoading } = useListWorkspaceCertificateTemplates({
- // workspaceId: currentWorkspace?.id ?? ""
- // });
return (
<div>
@@ -59,7 +55,6 @@ export const CertificateTemplatesTable = ({ handlePopUpOpen, caId }: Props) => {
<THead>
<Tr>
<Th>Name</Th>
- {/* <Th>Certificate Authority</Th> */}
<Th />
</Tr>
</THead>
@@ -70,7 +65,6 @@ export const CertificateTemplatesTable = ({ handlePopUpOpen, caId }: Props) => {
return (
<Tr className="h-10" key={`certificate-${certificateTemplate.id}`}>
<Td>{certificateTemplate.name}</Td>
- {/* <Td>{certificateTemplate.caName}</Td> */}
<Td className="flex justify-end">
<DropdownMenu>
<DropdownMenuTrigger asChild className="rounded-lg">