From 3bf1c400b8f208f5f6c91436af2b52fd88c73115 Mon Sep 17 00:00:00 2001 From: datelier <57349093+datelier@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:29:36 +0900 Subject: [PATCH] fix deepsource: Audit required: Insecure gRPC server --- internal/net/grpc/pool/pool_bench_test.go | 1 + internal/net/grpc/server.go | 1 + internal/net/grpc/server_test.go | 2 ++ 3 files changed, 4 insertions(+) diff --git a/internal/net/grpc/pool/pool_bench_test.go b/internal/net/grpc/pool/pool_bench_test.go index 06a368410f..287dbc6c95 100644 --- a/internal/net/grpc/pool/pool_bench_test.go +++ b/internal/net/grpc/pool/pool_bench_test.go @@ -64,6 +64,7 @@ func ListenAndServe(b *testing.B, addr string) func() { b.Error(err) } + // skipcq: GO-S0902 s := grpc.NewServer() discoverer.RegisterDiscovererServer(s, new(server)) diff --git a/internal/net/grpc/server.go b/internal/net/grpc/server.go index 5353fe3f56..11bf8e4040 100644 --- a/internal/net/grpc/server.go +++ b/internal/net/grpc/server.go @@ -45,6 +45,7 @@ var ErrServerStopped = grpc.ErrServerStopped // NewServer returns the gRPC server. func NewServer(opts ...ServerOption) *Server { + // skipcq: GO-S0902 return grpc.NewServer(opts...) } diff --git a/internal/net/grpc/server_test.go b/internal/net/grpc/server_test.go index 5e30b5aa74..2c8e36dc98 100644 --- a/internal/net/grpc/server_test.go +++ b/internal/net/grpc/server_test.go @@ -70,6 +70,7 @@ func TestNewServer(t *testing.T) { opts: nil, }, want: want{ + // skipcq: GO-S0902 want: grpc.NewServer(), }, }, @@ -79,6 +80,7 @@ func TestNewServer(t *testing.T) { opts: []ServerOption{MaxSendMsgSize(100)}, }, want: want{ + // skipcq: GO-S0902 want: grpc.NewServer(), }, },