Skip to content

Commit

Permalink
Pass in creds
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Oct 4, 2024
1 parent 50ec155 commit 6b6aa4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions integration-tests/deployment/devenv/build_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/subosito/gotenv"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc/credentials/insecure"

"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

Expand Down Expand Up @@ -105,6 +106,7 @@ func CreateDockerEnv(t *testing.T) (
GRPC: jd.Grpc,
// we will use internal wsrpc for nodes on same docker network to connect to JD
WSRPC: jd.InternalWSRPC,
Creds: insecure.NewCredentials(),
}
} else {
jdConfig = JDConfig{
Expand Down
15 changes: 2 additions & 13 deletions integration-tests/deployment/devenv/jd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package devenv

import (
"context"
"crypto/tls"
"fmt"

"google.golang.org/grpc"
Expand All @@ -17,22 +16,12 @@ import (
type JDConfig struct {
GRPC string
WSRPC string
creds credentials.TransportCredentials
Creds credentials.TransportCredentials
nodeInfo []NodeInfo
}

func NewJDConnection(cfg JDConfig) (*grpc.ClientConn, error) {
var opts []grpc.DialOption
// TODO: add auth details
if cfg.creds != nil {
opts = append(opts, grpc.WithTransportCredentials(cfg.creds))
} else {
opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
MinVersion: tls.VersionTLS12,
})))
}

conn, err := grpc.NewClient(cfg.GRPC, opts...)
conn, err := grpc.NewClient(cfg.GRPC, grpc.WithTransportCredentials(cfg.Creds))
if err != nil {
return nil, fmt.Errorf("failed to connect Job Distributor service. Err: %w", err)
}
Expand Down

0 comments on commit 6b6aa4c

Please sign in to comment.