From 5c435f764543b751d3e35f0f9d64fb06df635d0c Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Fri, 30 May 2025 00:09:47 +0800 Subject: [PATCH] misc: removed updating configuration for internal CAs --- .../certificate-authority/certificate-authority-service.ts | 1 - .../internal/internal-certificate-authority-schemas.ts | 6 +----- frontend/src/hooks/api/ca/mutations.tsx | 6 +++++- .../CertificateAuthoritiesPage/components/CaModal.tsx | 6 +----- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/backend/src/services/certificate-authority/certificate-authority-service.ts b/backend/src/services/certificate-authority/certificate-authority-service.ts index fa66758c3..a57c085ba 100644 --- a/backend/src/services/certificate-authority/certificate-authority-service.ts +++ b/backend/src/services/certificate-authority/certificate-authority-service.ts @@ -311,7 +311,6 @@ export const certificateAuthorityServiceFactory = ({ } const updatedCa = await internalCertificateAuthorityService.updateCaById({ - ...configuration, isInternal: true, enableDirectIssuance, caId: certificateAuthority.id, diff --git a/backend/src/services/certificate-authority/internal/internal-certificate-authority-schemas.ts b/backend/src/services/certificate-authority/internal/internal-certificate-authority-schemas.ts index ffec0d762..1cf9a8597 100644 --- a/backend/src/services/certificate-authority/internal/internal-certificate-authority-schemas.ts +++ b/backend/src/services/certificate-authority/internal/internal-certificate-authority-schemas.ts @@ -55,8 +55,4 @@ export const CreateInternalCertificateAuthoritySchema = GenericCreateCertificate configuration: InternalCertificateAuthorityConfigurationSchema }); -export const UpdateInternalCertificateAuthoritySchema = GenericUpdateCertificateAuthorityFieldsSchema( - CaType.INTERNAL -).extend({ - configuration: InternalCertificateAuthorityConfigurationSchema.optional() -}); +export const UpdateInternalCertificateAuthoritySchema = GenericUpdateCertificateAuthorityFieldsSchema(CaType.INTERNAL); diff --git a/frontend/src/hooks/api/ca/mutations.tsx b/frontend/src/hooks/api/ca/mutations.tsx index 9c865d451..c05760beb 100644 --- a/frontend/src/hooks/api/ca/mutations.tsx +++ b/frontend/src/hooks/api/ca/mutations.tsx @@ -31,10 +31,14 @@ export const useUpdateCa = () => { return data; }, - onSuccess: ({ projectId, type }) => { + onSuccess: ({ projectId, type }, { caName }) => { + caKeys.getCaByNameAndProjectId(caName, projectId); queryClient.invalidateQueries({ queryKey: caKeys.listCasByTypeAndProjectId(type, projectId) }); + queryClient.invalidateQueries({ + queryKey: caKeys.getCaByNameAndProjectId(caName, projectId) + }); } }); }; diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaModal.tsx index 07bf1493a..d3040576f 100644 --- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaModal.tsx +++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaModal.tsx @@ -188,11 +188,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => { name, type: CaType.INTERNAL, status, - enableDirectIssuance, - configuration: { - ...configuration, - maxPathLength: Number(configuration.maxPathLength) - } + enableDirectIssuance }); } else { // create