mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
Add missing fiels
This commit is contained in:
@@ -249,7 +249,8 @@ export const registerCertificateProfilesRouter = async (server: FastifyZodProvid
|
|||||||
acmeConfig: z
|
acmeConfig: z
|
||||||
.object({
|
.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
directoryUrl: z.string()
|
directoryUrl: z.string(),
|
||||||
|
skipDnsOwnershipVerification: z.boolean().optional()
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
externalConfigs: ExternalConfigUnionSchema
|
externalConfigs: ExternalConfigUnionSchema
|
||||||
|
|||||||
@@ -361,7 +361,11 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
|
|||||||
db.ref("id").withSchema(TableName.PkiApiEnrollmentConfig).as("apiId"),
|
db.ref("id").withSchema(TableName.PkiApiEnrollmentConfig).as("apiId"),
|
||||||
db.ref("autoRenew").withSchema(TableName.PkiApiEnrollmentConfig).as("apiAutoRenew"),
|
db.ref("autoRenew").withSchema(TableName.PkiApiEnrollmentConfig).as("apiAutoRenew"),
|
||||||
db.ref("renewBeforeDays").withSchema(TableName.PkiApiEnrollmentConfig).as("apiRenewBeforeDays"),
|
db.ref("renewBeforeDays").withSchema(TableName.PkiApiEnrollmentConfig).as("apiRenewBeforeDays"),
|
||||||
db.ref("id").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeId")
|
db.ref("id").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeId"),
|
||||||
|
db
|
||||||
|
.ref("skipDnsOwnershipVerification")
|
||||||
|
.withSchema(TableName.PkiAcmeEnrollmentConfig)
|
||||||
|
.as("acmeSkipDnsOwnershipVerification")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (processedRules) {
|
if (processedRules) {
|
||||||
@@ -398,7 +402,8 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
|
|||||||
|
|
||||||
const acmeConfig = result.acmeId
|
const acmeConfig = result.acmeId
|
||||||
? {
|
? {
|
||||||
id: result.acmeId as string
|
id: result.acmeId as string,
|
||||||
|
skipDnsOwnershipVerification: !!result.acmeSkipDnsOwnershipVerification
|
||||||
}
|
}
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export type TCertificateProfileWithDetails = TCertificateProfile & {
|
|||||||
acmeConfig?: {
|
acmeConfig?: {
|
||||||
id: string;
|
id: string;
|
||||||
directoryUrl: string;
|
directoryUrl: string;
|
||||||
|
skipDnsOwnershipVerification?: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ const createSchema = z
|
|||||||
renewBeforeDays: z.number().min(1).max(365).optional()
|
renewBeforeDays: z.number().min(1).max(365).optional()
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
acmeConfig: z.object({}).optional(),
|
acmeConfig: z
|
||||||
|
.object({
|
||||||
|
skipDnsOwnershipVerification: z.boolean().optional()
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
externalConfigs: z
|
externalConfigs: z
|
||||||
.object({
|
.object({
|
||||||
template: z.string().min(1, "Azure ADCS template is required")
|
template: z.string().min(1, "Azure ADCS template is required")
|
||||||
@@ -219,7 +223,11 @@ const editSchema = z
|
|||||||
renewBeforeDays: z.number().min(1).max(365).optional()
|
renewBeforeDays: z.number().min(1).max(365).optional()
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
acmeConfig: z.object({}).optional(),
|
acmeConfig: z
|
||||||
|
.object({
|
||||||
|
skipDnsOwnershipVerification: z.boolean().optional()
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
externalConfigs: z
|
externalConfigs: z
|
||||||
.object({
|
.object({
|
||||||
template: z.string().optional()
|
template: z.string().optional()
|
||||||
@@ -406,7 +414,13 @@ export const CreateProfileModal = ({
|
|||||||
renewBeforeDays: profile.apiConfig?.renewBeforeDays || 30
|
renewBeforeDays: profile.apiConfig?.renewBeforeDays || 30
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
acmeConfig: profile.enrollmentType === EnrollmentType.ACME ? {} : undefined,
|
acmeConfig:
|
||||||
|
profile.enrollmentType === EnrollmentType.ACME
|
||||||
|
? {
|
||||||
|
skipDnsOwnershipVerification:
|
||||||
|
profile.acmeConfig?.skipDnsOwnershipVerification || false
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
externalConfigs: profile.externalConfigs
|
externalConfigs: profile.externalConfigs
|
||||||
? {
|
? {
|
||||||
template:
|
template:
|
||||||
@@ -429,7 +443,9 @@ export const CreateProfileModal = ({
|
|||||||
autoRenew: false,
|
autoRenew: false,
|
||||||
renewBeforeDays: 30
|
renewBeforeDays: 30
|
||||||
},
|
},
|
||||||
acmeConfig: {},
|
acmeConfig: {
|
||||||
|
skipDnsOwnershipVerification: false
|
||||||
|
},
|
||||||
externalConfigs: undefined
|
externalConfigs: undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -476,7 +492,13 @@ export const CreateProfileModal = ({
|
|||||||
renewBeforeDays: profile.apiConfig?.renewBeforeDays || 30
|
renewBeforeDays: profile.apiConfig?.renewBeforeDays || 30
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
acmeConfig: profile.enrollmentType === EnrollmentType.ACME ? {} : undefined,
|
acmeConfig:
|
||||||
|
profile.enrollmentType === EnrollmentType.ACME
|
||||||
|
? {
|
||||||
|
skipDnsOwnershipVerification:
|
||||||
|
profile.acmeConfig?.skipDnsOwnershipVerification || false
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
externalConfigs: profile.externalConfigs
|
externalConfigs: profile.externalConfigs
|
||||||
? {
|
? {
|
||||||
template:
|
template:
|
||||||
@@ -667,7 +689,9 @@ export const CreateProfileModal = ({
|
|||||||
renewBeforeDays: 30
|
renewBeforeDays: 30
|
||||||
});
|
});
|
||||||
setValue("estConfig", undefined);
|
setValue("estConfig", undefined);
|
||||||
setValue("acmeConfig", undefined);
|
setValue("acmeConfig", {
|
||||||
|
skipDnsOwnershipVerification: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
onChange(value);
|
onChange(value);
|
||||||
}}
|
}}
|
||||||
@@ -797,7 +821,9 @@ export const CreateProfileModal = ({
|
|||||||
} else if (watchedEnrollmentType === "acme") {
|
} else if (watchedEnrollmentType === "acme") {
|
||||||
setValue("estConfig", undefined);
|
setValue("estConfig", undefined);
|
||||||
setValue("apiConfig", undefined);
|
setValue("apiConfig", undefined);
|
||||||
setValue("acmeConfig", {});
|
setValue("acmeConfig", {
|
||||||
|
skipDnsOwnershipVerification: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
onChange(value);
|
onChange(value);
|
||||||
}}
|
}}
|
||||||
@@ -846,7 +872,9 @@ export const CreateProfileModal = ({
|
|||||||
} else if (value === "acme") {
|
} else if (value === "acme") {
|
||||||
setValue("apiConfig", undefined);
|
setValue("apiConfig", undefined);
|
||||||
setValue("estConfig", undefined);
|
setValue("estConfig", undefined);
|
||||||
setValue("acmeConfig", {});
|
setValue("acmeConfig", {
|
||||||
|
skipDnsOwnershipVerification: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
onChange(value);
|
onChange(value);
|
||||||
}}
|
}}
|
||||||
@@ -975,10 +1003,24 @@ export const CreateProfileModal = ({
|
|||||||
<div className="mb-4 space-y-4">
|
<div className="mb-4 space-y-4">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="acmeConfig"
|
name="acmeConfig.skipDnsOwnershipVerification"
|
||||||
render={({ fieldState: { error } }) => (
|
render={({ field: { value, onChange }, fieldState: { error } }) => (
|
||||||
<FormControl isError={Boolean(error)} errorText={error?.message}>
|
<FormControl isError={Boolean(error)} errorText={error?.message}>
|
||||||
<div className="flex items-center gap-2">{/* FIXME: ACME configuration */}</div>
|
<div className="flex items-center gap-3 rounded-md border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||||
|
<Checkbox
|
||||||
|
id="skipDnsOwnershipVerification"
|
||||||
|
isChecked={value || false}
|
||||||
|
onCheckedChange={onChange}
|
||||||
|
/>
|
||||||
|
<div className="space-y-1">
|
||||||
|
<span className="text-sm font-medium text-mineshaft-100">
|
||||||
|
Skip DNS Ownership Validation
|
||||||
|
</span>
|
||||||
|
<p className="text-xs text-bunker-300">
|
||||||
|
Skip DNS ownership verification during ACME certificate issuance.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user