misc: addressed comments

This commit is contained in:
Sheen Capadngan
2025-11-28 04:33:14 +08:00
parent 96d36bf1a6
commit b5e2547af0
7 changed files with 12 additions and 41 deletions

View File

@@ -221,7 +221,7 @@ In the following steps, we explore how to issue a X.509 certificate under a CA.
### Sample request
```bash Request
curl --location --request POST 'https://app.infisical.com/api/v3/pki/certificates/issue-certificate' \
curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/certificates/issue-certificate' \
--header 'Content-Type: application/json' \
--data-raw '{
"profileId": "<profile-id>",

View File

@@ -105,7 +105,7 @@ Here, select the certificate profile from step 1 that will be used to issue the
### Sample request
```bash Request
curl --location --request POST 'https://app.infisical.com/api/v3/pki/certificates/issue-certificate' \
curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/certificates/issue-certificate' \
--header 'Authorization: Bearer <access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
@@ -151,7 +151,7 @@ Here, select the certificate profile from step 1 that will be used to issue the
### Sample request
```bash Request
curl --location --request POST 'https://app.infisical.com/api/v3/pki/certificates/sign-certificate' \
curl --location --request POST 'https://app.infisical.com/api/v1/cert-manager/certificates/sign-certificate' \
--header 'Authorization: Bearer <access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{

View File

@@ -66,7 +66,10 @@ export type TUnifiedCertificateAuthority =
| TAzureAdCsCertificateAuthority
| TInternalCertificateAuthority;
export type TCreateCertificateAuthorityDTO = Omit<TUnifiedCertificateAuthority, "id">;
export type TCreateCertificateAuthorityDTO = Omit<
TUnifiedCertificateAuthority,
"id" | "enableDirectIssuance"
>;
export type TUpdateCertificateAuthorityDTO = Partial<TUnifiedCertificateAuthority> & {
id: string;
type: CaType;

View File

@@ -89,7 +89,7 @@ export const useCreateCertTemplateV2 = () => {
mutationFn: async (dto) => {
const { data } = await apiRequest.post<{
certificateTemplate: TCertificateTemplate;
}>("/api/v1/cert-manager/certificate-templates", dto);
}>("/api/v2/pki/certificate-templates", dto);
return data.certificateTemplate;
},
onSuccess: (_, { projectId }) => {
@@ -108,7 +108,7 @@ export const useUpdateCertTemplateV2 = () => {
return useMutation<TCertificateTemplate, object, TUpdateCertificateTemplateV2DTO>({
mutationFn: async (dto) => {
const { data } = await apiRequest.patch<{ certificateTemplate: TCertificateTemplate }>(
`/api/v1/cert-manager/certificate-templates/${dto.templateName}`,
`/api/v2/pki/certificate-templates/${dto.templateName}`,
dto
);
@@ -130,7 +130,7 @@ export const useDeleteCertTemplateV2 = () => {
return useMutation<TCertificateTemplate, object, TDeleteCertificateTemplateV2DTO>({
mutationFn: async (dto) => {
const { data } = await apiRequest.delete<{ certificateTemplate: TCertificateTemplate }>(
`/api/v1/cert-manager/certificate-templates/${dto.templateName}`,
`/api/v2/pki/certificate-templates/${dto.templateName}`,
{
data: {
projectId: dto.projectId

View File

@@ -57,7 +57,7 @@ export const useListCertificateTemplates = ({
const { data } = await apiRequest.get<{
certificateTemplates: TCertificateTemplateV2[];
totalCount?: number;
}>("/api/v1/pki/certificate-templates", {
}>("/api/v2/pki/certificate-templates", {
params: {
limit,
offset,

View File

@@ -152,10 +152,6 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
: "-"}
</p>
</div>
<div className="mb-4">
<p className="text-sm font-medium text-mineshaft-300">Enable Direct Issuance</p>
<p className="text-sm text-mineshaft-300">{ca.enableDirectIssuance ? "True" : "False"}</p>
</div>
{ca.status === CaStatus.ACTIVE && (
<ProjectPermissionCan
I={ProjectPermissionActions.Edit}

View File

@@ -14,8 +14,7 @@ import {
Modal,
ModalContent,
Select,
SelectItem,
Switch
SelectItem
} from "@app/components/v2";
import { useProject } from "@app/context";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
@@ -63,7 +62,6 @@ const baseSchema = z.object({
name: slugSchema({
field: "Name"
}),
enableDirectIssuance: z.boolean(),
status: z.nativeEnum(CaStatus)
});
@@ -171,7 +169,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
type: CaType.AZURE_AD_CS,
name: "",
status: CaStatus.ACTIVE,
enableDirectIssuance: false,
configuration: {
azureAdcsConnection: {
id: "",
@@ -184,7 +181,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
type: CaType.ACME,
name: "",
status: CaStatus.ACTIVE,
enableDirectIssuance: true,
configuration: {
dnsAppConnection: {
id: "",
@@ -274,7 +270,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
type: ca.type,
name: ca.name,
status: ca.status,
enableDirectIssuance: ca.enableDirectIssuance,
configuration: {
dnsAppConnection: {
id: ca.configuration.dnsAppConnectionId,
@@ -299,7 +294,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
type: ca.type,
name: ca.name,
status: ca.status,
enableDirectIssuance: false,
configuration: {
azureAdcsConnection: {
id: ca.configuration.azureAdcsConnectionId,
@@ -314,7 +308,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
const onFormSubmit = async ({
type,
name,
enableDirectIssuance,
status,
configuration: formConfiguration
}: FormData) => {
@@ -346,7 +339,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
name,
type,
status,
enableDirectIssuance: type === CaType.AZURE_AD_CS ? false : enableDirectIssuance,
configuration: configPayload
});
} else {
@@ -355,7 +347,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
name,
type,
status,
enableDirectIssuance: type === CaType.AZURE_AD_CS ? false : enableDirectIssuance,
configuration: configPayload
});
}
@@ -648,25 +639,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
name="configuration.azureAdcsConnection"
/>
)}
{caType === CaType.ACME && (
<Controller
control={control}
name="enableDirectIssuance"
render={({ field, fieldState: { error } }) => {
return (
<FormControl isError={Boolean(error)} errorText={error?.message} className="my-8">
<Switch
id="is-active"
onCheckedChange={(value) => field.onChange(value)}
isChecked={field.value}
>
<p className="w-full">Enable Direct Issuance</p>
</Switch>
</FormControl>
);
}}
/>
)}
<div className="flex items-center">
<Button
className="mr-4"