mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
Address greptile comments
This commit is contained in:
@@ -24,8 +24,4 @@ export async function down(knex: Knex): Promise<void> {
|
||||
t.dropColumn("issuerType");
|
||||
});
|
||||
}
|
||||
|
||||
await knex.schema.alterTable(TableName.PkiCertificateProfile, (t) => {
|
||||
t.uuid("caId").notNullable().alter();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -415,9 +415,7 @@ export const certificateProfileServiceFactory = ({
|
||||
validateIssuerTypeConstraints(finalIssuerType, finalEnrollmentType, finalCaId ?? null, existingProfile.caId);
|
||||
|
||||
const updatedData =
|
||||
finalIssuerType === IssuerType.SELF_SIGNED && existingProfile.caId && data.issuerType === IssuerType.SELF_SIGNED
|
||||
? { ...data, caId: null }
|
||||
: data;
|
||||
finalIssuerType === IssuerType.SELF_SIGNED && existingProfile.caId ? { ...data, caId: null } : data;
|
||||
|
||||
const { estConfig, apiConfig, ...profileUpdateData } = updatedData;
|
||||
|
||||
|
||||
@@ -1792,7 +1792,7 @@ describe("CertificateV3Service", () => {
|
||||
certificateId: "cert-123",
|
||||
...mockActor
|
||||
})
|
||||
).rejects.toThrow("Only certificates issued from a profile or self-signed certificates can be renewed");
|
||||
).rejects.toThrow("Only certificates issued from a profile can be renewed");
|
||||
});
|
||||
|
||||
it("should reject renewal if certificate was issued from CSR (external private key)", async () => {
|
||||
|
||||
@@ -1191,10 +1191,9 @@ export const certificateV3ServiceFactory = ({
|
||||
throw new NotFoundError({ message: "Certificate not found" });
|
||||
}
|
||||
|
||||
const isSelfSigned = !originalCert.profileId && !originalCert.caId && originalCert.certificateTemplateId === null;
|
||||
if (!originalCert.profileId && !originalCert.caId && !isSelfSigned) {
|
||||
if (!originalCert.profileId) {
|
||||
throw new ForbiddenRequestError({
|
||||
message: "Only certificates issued from a profile or self-signed certificates can be renewed"
|
||||
message: "Only certificates issued from a profile can be renewed"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export const ProfileRow = ({
|
||||
}: Props) => {
|
||||
const { permission } = useProjectPermission();
|
||||
|
||||
const { data: caData } = useGetCaById(profile.caId || "");
|
||||
const { data: caData } = useGetCaById(profile.caId ?? "");
|
||||
|
||||
const { popUp, handlePopUpToggle } = usePopUp(["issueCertificate"] as const);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user