mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 12:27:31 +00:00
Merge pull request #4201 from Infisical/check-gateway-license-in-service
License check on fnGetGatewayClientTlsByGatewayId
This commit is contained in:
@@ -566,6 +566,14 @@ export const gatewayServiceFactory = ({
|
|||||||
if (!gateway) throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found.` });
|
if (!gateway) throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found.` });
|
||||||
|
|
||||||
const orgGatewayConfig = await orgGatewayConfigDAL.findById(gateway.orgGatewayRootCaId);
|
const orgGatewayConfig = await orgGatewayConfigDAL.findById(gateway.orgGatewayRootCaId);
|
||||||
|
|
||||||
|
const orgLicensePlan = await licenseService.getPlan(orgGatewayConfig.orgId);
|
||||||
|
if (!orgLicensePlan.gateway) {
|
||||||
|
throw new BadRequestError({
|
||||||
|
message: "Please upgrade your instance to Infisical's Enterprise plan to use gateways."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const { decryptor: orgKmsDecryptor } = await kmsService.createCipherPairWithDataKey({
|
const { decryptor: orgKmsDecryptor } = await kmsService.createCipherPairWithDataKey({
|
||||||
type: KmsDataKey.Organization,
|
type: KmsDataKey.Organization,
|
||||||
orgId: orgGatewayConfig.orgId
|
orgId: orgGatewayConfig.orgId
|
||||||
|
|||||||
Reference in New Issue
Block a user