mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 14:27:23 +00:00
PKI revamp: UI improvements
This commit is contained in:
@@ -347,7 +347,7 @@ describe("CertificateV3Service", () => {
|
||||
|
||||
describe("orderCertificateFromProfile", () => {
|
||||
const mockCertificateOrder = {
|
||||
identifiers: [{ type: "dns" as const, value: "example.com" }],
|
||||
subjectAlternativeNames: [{ type: "dns" as const, value: "example.com" }],
|
||||
validity: { ttl: "30d" },
|
||||
commonName: "example.com",
|
||||
keyUsages: [CertKeyUsage.DIGITAL_SIGNATURE],
|
||||
@@ -411,8 +411,8 @@ describe("CertificateV3Service", () => {
|
||||
expect(result).toHaveProperty("orderId");
|
||||
expect(result).toHaveProperty("status", "valid");
|
||||
expect(result).toHaveProperty("certificate");
|
||||
expect(result.identifiers).toHaveLength(1);
|
||||
expect(result.identifiers[0]).toEqual({
|
||||
expect(result.subjectAlternativeNames).toHaveLength(1);
|
||||
expect(result.subjectAlternativeNames[0]).toEqual({
|
||||
type: "dns",
|
||||
value: "example.com",
|
||||
status: "valid"
|
||||
|
||||
@@ -293,9 +293,9 @@ export const certificateV3ServiceFactory = ({
|
||||
commonName: certificateOrder.commonName,
|
||||
keyUsages: certificateOrder.keyUsages,
|
||||
extendedKeyUsages: certificateOrder.extendedKeyUsages,
|
||||
subjectAlternativeNames: certificateOrder.identifiers.map((id) => ({
|
||||
type: id.type === "dns" ? ("dns_name" as const) : ("ip_address" as const),
|
||||
value: id.value
|
||||
subjectAlternativeNames: certificateOrder.subjectAlternativeNames.map((san) => ({
|
||||
type: san.type === "dns" ? ("dns_name" as const) : ("ip_address" as const),
|
||||
value: san.value
|
||||
})),
|
||||
validity: certificateOrder.validity,
|
||||
notBefore: certificateOrder.notBefore,
|
||||
@@ -334,16 +334,16 @@ export const certificateV3ServiceFactory = ({
|
||||
});
|
||||
|
||||
const orderId = randomUUID();
|
||||
const identifiers = certificateOrder.identifiers.map((id) => ({
|
||||
type: id.type,
|
||||
value: id.value,
|
||||
const subjectAlternativeNames = certificateOrder.subjectAlternativeNames.map((san) => ({
|
||||
type: san.type,
|
||||
value: san.value,
|
||||
status: "valid" as const
|
||||
}));
|
||||
|
||||
const authorizations = certificateOrder.identifiers.map((id) => ({
|
||||
const authorizations = certificateOrder.subjectAlternativeNames.map((san) => ({
|
||||
identifier: {
|
||||
type: id.type,
|
||||
value: id.value
|
||||
type: san.type,
|
||||
value: san.value
|
||||
},
|
||||
status: "valid" as const,
|
||||
expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
|
||||
@@ -360,7 +360,7 @@ export const certificateV3ServiceFactory = ({
|
||||
return {
|
||||
orderId,
|
||||
status: "valid",
|
||||
identifiers,
|
||||
subjectAlternativeNames,
|
||||
authorizations,
|
||||
finalize: `/api/v3/certificates/orders/${orderId}/finalize`,
|
||||
certificate: certificateResult.certificate
|
||||
|
||||
@@ -35,7 +35,7 @@ export type TSignCertificateFromProfileDTO = {
|
||||
export type TOrderCertificateFromProfileDTO = {
|
||||
profileId: string;
|
||||
certificateOrder: {
|
||||
identifiers: Array<{
|
||||
subjectAlternativeNames: Array<{
|
||||
type: "dns" | "ip";
|
||||
value: string;
|
||||
}>;
|
||||
@@ -64,7 +64,7 @@ export type TCertificateFromProfileResponse = {
|
||||
export type TCertificateOrderResponse = {
|
||||
orderId: string;
|
||||
status: "pending" | "processing" | "valid" | "invalid";
|
||||
identifiers: Array<{
|
||||
subjectAlternativeNames: Array<{
|
||||
type: "dns" | "ip";
|
||||
value: string;
|
||||
status: "pending" | "processing" | "valid" | "invalid";
|
||||
|
||||
Reference in New Issue
Block a user