mirror of
https://github.com/lightninglabs/aperture.git
synced 2026-02-03 16:44:27 +01:00
multi: address linter issues
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // Blank import to set up profiling HTTP handlers.
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -35,12 +36,10 @@ import (
|
||||
"golang.org/x/net/http2/h2c"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/keepalive"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
// Blank import to set up profiling HTTP handlers.
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -867,7 +866,9 @@ func createHashMailServer(cfg *Config) ([]proxy.LocalService, func(), error) {
|
||||
&tls.Config{InsecureSkipVerify: true},
|
||||
))
|
||||
if cfg.Insecure {
|
||||
restProxyTLSOpt = grpc.WithInsecure()
|
||||
restProxyTLSOpt = grpc.WithTransportCredentials(
|
||||
insecure.NewCredentials(),
|
||||
)
|
||||
}
|
||||
|
||||
mux := gateway.NewServeMux(customMarshalerOption)
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/test/bufconn"
|
||||
)
|
||||
|
||||
@@ -42,7 +43,11 @@ func TestHashMailServerReturnStream(t *testing.T) {
|
||||
setupAperture(t)
|
||||
|
||||
// Create a client and connect it to the server.
|
||||
conn, err := grpc.Dial(testApertureAddress, grpc.WithInsecure())
|
||||
conn, err := grpc.Dial(
|
||||
testApertureAddress, grpc.WithTransportCredentials(
|
||||
insecure.NewCredentials(),
|
||||
),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
client := hashmailrpc.NewHashMailClient(conn)
|
||||
|
||||
@@ -114,7 +119,11 @@ func TestHashMailServerLargeMessage(t *testing.T) {
|
||||
setupAperture(t)
|
||||
|
||||
// Create a client and connect it to the server.
|
||||
conn, err := grpc.Dial(testApertureAddress, grpc.WithInsecure())
|
||||
conn, err := grpc.Dial(
|
||||
testApertureAddress, grpc.WithTransportCredentials(
|
||||
insecure.NewCredentials(),
|
||||
),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
client := hashmailrpc.NewHashMailClient(conn)
|
||||
|
||||
@@ -410,7 +419,7 @@ func (h *hashMailHarness) newClientConn() *grpc.ClientConn {
|
||||
conn, err := grpc.Dial("bufnet", grpc.WithContextDialer(
|
||||
func(ctx context.Context, s string) (net.Conn, error) {
|
||||
return h.lis.Dial()
|
||||
}), grpc.WithInsecure(),
|
||||
}), grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
)
|
||||
require.NoError(h.t, err)
|
||||
h.t.Cleanup(func() {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/lightninglabs/aperture/pricesrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
// Config holds all the config values required to initialise the GRPCPricer.
|
||||
@@ -44,7 +45,7 @@ func NewGRPCPricer(cfg *Config) (*GRPCPricer, error) {
|
||||
)
|
||||
|
||||
if cfg.Insecure {
|
||||
opt = grpc.WithInsecure()
|
||||
opt = grpc.WithTransportCredentials(insecure.NewCredentials())
|
||||
} else {
|
||||
tlsCredentials, err := credentials.NewClientTLSFromFile(
|
||||
cfg.TLSCertPath, "",
|
||||
|
||||
Reference in New Issue
Block a user