Skip to content

Commit

Permalink
Improve log and improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec committed Dec 15, 2023
1 parent be3d653 commit 2e79af2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/bot/slack_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (b *CloudSlack) start(ctx context.Context) error {

b.log.WithFields(logrus.Fields{
"url": b.cfg.Server.URL,
"disableSecurity": b.cfg.Server.DisableSecurity,
"disableSecurity": b.cfg.Server.DisableTransportSecurity,
"tlsUseSystemCertPool": b.cfg.Server.TLS.UseSystemCertPool,
"tlsCACertificateLen": len(b.cfg.Server.TLS.CACertificate),
"tlsSkipVerify": b.cfg.Server.TLS.InsecureSkipVerify,
Expand Down
2 changes: 1 addition & 1 deletion pkg/bot/teams_cloud_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newGrpcCloudTeamsConnector(log logrus.FieldLogger, cfg config.GRPCServer) (

log.WithFields(logrus.Fields{
"url": cfg.URL,
"disableSecurity": cfg.DisableSecurity,
"disableSecurity": cfg.DisableTransportSecurity,
"tlsUseSystemCertPool": cfg.TLS.UseSystemCertPool,
"tlsCACertificateLen": len(cfg.TLS.CACertificate),
"tlsSkipVerify": cfg.TLS.InsecureSkipVerify,
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ type CloudSlack struct {

// GRPCServer config for gRPC server
type GRPCServer struct {
URL string `yaml:"url"`
DisableSecurity bool `yaml:"insecure"`
TLS GRPCServerTLSConfig `yaml:"tls"`
URL string `yaml:"url"`
DisableTransportSecurity bool `yaml:"disableTransportSecurity"`
TLS GRPCServerTLSConfig `yaml:"tls"`
}

// GRPCServerTLSConfig describes gRPC server TLS configuration.m
Expand Down
4 changes: 2 additions & 2 deletions pkg/grpcx/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

// ClientTransportCredentials returns gRPC client transport credentials based on the provided configuration.
func ClientTransportCredentials(log logrus.FieldLogger, cfg config.GRPCServer) (credentials.TransportCredentials, error) {
if cfg.DisableSecurity {
log.Warn("Server CA certificate is not provided. Using insecure gRPC connection...")
if cfg.DisableTransportSecurity {
log.Warn("gRPC encryption is disabled. Disabling transport security...")
return insecure.NewCredentials(), nil
}

Expand Down

0 comments on commit 2e79af2

Please sign in to comment.