Skip to content

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

Address greptile comments

Carlos Monastyrski575fae63e985
diff --git a/backend/src/services/signer/signer-service.ts b/backend/src/services/signer/signer-service.ts
index 870826761d..ffa73b9cda 100644
--- a/backend/src/services/signer/signer-service.ts
+++ b/backend/src/services/signer/signer-service.ts
@@ -530,6 +530,18 @@ export const signerServiceFactory = ({
};
const checkCertificateImport = async (dto: TCheckCertificateImportDTO) => {
+ const { permission } = await permissionService.getProjectPermission({
+ actor: dto.actor,
+ actorId: dto.actorId,
+ projectId: dto.projectId,
+ actorAuthMethod: dto.actorAuthMethod,
+ actorOrgId: dto.actorOrgId,
+ actionProjectType: ActionProjectType.CertificateManager
+ });
+ ForbiddenError.from(permission).throwUnlessCan(
+ ProjectPermissionCodeSigningActions.Create,
+ ProjectPermissionSub.CodeSigners
+ );
const ca = await certificateAuthorityDAL.findByIdWithAssociatedCa(dto.caId);
if (!ca || ca.projectId !== dto.projectId) {
throw new NotFoundError({ message: `Certificate authority '${dto.caId}' not found in this organization.` });
diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerWizard/CreateSignerWizard.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerWizard/CreateSignerWizard.tsx
index b0aafe6607..2cf02a712f 100644
--- a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerWizard/CreateSignerWizard.tsx
+++ b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerWizard/CreateSignerWizard.tsx
@@ -214,6 +214,7 @@ export const CreateSignerWizard = ({ isOpen, onOpenChange, projectId }: Props) =
};
const handleClose = (open: boolean) => {
+ if (!open && submitting) return;
if (!open) reset();
onOpenChange(open);
};
@@ -278,7 +279,8 @@ export const CreateSignerWizard = ({ isOpen, onOpenChange, projectId }: Props) =
externalConfiguration
});
- handleClose(false);
+ reset();
+ onOpenChange(false);
// eslint-disable-next-line no-empty
} catch {
} finally {
@@ -384,6 +386,7 @@ export const CreateSignerWizard = ({ isOpen, onOpenChange, projectId }: Props) =
};
const goBack = () => {
+ if (submitting) return;
if (step > 0) setStep((s) => s - 1);
};
@@ -437,7 +440,7 @@ export const CreateSignerWizard = ({ isOpen, onOpenChange, projectId }: Props) =
activeStep={step}
orientation="vertical"
onStepChange={(i) => {
- if (i < step) setStep(i);
+ if (i < step && !submitting) setStep(i);
}}
>
<StepperList>
@@ -542,7 +545,7 @@ export const CreateSignerWizard = ({ isOpen, onOpenChange, projectId }: Props) =
Step {step + 1} of {STEPS.length}
</span>
{step > 0 && (
- <Button variant="outline" onClick={goBack}>
+ <Button variant="outline" onClick={goBack} isDisabled={submitting}>
Back
</Button>
)}