diff --git a/helmfiles/prd.yaml b/helmfiles/prd.yaml index e4146e8..c426fa9 100644 --- a/helmfiles/prd.yaml +++ b/helmfiles/prd.yaml @@ -4,6 +4,8 @@ charts: values: - ../maestro/values.yaml set: + - name: app_name + value: maestro - name: maestro.duc_url value: duc.dadosfera.ai - name: hostname @@ -20,3 +22,32 @@ charts: value: c0afdcce-c5be-40d0-9d1d-2d271121f14a - name: replicaCount value: 2 + + - name: unimed + chart: ../maestro + values: + - ../maestro/values.yaml + set: + - name: app_name + value: maestro-unimed + - name: maestro.duc_url + value: duc.dadosfera.ai + - name: hostname + value: maestro.dadosfera.ai + - name: maestro.pi_factory_url + value: pi-factory.dadosfera.ai + - name: maestro.in_factory_url + value: in-factory.dadosfera.ai + - name: maestro.tr_factory_url + value: in-factory.dadosfera.ai + - name: maestro.open_customer_id + value: b3e3dfe5-b992-4586-a73c-c0b0c00f615d + - name: maestro.open_group_id + value: c0afdcce-c5be-40d0-9d1d-2d271121f14a + # Customer id + - name: maestro.dedicated_proxy + value: dea2c27f-0973-4588-a2e0-9e31b64c7ffd + - name: replicaCount + value: 1 + - name: restricted-ip + value: "177.52.172.0/24" diff --git a/helmfiles/stg.yaml b/helmfiles/stg.yaml index bcbc735..06ffcee 100644 --- a/helmfiles/stg.yaml +++ b/helmfiles/stg.yaml @@ -47,4 +47,6 @@ charts: - name: maestro.dedicated_proxy value: 14d52fd4-d83d-4cdd-be34-bf11cc28b3bd - name: replicaCount - value: 1 \ No newline at end of file + value: 1 + - name: maestro.restricted_ip + value: "57.151.113.140/30" \ No newline at end of file diff --git a/maestro/templates/ingress.yaml b/maestro/templates/ingress.yaml index 78b360c..ccd8360 100644 --- a/maestro/templates/ingress.yaml +++ b/maestro/templates/ingress.yaml @@ -6,6 +6,9 @@ metadata: nginx.ingress.kubernetes.io/server-snippet: | underscores_in_headers on; ignore_invalid_headers on; + {{- if .Values.maestro.restricted_ip}} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.maestro.restricted_ip }} + {{- end }} generation: 1 labels: diff --git a/maestro/values.yaml b/maestro/values.yaml index e0ec85c..f568ed9 100644 --- a/maestro/values.yaml +++ b/maestro/values.yaml @@ -44,6 +44,7 @@ maestro: open_customer_id: f239718a-a271-4ef9-ae7e-02a2f0f3aa6e open_group_id: 401573bb-334f-44b2-b30e-88d4cea31ae9 dedicated_proxy: "" + restricted_ip: "" autoscaling: enabled: false minReplicas: 1 diff --git a/src/authentication/authentication.guard.ts b/src/authentication/authentication.guard.ts index eb9a4d4..9543362 100644 --- a/src/authentication/authentication.guard.ts +++ b/src/authentication/authentication.guard.ts @@ -137,16 +137,16 @@ export class AuthenticationGuard } // Bloquear outros customer de usar o maestor dedicado - const DEDICATED_PROXY = process.env.DEDICATED_PROXY + const DEDICATED_PROXY = process.env.DEDICATED_PROXY || ''; if (DEDICATED_PROXY !== '' && DEDICATED_PROXY !== accessTokenPayload.customer_id) { - throw new ForbiddenException(); + throw new ErrorBuilder(ErrorCodes.AUTH.FORBIDDEN); } // Bloquear o customer de acesso o maestro publico - const hasNetworkPolicyModule = accessTokenPayload.customer_modules.includes('network-policy'); - if (hasNetworkPolicyModule && DEDICATED_PROXY === '') { - throw new ForbiddenException(); - } + // const hasNetworkPolicyModule = accessTokenPayload.customer_modules.includes('network-policy'); + // if (hasNetworkPolicyModule && DEDICATED_PROXY === '') { + // throw new ForbiddenException(); + // } request.accessTokenPayload = accessTokenPayload; request.user = {