mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 09:27:50 +00:00
Fix the compare logic, isSubsetOf seems like not available
This commit is contained in:
@@ -684,12 +684,11 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
.map((san) => san.value.toLowerCase())
|
.map((san) => san.value.toLowerCase())
|
||||||
.concat([certificateRequest.commonName!.toLowerCase()])
|
.concat([certificateRequest.commonName!.toLowerCase()])
|
||||||
);
|
);
|
||||||
const expectedIdentifierValues = new Set(
|
|
||||||
orderWithAuthorizations.authorizations.map((auth) => auth.identifierValue.toLowerCase())
|
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
csrIdentifierValues.size != expectedIdentifierValues.size ||
|
csrIdentifierValues.size !== orderWithAuthorizations.authorizations.length ||
|
||||||
!csrIdentifierValues.isSubsetOf(expectedIdentifierValues)
|
!orderWithAuthorizations.authorizations.every((auth) =>
|
||||||
|
csrIdentifierValues.has(auth.identifierValue.toLowerCase())
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
throw new AcmeBadCSRError({ detail: "Invalid CSR: Common name + SANs mismatch with order identifiers" });
|
throw new AcmeBadCSRError({ detail: "Invalid CSR: Common name + SANs mismatch with order identifiers" });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user