mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 15:27:46 +00:00
misc: migrated internal CA to use new CA endpoint
This commit is contained in:
@@ -85,6 +85,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
|||||||
actorAuthMethod: req.permission.authMethod,
|
actorAuthMethod: req.permission.authMethod,
|
||||||
isInternal: false,
|
isInternal: false,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
|
enableDirectIssuance: !req.body.requireTemplateForIssuance,
|
||||||
...req.body
|
...req.body
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -217,6 +218,7 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
|
|||||||
isInternal: false,
|
isInternal: false,
|
||||||
actorAuthMethod: req.permission.authMethod,
|
actorAuthMethod: req.permission.authMethod,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
|
enableDirectIssuance: !req.body.requireTemplateForIssuance,
|
||||||
...req.body
|
...req.body
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ export const certificateAuthorityServiceFactory = ({
|
|||||||
...(configuration as TCreateInternalCertificateAuthorityDTO["configuration"]),
|
...(configuration as TCreateInternalCertificateAuthorityDTO["configuration"]),
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
projectId: finalProjectId,
|
projectId: finalProjectId,
|
||||||
requireTemplateForIssuance: !enableDirectIssuance
|
enableDirectIssuance,
|
||||||
|
name
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!ca.internalCa) {
|
if (!ca.internalCa) {
|
||||||
@@ -312,8 +313,9 @@ export const certificateAuthorityServiceFactory = ({
|
|||||||
const updatedCa = await internalCertificateAuthorityService.updateCaById({
|
const updatedCa = await internalCertificateAuthorityService.updateCaById({
|
||||||
...configuration,
|
...configuration,
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
requireTemplateForIssuance: !enableDirectIssuance,
|
enableDirectIssuance,
|
||||||
caId: certificateAuthority.id,
|
caId: certificateAuthority.id,
|
||||||
|
status,
|
||||||
name
|
name
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-6
@@ -23,14 +23,12 @@ const InternalCertificateAuthorityConfigurationSchema = z
|
|||||||
locality: z.string().trim().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.locality),
|
locality: z.string().trim().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.locality),
|
||||||
notBefore: validateCaDateField.optional().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.notBefore),
|
notBefore: validateCaDateField.optional().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.notBefore),
|
||||||
notAfter: validateCaDateField.optional().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.notAfter),
|
notAfter: validateCaDateField.optional().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.notAfter),
|
||||||
maxPathLength: z.number().min(-1).describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.maxPathLength),
|
maxPathLength: z.number().min(-1).nullish().describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.maxPathLength),
|
||||||
keyAlgorithm: z.nativeEnum(CertKeyAlgorithm).describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.keyAlgorithm),
|
keyAlgorithm: z.nativeEnum(CertKeyAlgorithm).describe(CertificateAuthorities.CONFIGURATIONS.INTERNAL.keyAlgorithm),
|
||||||
|
dn: z.string().trim().nullish(),
|
||||||
// no need for descriptions of the following fields because they are not exposed to the API user
|
|
||||||
dn: z.string().trim(),
|
|
||||||
parentCaId: z.string().uuid().nullish(),
|
parentCaId: z.string().uuid().nullish(),
|
||||||
serialNumber: z.string().trim().optional(),
|
serialNumber: z.string().trim().nullish(),
|
||||||
activeCaCertId: z.string().uuid().optional()
|
activeCaCertId: z.string().uuid().nullish()
|
||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) => {
|
(data) => {
|
||||||
|
|||||||
+7
-10
@@ -143,7 +143,8 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
notAfter,
|
notAfter,
|
||||||
maxPathLength,
|
maxPathLength,
|
||||||
keyAlgorithm,
|
keyAlgorithm,
|
||||||
requireTemplateForIssuance,
|
enableDirectIssuance,
|
||||||
|
name,
|
||||||
...dto
|
...dto
|
||||||
}: TCreateCaDTO) => {
|
}: TCreateCaDTO) => {
|
||||||
let projectId: string;
|
let projectId: string;
|
||||||
@@ -202,8 +203,8 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
const ca = await certificateAuthorityDAL.create(
|
const ca = await certificateAuthorityDAL.create(
|
||||||
{
|
{
|
||||||
projectId,
|
projectId,
|
||||||
enableDirectIssuance: !requireTemplateForIssuance,
|
enableDirectIssuance,
|
||||||
name: slugify(`${friendlyName || dn}-${alphaNumericNanoId(8)}`),
|
name: name || slugify(`${(friendlyName || dn).slice(0, 16)}-${alphaNumericNanoId(8)}`),
|
||||||
status: type === InternalCaType.ROOT ? CaStatus.ACTIVE : CaStatus.PENDING_CERTIFICATE
|
status: type === InternalCaType.ROOT ? CaStatus.ACTIVE : CaStatus.PENDING_CERTIFICATE
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
@@ -360,7 +361,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
* Update CA with id [caId].
|
* Update CA with id [caId].
|
||||||
* Note: Used to enable/disable CA
|
* Note: Used to enable/disable CA
|
||||||
*/
|
*/
|
||||||
const updateCaById = async ({ caId, status, requireTemplateForIssuance, name, ...dto }: TUpdateCaDTO) => {
|
const updateCaById = async ({ caId, status, enableDirectIssuance, name, ...dto }: TUpdateCaDTO) => {
|
||||||
const ca = await certificateAuthorityDAL.findByIdWithAssociatedCa(caId);
|
const ca = await certificateAuthorityDAL.findByIdWithAssociatedCa(caId);
|
||||||
if (!ca.internalCa) throw new NotFoundError({ message: `CA with ID '${caId}' not found` });
|
if (!ca.internalCa) throw new NotFoundError({ message: `CA with ID '${caId}' not found` });
|
||||||
|
|
||||||
@@ -381,12 +382,8 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updatedCa = await certificateAuthorityDAL.transaction(async (tx) => {
|
const updatedCa = await certificateAuthorityDAL.transaction(async (tx) => {
|
||||||
if (requireTemplateForIssuance !== undefined || status !== undefined || name !== undefined) {
|
if (enableDirectIssuance !== undefined || status !== undefined || name !== undefined) {
|
||||||
await certificateAuthorityDAL.updateById(
|
await certificateAuthorityDAL.updateById(ca.id, { enableDirectIssuance, status, name }, tx);
|
||||||
ca.id,
|
|
||||||
{ enableDirectIssuance: !requireTemplateForIssuance, status, name },
|
|
||||||
tx
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return certificateAuthorityDAL.findByIdWithAssociatedCa(caId, tx);
|
return certificateAuthorityDAL.findByIdWithAssociatedCa(caId, tx);
|
||||||
|
|||||||
+8
-6
@@ -31,6 +31,7 @@ export type TCreateCaDTO =
|
|||||||
projectId: string;
|
projectId: string;
|
||||||
type: InternalCaType;
|
type: InternalCaType;
|
||||||
friendlyName?: string;
|
friendlyName?: string;
|
||||||
|
name?: string;
|
||||||
commonName: string;
|
commonName: string;
|
||||||
organization: string;
|
organization: string;
|
||||||
ou: string;
|
ou: string;
|
||||||
@@ -39,15 +40,16 @@ export type TCreateCaDTO =
|
|||||||
locality: string;
|
locality: string;
|
||||||
notBefore?: string;
|
notBefore?: string;
|
||||||
notAfter?: string;
|
notAfter?: string;
|
||||||
maxPathLength: number;
|
maxPathLength?: number | null;
|
||||||
keyAlgorithm: CertKeyAlgorithm;
|
keyAlgorithm: CertKeyAlgorithm;
|
||||||
requireTemplateForIssuance: boolean;
|
enableDirectIssuance: boolean;
|
||||||
}
|
}
|
||||||
| ({
|
| ({
|
||||||
isInternal: false;
|
isInternal: false;
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
type: InternalCaType;
|
type: InternalCaType;
|
||||||
friendlyName?: string;
|
friendlyName?: string;
|
||||||
|
name?: string;
|
||||||
commonName: string;
|
commonName: string;
|
||||||
organization: string;
|
organization: string;
|
||||||
ou: string;
|
ou: string;
|
||||||
@@ -56,9 +58,9 @@ export type TCreateCaDTO =
|
|||||||
locality: string;
|
locality: string;
|
||||||
notBefore?: string;
|
notBefore?: string;
|
||||||
notAfter?: string;
|
notAfter?: string;
|
||||||
maxPathLength: number;
|
maxPathLength?: number | null;
|
||||||
keyAlgorithm: CertKeyAlgorithm;
|
keyAlgorithm: CertKeyAlgorithm;
|
||||||
requireTemplateForIssuance: boolean;
|
enableDirectIssuance: boolean;
|
||||||
} & Omit<TProjectPermission, "projectId">);
|
} & Omit<TProjectPermission, "projectId">);
|
||||||
|
|
||||||
export type TGetCaDTO = {
|
export type TGetCaDTO = {
|
||||||
@@ -71,14 +73,14 @@ export type TUpdateCaDTO =
|
|||||||
caId: string;
|
caId: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
status?: CaStatus;
|
status?: CaStatus;
|
||||||
requireTemplateForIssuance?: boolean;
|
enableDirectIssuance?: boolean;
|
||||||
}
|
}
|
||||||
| ({
|
| ({
|
||||||
isInternal: false;
|
isInternal: false;
|
||||||
caId: string;
|
caId: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
status?: CaStatus;
|
status?: CaStatus;
|
||||||
requireTemplateForIssuance?: boolean;
|
enableDirectIssuance?: boolean;
|
||||||
} & Omit<TProjectPermission, "projectId">);
|
} & Omit<TProjectPermission, "projectId">);
|
||||||
|
|
||||||
export type TDeleteCaDTO = {
|
export type TDeleteCaDTO = {
|
||||||
|
|||||||
@@ -920,7 +920,7 @@ export const projectServiceFactory = ({
|
|||||||
{
|
{
|
||||||
[`${TableName.CertificateAuthority}.projectId` as "projectId"]: projectId,
|
[`${TableName.CertificateAuthority}.projectId` as "projectId"]: projectId,
|
||||||
$notNull: [`${TableName.InternalCertificateAuthority}.id` as "id"],
|
$notNull: [`${TableName.InternalCertificateAuthority}.id` as "id"],
|
||||||
...(status && { [`${TableName.InternalCertificateAuthority}.status` as "status"]: status }),
|
...(status && { [`${TableName.CertificateAuthority}.status` as "status"]: status }),
|
||||||
...(friendlyName && {
|
...(friendlyName && {
|
||||||
[`${TableName.InternalCertificateAuthority}.friendlyName` as "friendlyName"]: friendlyName
|
[`${TableName.InternalCertificateAuthority}.friendlyName` as "friendlyName"]: friendlyName
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -284,8 +284,8 @@ export const ROUTE_PATHS = Object.freeze({
|
|||||||
},
|
},
|
||||||
CertManager: {
|
CertManager: {
|
||||||
CertAuthDetailsByIDPage: setRoute(
|
CertAuthDetailsByIDPage: setRoute(
|
||||||
"/cert-manager/$projectId/ca/$caId",
|
"/cert-manager/$projectId/ca/$caName",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId"
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName"
|
||||||
),
|
),
|
||||||
SubscribersPage: setRoute(
|
SubscribersPage: setRoute(
|
||||||
"/cert-manager/$projectId/subscribers",
|
"/cert-manager/$projectId/subscribers",
|
||||||
|
|||||||
@@ -2,14 +2,11 @@ export { AcmeDnsProvider, CaRenewalType, CaStatus, CaType, InternalCaType } from
|
|||||||
export {
|
export {
|
||||||
useCreateCa,
|
useCreateCa,
|
||||||
useCreateCertificate,
|
useCreateCertificate,
|
||||||
useCreateUnifiedCa,
|
|
||||||
useDeleteCa,
|
useDeleteCa,
|
||||||
useDeleteUnifiedCa,
|
|
||||||
useImportCaCertificate,
|
useImportCaCertificate,
|
||||||
useRenewCa,
|
useRenewCa,
|
||||||
useSignIntermediate,
|
useSignIntermediate,
|
||||||
useUpdateCa,
|
useUpdateCa
|
||||||
useUpdateUnifiedCa
|
|
||||||
} from "./mutations";
|
} from "./mutations";
|
||||||
export {
|
export {
|
||||||
useGetCa,
|
useGetCa,
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace";
|
import { workspaceKeys } from "../workspace";
|
||||||
|
import { CaType } from "./enums";
|
||||||
import { caKeys } from "./queries";
|
import { caKeys } from "./queries";
|
||||||
import {
|
import {
|
||||||
TCertificateAuthority,
|
TCreateCertificateAuthorityDTO,
|
||||||
TCreateCaDTO,
|
|
||||||
TCreateCertificateDTO,
|
TCreateCertificateDTO,
|
||||||
TCreateCertificateResponse,
|
TCreateCertificateResponse,
|
||||||
TCreateUnifiedCertificateAuthorityDTO,
|
TDeleteCertificateAuthorityDTO,
|
||||||
TDeleteCaDTO,
|
|
||||||
TDeleteUnifiedCertificateAuthorityDTO,
|
|
||||||
TImportCaCertificateDTO,
|
TImportCaCertificateDTO,
|
||||||
TImportCaCertificateResponse,
|
TImportCaCertificateResponse,
|
||||||
TRenewCaDTO,
|
TRenewCaDTO,
|
||||||
@@ -19,13 +17,12 @@ import {
|
|||||||
TSignIntermediateDTO,
|
TSignIntermediateDTO,
|
||||||
TSignIntermediateResponse,
|
TSignIntermediateResponse,
|
||||||
TUnifiedCertificateAuthority,
|
TUnifiedCertificateAuthority,
|
||||||
TUpdateCaDTO,
|
TUpdateCertificateAuthorityDTO
|
||||||
TUpdateUnifiedCertificateAuthorityDTO
|
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
export const useUpdateUnifiedCa = () => {
|
export const useUpdateCa = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TUnifiedCertificateAuthority, object, TUpdateUnifiedCertificateAuthorityDTO>({
|
return useMutation<TUnifiedCertificateAuthority, object, TUpdateCertificateAuthorityDTO>({
|
||||||
mutationFn: async ({ caName, ...body }) => {
|
mutationFn: async ({ caName, ...body }) => {
|
||||||
const { data } = await apiRequest.patch<TUnifiedCertificateAuthority>(
|
const { data } = await apiRequest.patch<TUnifiedCertificateAuthority>(
|
||||||
`/api/v1/pki/ca/${body.type}/${caName}`,
|
`/api/v1/pki/ca/${body.type}/${caName}`,
|
||||||
@@ -42,9 +39,9 @@ export const useUpdateUnifiedCa = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useCreateUnifiedCa = () => {
|
export const useCreateCa = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TUnifiedCertificateAuthority, object, TCreateUnifiedCertificateAuthorityDTO>({
|
return useMutation<TUnifiedCertificateAuthority, object, TCreateCertificateAuthorityDTO>({
|
||||||
mutationFn: async (body) => {
|
mutationFn: async (body) => {
|
||||||
const { data } = await apiRequest.post<TUnifiedCertificateAuthority>(
|
const { data } = await apiRequest.post<TUnifiedCertificateAuthority>(
|
||||||
`/api/v1/pki/ca/${body.type}`,
|
`/api/v1/pki/ca/${body.type}`,
|
||||||
@@ -60,13 +57,11 @@ export const useCreateUnifiedCa = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useDeleteUnifiedCa = () => {
|
export const useDeleteCa = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TUnifiedCertificateAuthority, object, TDeleteUnifiedCertificateAuthorityDTO>({
|
return useMutation<TUnifiedCertificateAuthority, object, TDeleteCertificateAuthorityDTO>({
|
||||||
mutationFn: async ({ caName, type, projectId }) => {
|
mutationFn: async ({ caName, type, projectId }) => {
|
||||||
const {
|
const { data } = await apiRequest.delete<TUnifiedCertificateAuthority>(
|
||||||
data: { certificateAuthority }
|
|
||||||
} = await apiRequest.delete<{ certificateAuthority: TUnifiedCertificateAuthority }>(
|
|
||||||
`/api/v1/pki/ca/${type}/${caName}`,
|
`/api/v1/pki/ca/${type}/${caName}`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
@@ -74,7 +69,7 @@ export const useDeleteUnifiedCa = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return certificateAuthority;
|
return data;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { type, projectId }) => {
|
onSuccess: (_, { type, projectId }) => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
@@ -84,52 +79,6 @@ export const useDeleteUnifiedCa = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useCreateCa = () => {
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
return useMutation<TCertificateAuthority, object, TCreateCaDTO>({
|
|
||||||
mutationFn: async (body) => {
|
|
||||||
const {
|
|
||||||
data: { ca }
|
|
||||||
} = await apiRequest.post<{ ca: TCertificateAuthority }>("/api/v1/pki/ca/", body);
|
|
||||||
return ca;
|
|
||||||
},
|
|
||||||
onSuccess: (_, { projectSlug }) => {
|
|
||||||
queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useUpdateCa = () => {
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
return useMutation<TCertificateAuthority, object, TUpdateCaDTO>({
|
|
||||||
mutationFn: async ({ caId, projectSlug, ...body }) => {
|
|
||||||
const {
|
|
||||||
data: { ca }
|
|
||||||
} = await apiRequest.patch<{ ca: TCertificateAuthority }>(`/api/v1/pki/ca/${caId}`, body);
|
|
||||||
return ca;
|
|
||||||
},
|
|
||||||
onSuccess: ({ id }, { projectSlug }) => {
|
|
||||||
queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
|
|
||||||
queryClient.invalidateQueries({ queryKey: caKeys.getCaById(id) });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useDeleteCa = () => {
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
return useMutation<TCertificateAuthority, object, TDeleteCaDTO>({
|
|
||||||
mutationFn: async ({ caId }) => {
|
|
||||||
const {
|
|
||||||
data: { ca }
|
|
||||||
} = await apiRequest.delete<{ ca: TCertificateAuthority }>(`/api/v1/pki/ca/${caId}`);
|
|
||||||
return ca;
|
|
||||||
},
|
|
||||||
onSuccess: (_, { projectSlug }) => {
|
|
||||||
queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useSignIntermediate = () => {
|
export const useSignIntermediate = () => {
|
||||||
// TODO: consider renaming
|
// TODO: consider renaming
|
||||||
return useMutation<TSignIntermediateResponse, object, TSignIntermediateDTO>({
|
return useMutation<TSignIntermediateResponse, object, TSignIntermediateDTO>({
|
||||||
@@ -143,7 +92,7 @@ export const useSignIntermediate = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useImportCaCertificate = () => {
|
export const useImportCaCertificate = (projectId: string) => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TImportCaCertificateResponse, object, TImportCaCertificateDTO>({
|
return useMutation<TImportCaCertificateResponse, object, TImportCaCertificateDTO>({
|
||||||
mutationFn: async ({ caId, ...body }) => {
|
mutationFn: async ({ caId, ...body }) => {
|
||||||
@@ -157,6 +106,9 @@ export const useImportCaCertificate = () => {
|
|||||||
queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
|
queryClient.invalidateQueries({ queryKey: workspaceKeys.getWorkspaceCas({ projectSlug }) });
|
||||||
queryClient.invalidateQueries({ queryKey: caKeys.getCaCerts(caId) });
|
queryClient.invalidateQueries({ queryKey: caKeys.getCaCerts(caId) });
|
||||||
queryClient.invalidateQueries({ queryKey: caKeys.getCaCert(caId) });
|
queryClient.invalidateQueries({ queryKey: caKeys.getCaCert(caId) });
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: caKeys.listCasByTypeAndProjectId(CaType.INTERNAL, projectId)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ export type TInternalCertificateAuthority = {
|
|||||||
keyAlgorithm: CertKeyAlgorithm;
|
keyAlgorithm: CertKeyAlgorithm;
|
||||||
notAfter?: string;
|
notAfter?: string;
|
||||||
notBefore?: string;
|
notBefore?: string;
|
||||||
dn: string;
|
dn?: string;
|
||||||
parentCaId?: string;
|
parentCaId?: string;
|
||||||
serialNumber: string;
|
serialNumber?: string;
|
||||||
activeCaCertId: string;
|
activeCaCertId?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,14 +50,14 @@ export type TUnifiedCertificateAuthority =
|
|||||||
| TAcmeCertificateAuthority
|
| TAcmeCertificateAuthority
|
||||||
| TInternalCertificateAuthority;
|
| TInternalCertificateAuthority;
|
||||||
|
|
||||||
export type TCreateUnifiedCertificateAuthorityDTO = Omit<TUnifiedCertificateAuthority, "id">;
|
export type TCreateCertificateAuthorityDTO = Omit<TUnifiedCertificateAuthority, "id">;
|
||||||
export type TUpdateUnifiedCertificateAuthorityDTO = Partial<TUnifiedCertificateAuthority> & {
|
export type TUpdateCertificateAuthorityDTO = Partial<TUnifiedCertificateAuthority> & {
|
||||||
caName: string;
|
caName: string;
|
||||||
projectId: string;
|
projectId: string;
|
||||||
type: CaType;
|
type: CaType;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TDeleteUnifiedCertificateAuthorityDTO = {
|
export type TDeleteCertificateAuthorityDTO = {
|
||||||
caName: string;
|
caName: string;
|
||||||
type: CaType;
|
type: CaType;
|
||||||
projectId: string;
|
projectId: string;
|
||||||
@@ -87,22 +87,6 @@ export type TCertificateAuthority = {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TCreateCaDTO = {
|
|
||||||
projectSlug: string;
|
|
||||||
type: string;
|
|
||||||
friendlyName?: string;
|
|
||||||
organization: string;
|
|
||||||
ou: string;
|
|
||||||
country: string;
|
|
||||||
province: string;
|
|
||||||
locality: string;
|
|
||||||
commonName: string;
|
|
||||||
notAfter?: string;
|
|
||||||
maxPathLength: number;
|
|
||||||
keyAlgorithm: CertKeyAlgorithm;
|
|
||||||
requireTemplateForIssuance: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TUpdateCaDTO = {
|
export type TUpdateCaDTO = {
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
caId: string;
|
caId: string;
|
||||||
|
|||||||
+23
-19
@@ -16,7 +16,8 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { ROUTE_PATHS } from "@app/const/routes";
|
import { ROUTE_PATHS } from "@app/const/routes";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { useDeleteCa, useGetCaById } from "@app/hooks/api";
|
import { CaType, useDeleteCa, useGetCa } from "@app/hooks/api";
|
||||||
|
import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";
|
||||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
@@ -31,14 +32,18 @@ import {
|
|||||||
} from "./components";
|
} from "./components";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
|
const { currentWorkspace } = useWorkspace();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const params = useParams({
|
const params = useParams({
|
||||||
from: ROUTE_PATHS.CertManager.CertAuthDetailsByIDPage.id
|
from: ROUTE_PATHS.CertManager.CertAuthDetailsByIDPage.id
|
||||||
});
|
});
|
||||||
const caId = params.caId as string;
|
const { caName } = params as { caName: string };
|
||||||
const { data } = useGetCaById(caId);
|
const { data } = useGetCa({
|
||||||
|
caName,
|
||||||
|
projectId: currentWorkspace?.id || "",
|
||||||
|
type: CaType.INTERNAL
|
||||||
|
}) as { data: TInternalCertificateAuthority };
|
||||||
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
|
||||||
const projectId = currentWorkspace?.id || "";
|
const projectId = currentWorkspace?.id || "";
|
||||||
|
|
||||||
const { mutateAsync: deleteCa } = useDeleteCa();
|
const { mutateAsync: deleteCa } = useDeleteCa();
|
||||||
@@ -50,11 +55,15 @@ const Page = () => {
|
|||||||
"renewCa"
|
"renewCa"
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
const onRemoveCaSubmit = async (caIdToDelete: string) => {
|
const onRemoveCaSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
if (!currentWorkspace?.slug) return;
|
if (!currentWorkspace?.slug) return;
|
||||||
|
|
||||||
await deleteCa({ caId: caIdToDelete, projectSlug: currentWorkspace.slug });
|
await deleteCa({
|
||||||
|
caName,
|
||||||
|
projectId: currentWorkspace.id,
|
||||||
|
type: CaType.INTERNAL
|
||||||
|
});
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "Successfully deleted CA",
|
text: "Successfully deleted CA",
|
||||||
@@ -63,7 +72,7 @@ const Page = () => {
|
|||||||
|
|
||||||
handlePopUpClose("deleteCa");
|
handlePopUpClose("deleteCa");
|
||||||
navigate({
|
navigate({
|
||||||
to: `/${ProjectType.CertificateManager}/$projectId/certificates` as const,
|
to: `/${ProjectType.CertificateManager}/$projectId/certificate-authorities` as const,
|
||||||
params: {
|
params: {
|
||||||
projectId
|
projectId
|
||||||
}
|
}
|
||||||
@@ -80,7 +89,7 @@ const Page = () => {
|
|||||||
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
|
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
|
||||||
{data && (
|
{data && (
|
||||||
<div className="mx-auto mb-6 w-full max-w-7xl">
|
<div className="mx-auto mb-6 w-full max-w-7xl">
|
||||||
<PageHeader title={data.friendlyName}>
|
<PageHeader title={data.name}>
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild className="rounded-lg">
|
<DropdownMenuTrigger asChild className="rounded-lg">
|
||||||
<div className="hover:text-primary-400 data-[state=open]:text-primary-400">
|
<div className="hover:text-primary-400 data-[state=open]:text-primary-400">
|
||||||
@@ -101,12 +110,7 @@ const Page = () => {
|
|||||||
? "hover:!bg-red-500 hover:!text-white"
|
? "hover:!bg-red-500 hover:!text-white"
|
||||||
: "pointer-events-none cursor-not-allowed opacity-50"
|
: "pointer-events-none cursor-not-allowed opacity-50"
|
||||||
)}
|
)}
|
||||||
onClick={() =>
|
onClick={() => handlePopUpOpen("deleteCa")}
|
||||||
handlePopUpOpen("deleteCa", {
|
|
||||||
caId: data.id,
|
|
||||||
dn: data.dn
|
|
||||||
})
|
|
||||||
}
|
|
||||||
disabled={!isAllowed}
|
disabled={!isAllowed}
|
||||||
>
|
>
|
||||||
Delete CA
|
Delete CA
|
||||||
@@ -118,12 +122,12 @@ const Page = () => {
|
|||||||
</PageHeader>
|
</PageHeader>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="mr-4 w-96">
|
<div className="mr-4 w-96">
|
||||||
<CaDetailsSection caId={caId} handlePopUpOpen={handlePopUpOpen} />
|
<CaDetailsSection caName={data.name} handlePopUpOpen={handlePopUpOpen} />
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<CaCertificatesSection caId={caId} />
|
<CaCertificatesSection caId={data.id} />
|
||||||
<CertificateTemplatesSection caId={caId} />
|
<CertificateTemplatesSection caId={data.id} />
|
||||||
<CaCrlsSection caId={caId} />
|
<CaCrlsSection caId={data.id} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -139,7 +143,7 @@ const Page = () => {
|
|||||||
subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."
|
subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."
|
||||||
onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}
|
||||||
deleteKey="confirm"
|
deleteKey="confirm"
|
||||||
onDeleteApproved={() => onRemoveCaSubmit((popUp?.deleteCa?.data as { caId: string })?.caId)}
|
onDeleteApproved={onRemoveCaSubmit}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
+65
-47
@@ -4,22 +4,24 @@ import { format } from "date-fns";
|
|||||||
|
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, IconButton, Tooltip } from "@app/components/v2";
|
import { Button, IconButton, Tooltip } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { useTimedReset } from "@app/hooks";
|
import { useTimedReset } from "@app/hooks";
|
||||||
import { CaStatus, InternalCaType, useGetCaById } from "@app/hooks/api";
|
import { CaStatus, CaType, InternalCaType, useGetCa } from "@app/hooks/api";
|
||||||
import { caStatusToNameMap, caTypeToNameMap } from "@app/hooks/api/ca/constants";
|
import { caStatusToNameMap, caTypeToNameMap } from "@app/hooks/api/ca/constants";
|
||||||
|
import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";
|
||||||
import { certKeyAlgorithmToNameMap } from "@app/hooks/api/certificates/constants";
|
import { certKeyAlgorithmToNameMap } from "@app/hooks/api/certificates/constants";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
caId: string;
|
caName: string;
|
||||||
handlePopUpOpen: (
|
handlePopUpOpen: (
|
||||||
popUpName: keyof UsePopUpState<["ca", "renewCa", "installCaCert"]>,
|
popUpName: keyof UsePopUpState<["ca", "renewCa", "installCaCert"]>,
|
||||||
data?: object
|
data?: object
|
||||||
) => void;
|
) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
export const CaDetailsSection = ({ caName, handlePopUpOpen }: Props) => {
|
||||||
|
const { currentWorkspace } = useWorkspace();
|
||||||
const [copyTextId, isCopyingId, setCopyTextId] = useTimedReset<string>({
|
const [copyTextId, isCopyingId, setCopyTextId] = useTimedReset<string>({
|
||||||
initialState: "Copy ID to clipboard"
|
initialState: "Copy ID to clipboard"
|
||||||
});
|
});
|
||||||
@@ -27,7 +29,13 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
initialState: "Copy ID to clipboard"
|
initialState: "Copy ID to clipboard"
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: ca } = useGetCaById(caId);
|
const { data } = useGetCa({
|
||||||
|
caName,
|
||||||
|
projectId: currentWorkspace.id,
|
||||||
|
type: CaType.INTERNAL
|
||||||
|
});
|
||||||
|
|
||||||
|
const ca = data as TInternalCertificateAuthority;
|
||||||
|
|
||||||
return ca ? (
|
return ca ? (
|
||||||
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||||
@@ -45,7 +53,7 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handlePopUpOpen("ca", {
|
handlePopUpOpen("ca", {
|
||||||
caId: ca.id
|
name: ca.name
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -59,7 +67,7 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
<div className="pt-4">
|
<div className="pt-4">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">CA Type</p>
|
<p className="text-sm font-semibold text-mineshaft-300">CA Type</p>
|
||||||
<p className="text-sm text-mineshaft-300">{caTypeToNameMap[ca.type]}</p>
|
<p className="text-sm text-mineshaft-300">{caTypeToNameMap[ca.configuration.type]}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">CA ID</p>
|
<p className="text-sm font-semibold text-mineshaft-300">CA ID</p>
|
||||||
@@ -82,36 +90,39 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{ca.type === InternalCaType.INTERMEDIATE && ca.status !== CaStatus.PENDING_CERTIFICATE && (
|
{ca.configuration.type === InternalCaType.INTERMEDIATE &&
|
||||||
<div className="mb-4">
|
ca.status !== CaStatus.PENDING_CERTIFICATE && (
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Parent CA ID</p>
|
<div className="mb-4">
|
||||||
<div className="group flex align-top">
|
<p className="text-sm font-semibold text-mineshaft-300">Parent CA ID</p>
|
||||||
<p className="text-sm text-mineshaft-300">
|
<div className="group flex align-top">
|
||||||
{ca.parentCaId ? ca.parentCaId : "N/A - External Parent CA"}
|
<p className="text-sm text-mineshaft-300">
|
||||||
</p>
|
{ca.configuration.parentCaId
|
||||||
{ca.parentCaId && (
|
? ca.configuration.parentCaId
|
||||||
<div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">
|
: "N/A - External Parent CA"}
|
||||||
<Tooltip content={copyTextParentId}>
|
</p>
|
||||||
<IconButton
|
{ca.configuration.parentCaId && (
|
||||||
ariaLabel="copy icon"
|
<div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">
|
||||||
variant="plain"
|
<Tooltip content={copyTextParentId}>
|
||||||
className="group relative ml-2"
|
<IconButton
|
||||||
onClick={() => {
|
ariaLabel="copy icon"
|
||||||
navigator.clipboard.writeText(ca.parentCaId as string);
|
variant="plain"
|
||||||
setCopyTextParentId("Copied");
|
className="group relative ml-2"
|
||||||
}}
|
onClick={() => {
|
||||||
>
|
navigator.clipboard.writeText(ca.configuration.parentCaId as string);
|
||||||
<FontAwesomeIcon icon={isCopyingParentId ? faCheck : faCopy} />
|
setCopyTextParentId("Copied");
|
||||||
</IconButton>
|
}}
|
||||||
</Tooltip>
|
>
|
||||||
</div>
|
<FontAwesomeIcon icon={isCopyingParentId ? faCheck : faCopy} />
|
||||||
)}
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Friendly Name</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Name</p>
|
||||||
<p className="text-sm text-mineshaft-300">{ca.friendlyName}</p>
|
<p className="text-sm text-mineshaft-300">{ca.name}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Status</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Status</p>
|
||||||
@@ -119,29 +130,33 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Key Algorithm</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Key Algorithm</p>
|
||||||
<p className="text-sm text-mineshaft-300">{certKeyAlgorithmToNameMap[ca.keyAlgorithm]}</p>
|
<p className="text-sm text-mineshaft-300">
|
||||||
|
{certKeyAlgorithmToNameMap[ca.configuration.keyAlgorithm]}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Max Path Length</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Max Path Length</p>
|
||||||
<p className="text-sm text-mineshaft-300">{ca.maxPathLength ?? "-"}</p>
|
<p className="text-sm text-mineshaft-300">{ca.configuration.maxPathLength ?? "-"}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Not Before</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Not Before</p>
|
||||||
<p className="text-sm text-mineshaft-300">
|
<p className="text-sm text-mineshaft-300">
|
||||||
{ca.notBefore ? format(new Date(ca.notBefore), "yyyy-MM-dd") : "-"}
|
{ca.configuration.notBefore
|
||||||
|
? format(new Date(ca.configuration.notBefore), "yyyy-MM-dd")
|
||||||
|
: "-"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Not After</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Not After</p>
|
||||||
<p className="text-sm text-mineshaft-300">
|
<p className="text-sm text-mineshaft-300">
|
||||||
{ca.notAfter ? format(new Date(ca.notAfter), "yyyy-MM-dd") : "-"}
|
{ca.configuration.notAfter
|
||||||
|
? format(new Date(ca.configuration.notAfter), "yyyy-MM-dd")
|
||||||
|
: "-"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<p className="text-sm font-semibold text-mineshaft-300">Template Issuance Required</p>
|
<p className="text-sm font-semibold text-mineshaft-300">Enable Direct Issuance</p>
|
||||||
<p className="text-sm text-mineshaft-300">
|
<p className="text-sm text-mineshaft-300">{ca.enableDirectIssuance ? "True" : "False"}</p>
|
||||||
{ca.requireTemplateForIssuance ? "True" : "False"}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
{ca.status === CaStatus.ACTIVE && (
|
{ca.status === CaStatus.ACTIVE && (
|
||||||
<ProjectPermissionCan
|
<ProjectPermissionCan
|
||||||
@@ -156,17 +171,20 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
colorSchema="primary"
|
colorSchema="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (ca.type === InternalCaType.INTERMEDIATE && !ca.parentCaId) {
|
if (
|
||||||
|
ca.configuration.type === InternalCaType.INTERMEDIATE &&
|
||||||
|
!ca.configuration.parentCaId
|
||||||
|
) {
|
||||||
// intermediate CA with external parent CA
|
// intermediate CA with external parent CA
|
||||||
handlePopUpOpen("installCaCert", {
|
handlePopUpOpen("installCaCert", {
|
||||||
caId,
|
caId: ca.id,
|
||||||
isParentCaExternal: true
|
isParentCaExternal: true
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePopUpOpen("renewCa", {
|
handlePopUpOpen("renewCa", {
|
||||||
caId
|
caId: ca.id
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -190,7 +208,7 @@ export const CaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handlePopUpOpen("installCaCert", {
|
handlePopUpOpen("installCaCert", {
|
||||||
caId
|
caId: ca.id
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { createFileRoute, linkOptions } from "@tanstack/react-router";
|
|||||||
import { CertAuthDetailsByIDPage } from "./CertAuthDetailsByIDPage";
|
import { CertAuthDetailsByIDPage } from "./CertAuthDetailsByIDPage";
|
||||||
|
|
||||||
export const Route = createFileRoute(
|
export const Route = createFileRoute(
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId"
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName"
|
||||||
)({
|
)({
|
||||||
component: CertAuthDetailsByIDPage,
|
component: CertAuthDetailsByIDPage,
|
||||||
beforeLoad: ({ context, params }) => {
|
beforeLoad: ({ context, params }) => {
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ export const ExternalCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { data: csr } = useGetCaCsr(caId);
|
const { data: csr } = useGetCaCsr(caId);
|
||||||
const { mutateAsync: importCaCertificate } = useImportCaCertificate();
|
const { mutateAsync: importCaCertificate } = useImportCaCertificate(currentWorkspace.id);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reset();
|
reset();
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ export const InternalCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {
|
|||||||
const { data: csr } = useGetCaCsr(caId);
|
const { data: csr } = useGetCaCsr(caId);
|
||||||
|
|
||||||
const { mutateAsync: signIntermediate } = useSignIntermediate();
|
const { mutateAsync: signIntermediate } = useSignIntermediate();
|
||||||
const { mutateAsync: importCaCertificate } = useImportCaCertificate();
|
const { mutateAsync: importCaCertificate } = useImportCaCertificate(currentWorkspace.id);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
|
|||||||
+132
-100
@@ -17,10 +17,18 @@ import {
|
|||||||
// DatePicker
|
// DatePicker
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { InternalCaType, useCreateCa, useGetCaById, useUpdateCa } from "@app/hooks/api/ca";
|
import {
|
||||||
|
CaStatus,
|
||||||
|
CaType,
|
||||||
|
InternalCaType,
|
||||||
|
useCreateCa,
|
||||||
|
useGetCa,
|
||||||
|
useUpdateCa
|
||||||
|
} from "@app/hooks/api/ca";
|
||||||
import { certKeyAlgorithms } from "@app/hooks/api/certificates/constants";
|
import { certKeyAlgorithms } from "@app/hooks/api/certificates/constants";
|
||||||
import { CertKeyAlgorithm } from "@app/hooks/api/certificates/enums";
|
import { CertKeyAlgorithm } from "@app/hooks/api/certificates/enums";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
|
|
||||||
const isValidDate = (dateString: string) => {
|
const isValidDate = (dateString: string) => {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
@@ -35,23 +43,31 @@ const getDateTenYearsFromToday = () => {
|
|||||||
|
|
||||||
const schema = z
|
const schema = z
|
||||||
.object({
|
.object({
|
||||||
type: z.enum([InternalCaType.ROOT, InternalCaType.INTERMEDIATE]),
|
type: z.nativeEnum(CaType),
|
||||||
friendlyName: z.string(),
|
name: slugSchema({
|
||||||
organization: z.string(),
|
field: "Name"
|
||||||
ou: z.string(),
|
}),
|
||||||
country: z.string(),
|
enableDirectIssuance: z.boolean(),
|
||||||
province: z.string(),
|
status: z.nativeEnum(CaStatus),
|
||||||
locality: z.string(),
|
configuration: z
|
||||||
commonName: z.string(),
|
.object({
|
||||||
notAfter: z.string().trim().refine(isValidDate, { message: "Invalid date format" }),
|
type: z.enum([InternalCaType.ROOT, InternalCaType.INTERMEDIATE]),
|
||||||
maxPathLength: z.string(),
|
organization: z.string(),
|
||||||
keyAlgorithm: z.enum([
|
ou: z.string(),
|
||||||
CertKeyAlgorithm.RSA_2048,
|
country: z.string(),
|
||||||
CertKeyAlgorithm.RSA_4096,
|
province: z.string(),
|
||||||
CertKeyAlgorithm.ECDSA_P256,
|
locality: z.string(),
|
||||||
CertKeyAlgorithm.ECDSA_P384
|
commonName: z.string(),
|
||||||
]),
|
notAfter: z.string().trim().refine(isValidDate, { message: "Invalid date format" }),
|
||||||
requireTemplateForIssuance: z.boolean()
|
maxPathLength: z.string(),
|
||||||
|
keyAlgorithm: z.enum([
|
||||||
|
CertKeyAlgorithm.RSA_2048,
|
||||||
|
CertKeyAlgorithm.RSA_4096,
|
||||||
|
CertKeyAlgorithm.ECDSA_P256,
|
||||||
|
CertKeyAlgorithm.ECDSA_P384
|
||||||
|
])
|
||||||
|
})
|
||||||
|
.required()
|
||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|
||||||
@@ -69,9 +85,11 @@ const caTypes = [
|
|||||||
|
|
||||||
export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
// const [isStartDatePickerOpen, setIsStartDatePickerOpen] = useState(false);
|
const { data: ca } = useGetCa({
|
||||||
|
caName: (popUp?.ca?.data as { name: string })?.name || "",
|
||||||
const { data: ca } = useGetCaById((popUp?.ca?.data as { caId: string })?.caId || "");
|
projectId: currentWorkspace?.id || "",
|
||||||
|
type: CaType.INTERNAL
|
||||||
|
});
|
||||||
|
|
||||||
const { mutateAsync: createMutateAsync } = useCreateCa();
|
const { mutateAsync: createMutateAsync } = useCreateCa();
|
||||||
const { mutateAsync: updateMutateAsync } = useUpdateCa();
|
const { mutateAsync: updateMutateAsync } = useUpdateCa();
|
||||||
@@ -85,42 +103,12 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
} = useForm<FormData>({
|
} = useForm<FormData>({
|
||||||
resolver: zodResolver(schema),
|
resolver: zodResolver(schema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
type: InternalCaType.ROOT,
|
type: CaType.INTERNAL,
|
||||||
friendlyName: "",
|
name: "",
|
||||||
organization: "",
|
status: CaStatus.ACTIVE,
|
||||||
ou: "",
|
enableDirectIssuance: true,
|
||||||
country: "",
|
configuration: {
|
||||||
province: "",
|
|
||||||
locality: "",
|
|
||||||
commonName: "",
|
|
||||||
notAfter: getDateTenYearsFromToday(),
|
|
||||||
maxPathLength: "-1",
|
|
||||||
keyAlgorithm: CertKeyAlgorithm.RSA_2048
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const caType = watch("type");
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (ca) {
|
|
||||||
reset({
|
|
||||||
type: ca.type,
|
|
||||||
friendlyName: ca.friendlyName,
|
|
||||||
organization: ca.organization,
|
|
||||||
ou: ca.ou,
|
|
||||||
country: ca.country,
|
|
||||||
province: ca.province,
|
|
||||||
locality: ca.locality,
|
|
||||||
commonName: ca.commonName,
|
|
||||||
notAfter: ca.notAfter ? format(new Date(ca.notAfter), "yyyy-MM-dd") : "",
|
|
||||||
maxPathLength: ca.maxPathLength ? String(ca.maxPathLength) : "",
|
|
||||||
keyAlgorithm: ca.keyAlgorithm,
|
|
||||||
requireTemplateForIssuance: ca.requireTemplateForIssuance
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
reset({
|
|
||||||
type: InternalCaType.ROOT,
|
type: InternalCaType.ROOT,
|
||||||
friendlyName: "",
|
|
||||||
organization: "",
|
organization: "",
|
||||||
ou: "",
|
ou: "",
|
||||||
country: "",
|
country: "",
|
||||||
@@ -129,25 +117,65 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
commonName: "",
|
commonName: "",
|
||||||
notAfter: getDateTenYearsFromToday(),
|
notAfter: getDateTenYearsFromToday(),
|
||||||
maxPathLength: "-1",
|
maxPathLength: "-1",
|
||||||
keyAlgorithm: CertKeyAlgorithm.RSA_2048,
|
keyAlgorithm: CertKeyAlgorithm.RSA_2048
|
||||||
requireTemplateForIssuance: true
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const caType = watch("configuration.type");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (ca && ca.type === CaType.INTERNAL) {
|
||||||
|
reset({
|
||||||
|
type: ca.type,
|
||||||
|
name: ca.name,
|
||||||
|
status: ca.status,
|
||||||
|
enableDirectIssuance: ca.enableDirectIssuance,
|
||||||
|
configuration: {
|
||||||
|
type: ca.configuration.type,
|
||||||
|
organization: ca.configuration.organization,
|
||||||
|
ou: ca.configuration.ou,
|
||||||
|
country: ca.configuration.country,
|
||||||
|
province: ca.configuration.province,
|
||||||
|
locality: ca.configuration.locality,
|
||||||
|
commonName: ca.configuration.commonName,
|
||||||
|
notAfter: ca.configuration.notAfter
|
||||||
|
? format(new Date(ca.configuration.notAfter), "yyyy-MM-dd")
|
||||||
|
: "",
|
||||||
|
maxPathLength: ca.configuration.maxPathLength
|
||||||
|
? String(ca.configuration.maxPathLength)
|
||||||
|
: "",
|
||||||
|
keyAlgorithm: ca.configuration.keyAlgorithm
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
reset({
|
||||||
|
type: CaType.INTERNAL,
|
||||||
|
name: "",
|
||||||
|
status: CaStatus.ACTIVE,
|
||||||
|
enableDirectIssuance: true,
|
||||||
|
configuration: {
|
||||||
|
type: InternalCaType.ROOT,
|
||||||
|
organization: "",
|
||||||
|
ou: "",
|
||||||
|
country: "",
|
||||||
|
province: "",
|
||||||
|
locality: "",
|
||||||
|
commonName: "",
|
||||||
|
notAfter: getDateTenYearsFromToday(),
|
||||||
|
maxPathLength: "-1",
|
||||||
|
keyAlgorithm: CertKeyAlgorithm.RSA_2048
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [ca]);
|
}, [ca]);
|
||||||
|
|
||||||
const onFormSubmit = async ({
|
const onFormSubmit = async ({
|
||||||
type,
|
type,
|
||||||
friendlyName,
|
name,
|
||||||
commonName,
|
enableDirectIssuance,
|
||||||
organization,
|
status,
|
||||||
ou,
|
configuration
|
||||||
country,
|
|
||||||
locality,
|
|
||||||
province,
|
|
||||||
notAfter,
|
|
||||||
maxPathLength,
|
|
||||||
keyAlgorithm,
|
|
||||||
requireTemplateForIssuance
|
|
||||||
}: FormData) => {
|
}: FormData) => {
|
||||||
try {
|
try {
|
||||||
if (!currentWorkspace?.slug) return;
|
if (!currentWorkspace?.slug) return;
|
||||||
@@ -155,26 +183,29 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
if (ca) {
|
if (ca) {
|
||||||
// update
|
// update
|
||||||
await updateMutateAsync({
|
await updateMutateAsync({
|
||||||
projectSlug: currentWorkspace.slug,
|
caName: ca.name,
|
||||||
caId: ca.id,
|
projectId: currentWorkspace.id,
|
||||||
requireTemplateForIssuance
|
name,
|
||||||
|
type: CaType.INTERNAL,
|
||||||
|
status,
|
||||||
|
enableDirectIssuance,
|
||||||
|
configuration: {
|
||||||
|
...configuration,
|
||||||
|
maxPathLength: Number(configuration.maxPathLength)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// create
|
// create
|
||||||
await createMutateAsync({
|
await createMutateAsync({
|
||||||
projectSlug: currentWorkspace.slug,
|
projectId: currentWorkspace.id,
|
||||||
|
name,
|
||||||
type,
|
type,
|
||||||
friendlyName,
|
status,
|
||||||
commonName,
|
enableDirectIssuance,
|
||||||
organization,
|
configuration: {
|
||||||
ou,
|
...configuration,
|
||||||
country,
|
maxPathLength: Number(configuration.maxPathLength)
|
||||||
province,
|
}
|
||||||
locality,
|
|
||||||
notAfter,
|
|
||||||
maxPathLength: Number(maxPathLength),
|
|
||||||
keyAlgorithm,
|
|
||||||
requireTemplateForIssuance
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +242,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
)}
|
)}
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="type"
|
name="configuration.type"
|
||||||
defaultValue={InternalCaType.ROOT}
|
defaultValue={InternalCaType.ROOT}
|
||||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
||||||
<FormControl label="CA Type" errorText={error?.message} isError={Boolean(error)}>
|
<FormControl label="CA Type" errorText={error?.message} isError={Boolean(error)}>
|
||||||
@@ -264,7 +295,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="notAfter"
|
name="configuration.notAfter"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Valid Until"
|
label="Valid Until"
|
||||||
@@ -278,7 +309,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="maxPathLength"
|
name="configuration.maxPathLength"
|
||||||
defaultValue="-1"
|
defaultValue="-1"
|
||||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
@@ -307,7 +338,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
)}
|
)}
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="keyAlgorithm"
|
name="configuration.keyAlgorithm"
|
||||||
defaultValue={CertKeyAlgorithm.RSA_2048}
|
defaultValue={CertKeyAlgorithm.RSA_2048}
|
||||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
@@ -334,21 +365,22 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="friendlyName"
|
name="name"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Friendly Name"
|
label="Name"
|
||||||
isError={Boolean(error)}
|
isError={Boolean(error)}
|
||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
|
isRequired
|
||||||
>
|
>
|
||||||
<Input {...field} placeholder="My CA" isDisabled={Boolean(ca)} />
|
<Input {...field} placeholder="my-internal-ca" isDisabled={Boolean(ca)} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="organization"
|
name="configuration.organization"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Organization (O)"
|
label="Organization (O)"
|
||||||
@@ -362,7 +394,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="ou"
|
name="configuration.ou"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Organization Unit (OU)"
|
label="Organization Unit (OU)"
|
||||||
@@ -376,7 +408,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="country"
|
name="configuration.country"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Country Name (C)"
|
label="Country Name (C)"
|
||||||
@@ -390,7 +422,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="province"
|
name="configuration.province"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="State or Province Name"
|
label="State or Province Name"
|
||||||
@@ -404,7 +436,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="locality"
|
name="configuration.locality"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Locality Name"
|
label="Locality Name"
|
||||||
@@ -418,7 +450,7 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="commonName"
|
name="configuration.commonName"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Common Name (CN)"
|
label="Common Name (CN)"
|
||||||
@@ -431,16 +463,16 @@ export const CaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="requireTemplateForIssuance"
|
name="enableDirectIssuance"
|
||||||
render={({ field, fieldState: { error } }) => {
|
render={({ field, fieldState: { error } }) => {
|
||||||
return (
|
return (
|
||||||
<FormControl isError={Boolean(error)} errorText={error?.message} className="my-8">
|
<FormControl isError={Boolean(error)} errorText={error?.message} className="my-8">
|
||||||
<Switch
|
<Switch
|
||||||
id="is-active"
|
id="enable-direct-issuance"
|
||||||
onCheckedChange={(value) => field.onChange(value)}
|
onCheckedChange={(value) => field.onChange(value)}
|
||||||
isChecked={field.value}
|
isChecked={field.value}
|
||||||
>
|
>
|
||||||
<p className="w-full">Require Template for Certificate Issuance</p>
|
<p className="w-full">Enable Direct Issuance</p>
|
||||||
</Switch>
|
</Switch>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { createNotification } from "@app/components/notifications";
|
|||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { CaStatus, useDeleteCa, useUpdateCa } from "@app/hooks/api";
|
import { CaStatus, CaType, useDeleteCa, useUpdateCa } from "@app/hooks/api";
|
||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
import { CaCertModal } from "./CaCertModal";
|
import { CaCertModal } from "./CaCertModal";
|
||||||
@@ -28,11 +28,11 @@ export const CaSection = () => {
|
|||||||
"upgradePlan"
|
"upgradePlan"
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
const onRemoveCaSubmit = async (caId: string) => {
|
const onRemoveCaSubmit = async (caName: string) => {
|
||||||
try {
|
try {
|
||||||
if (!currentWorkspace?.slug) return;
|
if (!currentWorkspace?.slug) return;
|
||||||
|
|
||||||
await deleteCa({ caId, projectSlug: currentWorkspace.slug });
|
await deleteCa({ caName, projectId: currentWorkspace.id, type: CaType.INTERNAL });
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "Successfully deleted CA",
|
text: "Successfully deleted CA",
|
||||||
@@ -48,11 +48,11 @@ export const CaSection = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onUpdateCaStatus = async ({ caId, status }: { caId: string; status: CaStatus }) => {
|
const onUpdateCaStatus = async ({ caName, status }: { caName: string; status: CaStatus }) => {
|
||||||
try {
|
try {
|
||||||
if (!currentWorkspace?.slug) return;
|
if (!currentWorkspace?.slug) return;
|
||||||
|
|
||||||
await updateCa({ caId, projectSlug: currentWorkspace.slug, status });
|
await updateCa({ caName, projectId: currentWorkspace.id, type: CaType.INTERNAL, status });
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
text: `Successfully ${status === CaStatus.ACTIVE ? "enabled" : "disabled"} CA`,
|
text: `Successfully ${status === CaStatus.ACTIVE ? "enabled" : "disabled"} CA`,
|
||||||
@@ -102,7 +102,9 @@ export const CaSection = () => {
|
|||||||
subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."
|
subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."
|
||||||
onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}
|
||||||
deleteKey="confirm"
|
deleteKey="confirm"
|
||||||
onDeleteApproved={() => onRemoveCaSubmit((popUp?.deleteCa?.data as { caId: string })?.caId)}
|
onDeleteApproved={() =>
|
||||||
|
onRemoveCaSubmit((popUp?.deleteCa?.data as { caName: string })?.caName)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<DeleteActionModal
|
<DeleteActionModal
|
||||||
isOpen={popUp.caStatus.isOpen}
|
isOpen={popUp.caStatus.isOpen}
|
||||||
@@ -119,7 +121,7 @@ export const CaSection = () => {
|
|||||||
onChange={(isOpen) => handlePopUpToggle("caStatus", isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("caStatus", isOpen)}
|
||||||
deleteKey="confirm"
|
deleteKey="confirm"
|
||||||
onDeleteApproved={() =>
|
onDeleteApproved={() =>
|
||||||
onUpdateCaStatus(popUp?.caStatus?.data as { caId: string; status: CaStatus })
|
onUpdateCaStatus(popUp?.caStatus?.data as { caName: string; status: CaStatus })
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<UpgradePlanModal
|
<UpgradePlanModal
|
||||||
|
|||||||
@@ -23,12 +23,13 @@ import {
|
|||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { CaStatus, useListWorkspaceCas } from "@app/hooks/api";
|
import { CaStatus, CaType, useListCasByTypeAndProjectId } from "@app/hooks/api";
|
||||||
import {
|
import {
|
||||||
caStatusToNameMap,
|
caStatusToNameMap,
|
||||||
caTypeToNameMap,
|
caTypeToNameMap,
|
||||||
getCaStatusBadgeVariant
|
getCaStatusBadgeVariant
|
||||||
} from "@app/hooks/api/ca/constants";
|
} from "@app/hooks/api/ca/constants";
|
||||||
|
import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";
|
||||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ type Props = {
|
|||||||
>,
|
>,
|
||||||
data?: {
|
data?: {
|
||||||
caId?: string;
|
caId?: string;
|
||||||
|
caName?: string;
|
||||||
dn?: string;
|
dn?: string;
|
||||||
status?: CaStatus;
|
status?: CaStatus;
|
||||||
description?: string;
|
description?: string;
|
||||||
@@ -49,9 +51,8 @@ type Props = {
|
|||||||
export const CaTable = ({ handlePopUpOpen }: Props) => {
|
export const CaTable = ({ handlePopUpOpen }: Props) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { data, isPending } = useListWorkspaceCas({
|
const { data, isPending } = useListCasByTypeAndProjectId(CaType.INTERNAL, currentWorkspace.id);
|
||||||
projectSlug: currentWorkspace?.slug ?? ""
|
const cas = data as TInternalCertificateAuthority[];
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -59,7 +60,7 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
<Table>
|
<Table>
|
||||||
<THead>
|
<THead>
|
||||||
<Tr>
|
<Tr>
|
||||||
<Th>Friendly Name</Th>
|
<Th>Name</Th>
|
||||||
<Th>Status</Th>
|
<Th>Status</Th>
|
||||||
<Th>Type</Th>
|
<Th>Type</Th>
|
||||||
<Th>Valid Until</Th>
|
<Th>Valid Until</Th>
|
||||||
@@ -69,33 +70,37 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
<TBody>
|
<TBody>
|
||||||
{isPending && <TableSkeleton columns={3} innerKey="project-cas" />}
|
{isPending && <TableSkeleton columns={3} innerKey="project-cas" />}
|
||||||
{!isPending &&
|
{!isPending &&
|
||||||
data &&
|
cas &&
|
||||||
data.length > 0 &&
|
cas.length > 0 &&
|
||||||
data.map((ca) => {
|
cas.map((ca) => {
|
||||||
return (
|
return (
|
||||||
<Tr
|
<Tr
|
||||||
className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"
|
className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"
|
||||||
key={`ca-${ca.id}`}
|
key={`ca-${ca.id}`}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate({
|
navigate({
|
||||||
to: `/${ProjectType.CertificateManager}/$projectId/ca/$caId` as const,
|
to: `/${ProjectType.CertificateManager}/$projectId/ca/$caName` as const,
|
||||||
params: {
|
params: {
|
||||||
projectId: currentWorkspace.id,
|
projectId: currentWorkspace.id,
|
||||||
caId: ca.id
|
caName: ca.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Td>{ca.friendlyName}</Td>
|
<Td>{ca.name}</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<Badge variant={getCaStatusBadgeVariant(ca.status)}>
|
<Badge variant={getCaStatusBadgeVariant(ca.status)}>
|
||||||
{caStatusToNameMap[ca.status]}
|
{caStatusToNameMap[ca.status]}
|
||||||
</Badge>
|
</Badge>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>{caTypeToNameMap[ca.type]}</Td>
|
<Td>{caTypeToNameMap[ca.configuration.type]}</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<p>{ca.notAfter ? format(new Date(ca.notAfter), "yyyy-MM-dd") : "-"}</p>
|
<p>
|
||||||
|
{ca.configuration.notAfter
|
||||||
|
? format(new Date(ca.configuration.notAfter), "yyyy-MM-dd")
|
||||||
|
: "-"}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
<Td className="flex justify-end">
|
<Td className="flex justify-end">
|
||||||
@@ -172,7 +177,7 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handlePopUpOpen("caStatus", {
|
handlePopUpOpen("caStatus", {
|
||||||
caId: ca.id,
|
caName: ca.name,
|
||||||
status:
|
status:
|
||||||
ca.status === CaStatus.ACTIVE
|
ca.status === CaStatus.ACTIVE
|
||||||
? CaStatus.DISABLED
|
? CaStatus.DISABLED
|
||||||
@@ -199,8 +204,7 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handlePopUpOpen("deleteCa", {
|
handlePopUpOpen("deleteCa", {
|
||||||
caId: ca.id,
|
caName: ca.name
|
||||||
dn: ca.dn
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
disabled={!isAllowed}
|
disabled={!isAllowed}
|
||||||
|
|||||||
+4
-4
@@ -22,9 +22,9 @@ import {
|
|||||||
AcmeDnsProvider,
|
AcmeDnsProvider,
|
||||||
CaStatus,
|
CaStatus,
|
||||||
CaType,
|
CaType,
|
||||||
useCreateUnifiedCa,
|
useCreateCa,
|
||||||
useGetCa,
|
useGetCa,
|
||||||
useUpdateUnifiedCa
|
useUpdateCa
|
||||||
} from "@app/hooks/api/ca";
|
} from "@app/hooks/api/ca";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
import { slugSchema } from "@app/lib/schemas";
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
@@ -71,8 +71,8 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
type: (popUp?.ca?.data as { type: CaType })?.type || ""
|
type: (popUp?.ca?.data as { type: CaType })?.type || ""
|
||||||
});
|
});
|
||||||
|
|
||||||
const { mutateAsync: createMutateAsync } = useCreateUnifiedCa();
|
const { mutateAsync: createMutateAsync } = useCreateCa();
|
||||||
const { mutateAsync: updateMutateAsync } = useUpdateUnifiedCa();
|
const { mutateAsync: updateMutateAsync } = useUpdateCa();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@ import { createNotification } from "@app/components/notifications";
|
|||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { CaStatus, CaType, useDeleteUnifiedCa, useUpdateUnifiedCa } from "@app/hooks/api";
|
import { CaStatus, CaType, useDeleteCa, useUpdateCa } from "@app/hooks/api";
|
||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
import { ExternalCaModal } from "./ExternalCaModal";
|
import { ExternalCaModal } from "./ExternalCaModal";
|
||||||
@@ -14,8 +14,8 @@ import { ExternalCaTable } from "./ExternalCaTable";
|
|||||||
|
|
||||||
export const ExternalCaSection = () => {
|
export const ExternalCaSection = () => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { mutateAsync: deleteCa } = useDeleteUnifiedCa();
|
const { mutateAsync: deleteCa } = useDeleteCa();
|
||||||
const { mutateAsync: updateCa } = useUpdateUnifiedCa();
|
const { mutateAsync: updateCa } = useUpdateCa();
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"ca",
|
"ca",
|
||||||
|
|||||||
@@ -1135,8 +1135,8 @@ const certManagerPkiSubscriberDetailsByIDPageRouteRoute =
|
|||||||
|
|
||||||
const certManagerCertAuthDetailsByIDPageRouteRoute =
|
const certManagerCertAuthDetailsByIDPageRouteRoute =
|
||||||
certManagerCertAuthDetailsByIDPageRouteImport.update({
|
certManagerCertAuthDetailsByIDPageRouteImport.update({
|
||||||
id: '/ca/$caId',
|
id: '/ca/$caName',
|
||||||
path: '/ca/$caId',
|
path: '/ca/$caName',
|
||||||
getParentRoute: () => certManagerLayoutRoute,
|
getParentRoute: () => certManagerLayoutRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
|
||||||
@@ -2503,10 +2503,10 @@ declare module '@tanstack/react-router' {
|
|||||||
preLoaderRoute: typeof secretManagerIntegrationsListPageRouteImport
|
preLoaderRoute: typeof secretManagerIntegrationsListPageRouteImport
|
||||||
parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutSecretManagerProjectIdSecretManagerLayoutIntegrationsImport
|
parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutSecretManagerProjectIdSecretManagerLayoutIntegrationsImport
|
||||||
}
|
}
|
||||||
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId': {
|
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName': {
|
||||||
id: '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId'
|
id: '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName'
|
||||||
path: '/ca/$caId'
|
path: '/ca/$caName'
|
||||||
fullPath: '/cert-manager/$projectId/ca/$caId'
|
fullPath: '/cert-manager/$projectId/ca/$caName'
|
||||||
preLoaderRoute: typeof certManagerCertAuthDetailsByIDPageRouteImport
|
preLoaderRoute: typeof certManagerCertAuthDetailsByIDPageRouteImport
|
||||||
parentRoute: typeof certManagerLayoutImport
|
parentRoute: typeof certManagerLayoutImport
|
||||||
}
|
}
|
||||||
@@ -4105,7 +4105,7 @@ export interface FileRoutesByFullPath {
|
|||||||
'/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute
|
'/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute
|
||||||
'/cert-manager/$projectId/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute
|
'/cert-manager/$projectId/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute
|
||||||
'/secret-manager/$projectId/integrations/': typeof secretManagerIntegrationsListPageRouteRoute
|
'/secret-manager/$projectId/integrations/': typeof secretManagerIntegrationsListPageRouteRoute
|
||||||
'/cert-manager/$projectId/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
'/cert-manager/$projectId/ca/$caName': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
||||||
'/cert-manager/$projectId/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
'/cert-manager/$projectId/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
||||||
'/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
'/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
||||||
'/secret-manager/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
'/secret-manager/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
||||||
@@ -4290,7 +4290,7 @@ export interface FileRoutesByTo {
|
|||||||
'/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute
|
'/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute
|
||||||
'/cert-manager/$projectId/subscribers': typeof certManagerPkiSubscribersPageRouteRoute
|
'/cert-manager/$projectId/subscribers': typeof certManagerPkiSubscribersPageRouteRoute
|
||||||
'/secret-manager/$projectId/integrations': typeof secretManagerIntegrationsListPageRouteRoute
|
'/secret-manager/$projectId/integrations': typeof secretManagerIntegrationsListPageRouteRoute
|
||||||
'/cert-manager/$projectId/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
'/cert-manager/$projectId/ca/$caName': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
||||||
'/cert-manager/$projectId/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
'/cert-manager/$projectId/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
||||||
'/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
'/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
||||||
'/secret-manager/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
'/secret-manager/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
||||||
@@ -4495,7 +4495,7 @@ export interface FileRoutesById {
|
|||||||
'/_authenticate/_inject-org-details/_org-layout/ssh/$projectId/_ssh-layout/access-management': typeof projectAccessControlPageRouteSshRoute
|
'/_authenticate/_inject-org-details/_org-layout/ssh/$projectId/_ssh-layout/access-management': typeof projectAccessControlPageRouteSshRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/': typeof secretManagerIntegrationsListPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/': typeof secretManagerIntegrationsListPageRouteRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName': typeof certManagerCertAuthDetailsByIDPageRouteRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/$subscriberName': typeof certManagerPkiSubscriberDetailsByIDPageRouteRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/organization/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
|
||||||
'/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
'/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
|
||||||
@@ -4692,7 +4692,7 @@ export interface FileRouteTypes {
|
|||||||
| '/ssh/$projectId/access-management'
|
| '/ssh/$projectId/access-management'
|
||||||
| '/cert-manager/$projectId/subscribers/'
|
| '/cert-manager/$projectId/subscribers/'
|
||||||
| '/secret-manager/$projectId/integrations/'
|
| '/secret-manager/$projectId/integrations/'
|
||||||
| '/cert-manager/$projectId/ca/$caId'
|
| '/cert-manager/$projectId/ca/$caName'
|
||||||
| '/cert-manager/$projectId/subscribers/$subscriberName'
|
| '/cert-manager/$projectId/subscribers/$subscriberName'
|
||||||
| '/organization/app-connections/$appConnection/oauth/callback'
|
| '/organization/app-connections/$appConnection/oauth/callback'
|
||||||
| '/secret-manager/$projectId/integrations/$integrationId'
|
| '/secret-manager/$projectId/integrations/$integrationId'
|
||||||
@@ -4876,7 +4876,7 @@ export interface FileRouteTypes {
|
|||||||
| '/ssh/$projectId/access-management'
|
| '/ssh/$projectId/access-management'
|
||||||
| '/cert-manager/$projectId/subscribers'
|
| '/cert-manager/$projectId/subscribers'
|
||||||
| '/secret-manager/$projectId/integrations'
|
| '/secret-manager/$projectId/integrations'
|
||||||
| '/cert-manager/$projectId/ca/$caId'
|
| '/cert-manager/$projectId/ca/$caName'
|
||||||
| '/cert-manager/$projectId/subscribers/$subscriberName'
|
| '/cert-manager/$projectId/subscribers/$subscriberName'
|
||||||
| '/organization/app-connections/$appConnection/oauth/callback'
|
| '/organization/app-connections/$appConnection/oauth/callback'
|
||||||
| '/secret-manager/$projectId/integrations/$integrationId'
|
| '/secret-manager/$projectId/integrations/$integrationId'
|
||||||
@@ -5079,7 +5079,7 @@ export interface FileRouteTypes {
|
|||||||
| '/_authenticate/_inject-org-details/_org-layout/ssh/$projectId/_ssh-layout/access-management'
|
| '/_authenticate/_inject-org-details/_org-layout/ssh/$projectId/_ssh-layout/access-management'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/'
|
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/'
|
| '/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId'
|
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/$subscriberName'
|
| '/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers/$subscriberName'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/organization/app-connections/$appConnection/oauth/callback'
|
| '/_authenticate/_inject-org-details/_org-layout/organization/app-connections/$appConnection/oauth/callback'
|
||||||
| '/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/$integrationId'
|
| '/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations/$integrationId'
|
||||||
@@ -5606,7 +5606,7 @@ export const routeTree = rootRoute
|
|||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/settings",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/settings",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/access-management",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/access-management",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/subscribers",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/identities/$identityId",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/identities/$identityId",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/members/$membershipId",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/members/$membershipId",
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/pki-collections/$collectionId",
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/pki-collections/$collectionId",
|
||||||
@@ -5879,7 +5879,7 @@ export const routeTree = rootRoute
|
|||||||
"filePath": "secret-manager/IntegrationsListPage/route.tsx",
|
"filePath": "secret-manager/IntegrationsListPage/route.tsx",
|
||||||
"parent": "/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations"
|
"parent": "/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/_secret-manager-layout/integrations"
|
||||||
},
|
},
|
||||||
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caId": {
|
"/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout/ca/$caName": {
|
||||||
"filePath": "cert-manager/CertAuthDetailsByIDPage/route.tsx",
|
"filePath": "cert-manager/CertAuthDetailsByIDPage/route.tsx",
|
||||||
"parent": "/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout"
|
"parent": "/_authenticate/_inject-org-details/_org-layout/cert-manager/$projectId/_cert-manager-layout"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ const certManagerRoutes = route("/cert-manager/$projectId", [
|
|||||||
route("/certificates", "cert-manager/CertificatesPage/route.tsx"),
|
route("/certificates", "cert-manager/CertificatesPage/route.tsx"),
|
||||||
route("/certificate-authorities", "cert-manager/CertificateAuthoritiesPage/route.tsx"),
|
route("/certificate-authorities", "cert-manager/CertificateAuthoritiesPage/route.tsx"),
|
||||||
route("/alerting", "cert-manager/AlertingPage/route.tsx"),
|
route("/alerting", "cert-manager/AlertingPage/route.tsx"),
|
||||||
route("/ca/$caId", "cert-manager/CertAuthDetailsByIDPage/route.tsx"),
|
route("/ca/$caName", "cert-manager/CertAuthDetailsByIDPage/route.tsx"),
|
||||||
route("/pki-collections/$collectionId", "cert-manager/PkiCollectionDetailsByIDPage/routes.tsx"),
|
route("/pki-collections/$collectionId", "cert-manager/PkiCollectionDetailsByIDPage/routes.tsx"),
|
||||||
route("/settings", "cert-manager/SettingsPage/route.tsx"),
|
route("/settings", "cert-manager/SettingsPage/route.tsx"),
|
||||||
route("/access-management", "project/AccessControlPage/route-cert-manager.tsx"),
|
route("/access-management", "project/AccessControlPage/route-cert-manager.tsx"),
|
||||||
|
|||||||
Reference in New Issue
Block a user