remove GRPC insecure config options, since it always needs to be set to insecure
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -81,7 +81,6 @@ var (
|
||||
// Reva defines all available REVA configuration.
|
||||
type Reva struct {
|
||||
Address string
|
||||
Insecure bool
|
||||
Middleware Middleware
|
||||
}
|
||||
|
||||
|
||||
+11
-18
@@ -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
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user