Skip to content

Commit

Permalink
feat: enable tls on grpc clients (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
zolamk authored Aug 3, 2023
1 parent febd569 commit 1ed9043
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions go/clients/codehost.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
package clients

import (
"crypto/tls"

"github.com/reviewpad/api/go/services"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/credentials"
)

func NewCodeHostClient(endpoint string) (services.HostClient, *grpc.ClientConn, error) {
defaultOptions := grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400))
transportCredentials := grpc.WithTransportCredentials(insecure.NewCredentials())
transportCredentials := grpc.WithTransportCredentials(credentials.NewTLS((&tls.Config{})))

hostConnection, err := grpc.Dial(endpoint, transportCredentials, defaultOptions)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions go/clients/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
package clients

import (
"crypto/tls"

"github.com/reviewpad/api/go/services"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/credentials"
)

func NewDiffClient(endpoint string) (services.DiffClient, *grpc.ClientConn, error) {
defaultOptions := grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400))
transportCredentials := grpc.WithTransportCredentials(insecure.NewCredentials())
transportCredentials := grpc.WithTransportCredentials(credentials.NewTLS((&tls.Config{})))

diffConnection, err := grpc.Dial(endpoint, transportCredentials, defaultOptions)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions go/clients/robin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
package clients

import (
"crypto/tls"

"github.com/reviewpad/api/go/services"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/credentials"
)

func NewRobinClient(endpoint string) (services.RobinClient, *grpc.ClientConn, error) {
defaultOptions := grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400))
transportCredentials := grpc.WithTransportCredentials(insecure.NewCredentials())
transportCredentials := grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))

robinConnection, err := grpc.Dial(endpoint, transportCredentials, defaultOptions)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions go/clients/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
package clients

import (
"crypto/tls"

"github.com/reviewpad/api/go/services"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/credentials"
)

func NewSemanticClient(endpoint string) (services.SemanticClient, *grpc.ClientConn, error) {
defaultOptions := grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400))
transportCredentials := grpc.WithTransportCredentials(insecure.NewCredentials())
transportCredentials := grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))

semanticConnection, err := grpc.Dial(endpoint, transportCredentials, defaultOptions)
if err != nil {
Expand Down

0 comments on commit 1ed9043

Please sign in to comment.