FIX: automattically skip ssl when microservices connection are local

This commit is contained in:
Gabriel Rosa
2023-02-13 10:30:50 -03:00
parent d06910515b
commit d6b3e02890
8 changed files with 22 additions and 27 deletions
+3 -4
View File
@@ -6,6 +6,8 @@ import {
import { PipelinePackages, PipelineProtoFilePath } from 'protospack';
import { credentials } from '@grpc/grpc-js';
const isLocalConnection = !!process.env.PIFACTORY_URL?.includes('0.0.0.0');
export class PipelinesClientConfiguration {
public name = 'PipelinesClientConfiguration';
private config: GrpcOptions = {
@@ -13,10 +15,7 @@ export class PipelinesClientConfiguration {
options: {
url: process.env.PIFACTORY_URL,
package: PipelinePackages,
credentials:
process.env.LOCAL_ENV || process.env.ENV === 'local'
? undefined
: credentials.createSsl(),
credentials: isLocalConnection ? undefined : credentials.createSsl(),
protoPath: PipelineProtoFilePath,
loader: {
keepCase: true,