mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 14:27:59 +00:00
misc: addressed cert issuance restriction update
This commit is contained in:
@@ -276,4 +276,6 @@ export const SanitizedTagSchema = SecretTagsSchema.pick({
|
|||||||
|
|
||||||
export const InternalCertificateAuthorityResponseSchema = CertificateAuthoritiesSchema.merge(
|
export const InternalCertificateAuthorityResponseSchema = CertificateAuthoritiesSchema.merge(
|
||||||
InternalCertificateAuthoritiesSchema
|
InternalCertificateAuthoritiesSchema
|
||||||
);
|
).extend({
|
||||||
|
requireTemplateForIssuance: z.boolean().optional()
|
||||||
|
});
|
||||||
|
|||||||
@@ -328,6 +328,7 @@ export const expandInternalCa = (
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...ca.internalCa,
|
...ca.internalCa,
|
||||||
...ca
|
...ca,
|
||||||
|
requireTemplateForIssuance: ca.disableDirectIssuance
|
||||||
} as const;
|
} as const;
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-2
@@ -384,7 +384,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const updatedCa = await certificateAuthorityDAL.transaction(async (tx) => {
|
const updatedCa = await certificateAuthorityDAL.transaction(async (tx) => {
|
||||||
if (status) {
|
if (status !== undefined) {
|
||||||
await internalCertificateAuthorityDAL.update(
|
await internalCertificateAuthorityDAL.update(
|
||||||
{
|
{
|
||||||
certificateAuthorityId: ca.id
|
certificateAuthorityId: ca.id
|
||||||
@@ -394,7 +394,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requireTemplateForIssuance) {
|
if (requireTemplateForIssuance !== undefined) {
|
||||||
await certificateAuthorityDAL.updateById(ca.id, { disableDirectIssuance: requireTemplateForIssuance }, tx);
|
await certificateAuthorityDAL.updateById(ca.id, { disableDirectIssuance: requireTemplateForIssuance }, tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user