remove GRPC insecure config options, since it always needs to be set to insecure

This commit is contained in:
Willy Kloucek
2021-11-10 16:12:29 +01:00
parent 69cc11dbe6
commit e35d4fd0ac
11 changed files with 16 additions and 34 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ func Server(cfg *config.Config) *cli.Command {
func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) alice.Chain {
rolesClient := settings.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
revaClient, err := cs3.GetGatewayServiceClient(cfg.Reva.Address, cfg.Reva.Insecure) //TODO: insecure defaults to true, https://github.com/cs3org/reva/issues/2216
revaClient, err := cs3.GetGatewayServiceClient(cfg.Reva.Address)
var userProvider backend.UserBackend
switch cfg.AccountBackend {
case "accounts":
-1
View File
@@ -81,7 +81,6 @@ var (
// Reva defines all available REVA configuration.
type Reva struct {
Address string
Insecure bool
Middleware Middleware
}
+11 -18
View File
@@ -7,24 +7,17 @@ import (
"google.golang.org/grpc"
)
func newConn(endpoint string, insecure bool) (*grpc.ClientConn, error) {
opts := []grpc.DialOption{}
opts = append(opts, grpc.WithUnaryInterceptor(
otelgrpc.UnaryClientInterceptor(
otelgrpc.WithTracerProvider(
proxytracing.TraceProvider,
),
),
))
if insecure {
opts = append(opts, grpc.WithInsecure())
}
func newConn(endpoint string) (*grpc.ClientConn, error) {
conn, err := grpc.Dial(
endpoint,
opts...,
grpc.WithInsecure(),
grpc.WithUnaryInterceptor(
otelgrpc.UnaryClientInterceptor(
otelgrpc.WithTracerProvider(
proxytracing.TraceProvider,
),
),
),
)
if err != nil {
return nil, err
@@ -34,8 +27,8 @@ func newConn(endpoint string, insecure bool) (*grpc.ClientConn, error) {
}
// GetGatewayServiceClient returns a new cs3 gateway client
func GetGatewayServiceClient(endpoint string, insecure bool) (gateway.GatewayAPIClient, error) {
conn, err := newConn(endpoint, insecure)
func GetGatewayServiceClient(endpoint string) (gateway.GatewayAPIClient, error) {
conn, err := newConn(endpoint)
if err != nil {
return nil, err
}
-7
View File
@@ -189,13 +189,6 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"REVA_GATEWAY"},
Destination: &cfg.Reva.Address,
},
&cli.BoolFlag{
Name: "reva-gateway-insecure",
Value: flags.OverrideDefaultBool(cfg.Reva.Insecure, false),
Usage: "allow insecure communication to REVA gateway endpoint",
EnvVars: []string{"REVA_GATEWAY_INSECURE"},
Destination: &cfg.Reva.Insecure,
},
&cli.BoolFlag{
Name: "insecure",
Value: flags.OverrideDefaultBool(cfg.InsecureBackends, false),