mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 18:28:12 +00:00
misc: addressed comments
This commit is contained in:
@@ -221,7 +221,7 @@ In the following steps, we explore how to issue a X.509 certificate under a CA.
|
|||||||
### Sample request
|
### Sample request
|
||||||
|
|
||||||
```bash 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' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
"profileId": "<profile-id>",
|
"profileId": "<profile-id>",
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Here, select the certificate profile from step 1 that will be used to issue the
|
|||||||
### Sample request
|
### Sample request
|
||||||
|
|
||||||
```bash 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 'Authorization: Bearer <access-token>' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
@@ -151,7 +151,7 @@ Here, select the certificate profile from step 1 that will be used to issue the
|
|||||||
### Sample request
|
### Sample request
|
||||||
|
|
||||||
```bash 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 'Authorization: Bearer <access-token>' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
|
|||||||
@@ -66,7 +66,10 @@ export type TUnifiedCertificateAuthority =
|
|||||||
| TAzureAdCsCertificateAuthority
|
| TAzureAdCsCertificateAuthority
|
||||||
| TInternalCertificateAuthority;
|
| TInternalCertificateAuthority;
|
||||||
|
|
||||||
export type TCreateCertificateAuthorityDTO = Omit<TUnifiedCertificateAuthority, "id">;
|
export type TCreateCertificateAuthorityDTO = Omit<
|
||||||
|
TUnifiedCertificateAuthority,
|
||||||
|
"id" | "enableDirectIssuance"
|
||||||
|
>;
|
||||||
export type TUpdateCertificateAuthorityDTO = Partial<TUnifiedCertificateAuthority> & {
|
export type TUpdateCertificateAuthorityDTO = Partial<TUnifiedCertificateAuthority> & {
|
||||||
id: string;
|
id: string;
|
||||||
type: CaType;
|
type: CaType;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export const useCreateCertTemplateV2 = () => {
|
|||||||
mutationFn: async (dto) => {
|
mutationFn: async (dto) => {
|
||||||
const { data } = await apiRequest.post<{
|
const { data } = await apiRequest.post<{
|
||||||
certificateTemplate: TCertificateTemplate;
|
certificateTemplate: TCertificateTemplate;
|
||||||
}>("/api/v1/cert-manager/certificate-templates", dto);
|
}>("/api/v2/pki/certificate-templates", dto);
|
||||||
return data.certificateTemplate;
|
return data.certificateTemplate;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { projectId }) => {
|
onSuccess: (_, { projectId }) => {
|
||||||
@@ -108,7 +108,7 @@ export const useUpdateCertTemplateV2 = () => {
|
|||||||
return useMutation<TCertificateTemplate, object, TUpdateCertificateTemplateV2DTO>({
|
return useMutation<TCertificateTemplate, object, TUpdateCertificateTemplateV2DTO>({
|
||||||
mutationFn: async (dto) => {
|
mutationFn: async (dto) => {
|
||||||
const { data } = await apiRequest.patch<{ certificateTemplate: TCertificateTemplate }>(
|
const { data } = await apiRequest.patch<{ certificateTemplate: TCertificateTemplate }>(
|
||||||
`/api/v1/cert-manager/certificate-templates/${dto.templateName}`,
|
`/api/v2/pki/certificate-templates/${dto.templateName}`,
|
||||||
dto
|
dto
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ export const useDeleteCertTemplateV2 = () => {
|
|||||||
return useMutation<TCertificateTemplate, object, TDeleteCertificateTemplateV2DTO>({
|
return useMutation<TCertificateTemplate, object, TDeleteCertificateTemplateV2DTO>({
|
||||||
mutationFn: async (dto) => {
|
mutationFn: async (dto) => {
|
||||||
const { data } = await apiRequest.delete<{ certificateTemplate: TCertificateTemplate }>(
|
const { data } = await apiRequest.delete<{ certificateTemplate: TCertificateTemplate }>(
|
||||||
`/api/v1/cert-manager/certificate-templates/${dto.templateName}`,
|
`/api/v2/pki/certificate-templates/${dto.templateName}`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
projectId: dto.projectId
|
projectId: dto.projectId
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const useListCertificateTemplates = ({
|
|||||||
const { data } = await apiRequest.get<{
|
const { data } = await apiRequest.get<{
|
||||||
certificateTemplates: TCertificateTemplateV2[];
|
certificateTemplates: TCertificateTemplateV2[];
|
||||||
totalCount?: number;
|
totalCount?: number;
|
||||||
}>("/api/v1/pki/certificate-templates", {
|
}>("/api/v2/pki/certificate-templates", {
|
||||||
params: {
|
params: {
|
||||||
limit,
|
limit,
|
||||||
offset,
|
offset,
|
||||||
|
|||||||
-4
@@ -152,10 +152,6 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
: "-"}
|
: "-"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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 && (
|
{ca.status === CaStatus.ACTIVE && (
|
||||||
<ProjectPermissionCan
|
<ProjectPermissionCan
|
||||||
I={ProjectPermissionActions.Edit}
|
I={ProjectPermissionActions.Edit}
|
||||||
|
|||||||
+1
-29
@@ -14,8 +14,7 @@ import {
|
|||||||
Modal,
|
Modal,
|
||||||
ModalContent,
|
ModalContent,
|
||||||
Select,
|
Select,
|
||||||
SelectItem,
|
SelectItem
|
||||||
Switch
|
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useProject } from "@app/context";
|
import { useProject } from "@app/context";
|
||||||
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
|
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
|
||||||
@@ -63,7 +62,6 @@ const baseSchema = z.object({
|
|||||||
name: slugSchema({
|
name: slugSchema({
|
||||||
field: "Name"
|
field: "Name"
|
||||||
}),
|
}),
|
||||||
enableDirectIssuance: z.boolean(),
|
|
||||||
status: z.nativeEnum(CaStatus)
|
status: z.nativeEnum(CaStatus)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -171,7 +169,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
type: CaType.AZURE_AD_CS,
|
type: CaType.AZURE_AD_CS,
|
||||||
name: "",
|
name: "",
|
||||||
status: CaStatus.ACTIVE,
|
status: CaStatus.ACTIVE,
|
||||||
enableDirectIssuance: false,
|
|
||||||
configuration: {
|
configuration: {
|
||||||
azureAdcsConnection: {
|
azureAdcsConnection: {
|
||||||
id: "",
|
id: "",
|
||||||
@@ -184,7 +181,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
type: CaType.ACME,
|
type: CaType.ACME,
|
||||||
name: "",
|
name: "",
|
||||||
status: CaStatus.ACTIVE,
|
status: CaStatus.ACTIVE,
|
||||||
enableDirectIssuance: true,
|
|
||||||
configuration: {
|
configuration: {
|
||||||
dnsAppConnection: {
|
dnsAppConnection: {
|
||||||
id: "",
|
id: "",
|
||||||
@@ -274,7 +270,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
type: ca.type,
|
type: ca.type,
|
||||||
name: ca.name,
|
name: ca.name,
|
||||||
status: ca.status,
|
status: ca.status,
|
||||||
enableDirectIssuance: ca.enableDirectIssuance,
|
|
||||||
configuration: {
|
configuration: {
|
||||||
dnsAppConnection: {
|
dnsAppConnection: {
|
||||||
id: ca.configuration.dnsAppConnectionId,
|
id: ca.configuration.dnsAppConnectionId,
|
||||||
@@ -299,7 +294,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
type: ca.type,
|
type: ca.type,
|
||||||
name: ca.name,
|
name: ca.name,
|
||||||
status: ca.status,
|
status: ca.status,
|
||||||
enableDirectIssuance: false,
|
|
||||||
configuration: {
|
configuration: {
|
||||||
azureAdcsConnection: {
|
azureAdcsConnection: {
|
||||||
id: ca.configuration.azureAdcsConnectionId,
|
id: ca.configuration.azureAdcsConnectionId,
|
||||||
@@ -314,7 +308,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
const onFormSubmit = async ({
|
const onFormSubmit = async ({
|
||||||
type,
|
type,
|
||||||
name,
|
name,
|
||||||
enableDirectIssuance,
|
|
||||||
status,
|
status,
|
||||||
configuration: formConfiguration
|
configuration: formConfiguration
|
||||||
}: FormData) => {
|
}: FormData) => {
|
||||||
@@ -346,7 +339,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
name,
|
name,
|
||||||
type,
|
type,
|
||||||
status,
|
status,
|
||||||
enableDirectIssuance: type === CaType.AZURE_AD_CS ? false : enableDirectIssuance,
|
|
||||||
configuration: configPayload
|
configuration: configPayload
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -355,7 +347,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
name,
|
name,
|
||||||
type,
|
type,
|
||||||
status,
|
status,
|
||||||
enableDirectIssuance: type === CaType.AZURE_AD_CS ? false : enableDirectIssuance,
|
|
||||||
configuration: configPayload
|
configuration: configPayload
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -648,25 +639,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
name="configuration.azureAdcsConnection"
|
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">
|
<div className="flex items-center">
|
||||||
<Button
|
<Button
|
||||||
className="mr-4"
|
className="mr-4"
|
||||||
|
|||||||
Reference in New Issue
Block a user