Introduce TLS Settings for all reva grpc services and clients

This commit is contained in:
Ralf Haferkamp
2022-10-25 11:50:08 +02:00
committed by Ralf Haferkamp
parent e373e48383
commit 3d57f5cc21
63 changed files with 308 additions and 149 deletions
@@ -51,9 +51,12 @@ type Debug struct {
}
type GRPCConfig struct {
Addr string `yaml:"addr" env:"STORAGE_PUBLICLINK_GRPC_ADDR" desc:"The bind address of the GRPC service."`
Namespace string `yaml:"-"`
Protocol string `yaml:"protocol" env:"STORAGE_PUBLICLINK_GRPC_PROTOCOL" desc:"The transport protocol of the GRPC service."`
Addr string `yaml:"addr" env:"STORAGE_PUBLICLINK_GRPC_ADDR" desc:"The bind address of the GRPC service."`
TLSEnabled bool `yaml:"tls_enabled" env:"OCIS_GRPC_TLS_ENABLED"`
TLSCert string `yaml:"tls_cert" env:"OCIS_GRPC_TLS_CERTIFICATE"`
TLSKey string `yaml:"tls_key" env:"OCIS_GRPC_TLS_KEY"`
Namespace string `yaml:"-"`
Protocol string `yaml:"protocol" env:"STORAGE_PUBLICLINK_GRPC_PROTOCOL" desc:"The transport protocol of the GRPC service."`
}
type StorageProvider struct {
@@ -28,9 +28,7 @@ func DefaultConfig() *config.Config {
Service: config.Service{
Name: "storage-publiclink",
},
Reva: &shared.Reva{
Address: "127.0.0.1:9142",
},
Reva: shared.DefaultRevaConfig(),
StorageProvider: config.StorageProvider{
MountID: "7993447f-687f-490d-875c-ac95e89a62a4",
},
@@ -63,7 +61,9 @@ func EnsureDefaults(cfg *config.Config) {
if cfg.Reva == nil && cfg.Commons != nil && cfg.Commons.Reva != nil {
cfg.Reva = &shared.Reva{
Address: cfg.Commons.Reva.Address,
Address: cfg.Commons.Reva.Address,
TLSMode: cfg.Commons.Reva.TLSMode,
TLSCACert: cfg.Commons.Reva.TLSCACert,
}
} else if cfg.Reva == nil {
cfg.Reva = &shared.Reva{}
@@ -17,10 +17,16 @@ func StoragePublicLinkConfigFromStruct(cfg *config.Config) map[string]interface{
"jwt_secret": cfg.TokenManager.JWTSecret,
"gatewaysvc": cfg.Reva.Address,
"skip_user_groups_in_token": cfg.SkipUserGroupsInToken,
"grpc_client_options": cfg.Reva.GetGRPCClientConfig(),
},
"grpc": map[string]interface{}{
"network": cfg.GRPC.Protocol,
"address": cfg.GRPC.Addr,
"tls_settings": map[string]interface{}{
"enabled": cfg.GRPC.TLSEnabled,
"certificate": cfg.GRPC.TLSCert,
"key": cfg.GRPC.TLSKey,
},
"interceptors": map[string]interface{}{
"log": map[string]interface{}{},
"prometheus": map[string]interface{}{