From da8b14db62d45facfb229be6413560ab1d33d3ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:54:08 +0000 Subject: [PATCH] Update github.com/grafana/dskit digest to 90da908 --- go.mod | 2 +- go.sum | 4 +-- .../grafana/dskit/crypto/tls/tls.go | 31 +++++++++++++------ vendor/modules.txt | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index c3e0566fc30..aef09ceb6fb 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/golang/snappy v0.0.4 github.com/google/gopacket v1.1.19 github.com/gorilla/mux v1.8.1 - github.com/grafana/dskit v0.0.0-20240719153732-6e8a03e781de + github.com/grafana/dskit v0.0.0-20240724161724-90da9087cc55 github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/json-iterator/go v1.1.12 diff --git a/go.sum b/go.sum index dd72c82bf5d..d10f74bcf5a 100644 --- a/go.sum +++ b/go.sum @@ -514,8 +514,8 @@ github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc h1:PXZQA2WCxe85T github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc/go.mod h1:AHHlOEv1+GGQ3ktHMlhuTUwo3zljV3QJbC0+8o2kn+4= github.com/grafana/alerting v0.0.0-20240708204730-284b8fe16cff h1:okOj0w7kyIfrENSFGVXTjn3aSiS2QUcqwDozQkoKdH0= github.com/grafana/alerting v0.0.0-20240708204730-284b8fe16cff/go.mod h1:DLj8frbtCaITljC2jc0L85JQViPF3mPfOSiYhm1osso= -github.com/grafana/dskit v0.0.0-20240719153732-6e8a03e781de h1:wrFSxd0CUyluyAPfWpVipKSLZDsTYqrCArS4TrQzGpQ= -github.com/grafana/dskit v0.0.0-20240719153732-6e8a03e781de/go.mod h1:lcjGB6SuaZ2o44A9nD6p/tR4QXSPbzViRY520Gy6pTQ= +github.com/grafana/dskit v0.0.0-20240724161724-90da9087cc55 h1:9MsxbtwKfUA0ECN4cYk3LjTdutOa3j/5oKiiam2ArLo= +github.com/grafana/dskit v0.0.0-20240724161724-90da9087cc55/go.mod h1:lcjGB6SuaZ2o44A9nD6p/tR4QXSPbzViRY520Gy6pTQ= github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc h1:BW+LjKJDz0So5LI8UZfW5neWeKpSkWqhmGjQFzcFfLM= github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc/go.mod h1:JVmqPBe8A/pZWwRoJW5ZjyALeY5OXMzPl7LrVXOdZAI= github.com/grafana/goautoneg v0.0.0-20240607115440-f335c04c58ce h1:WI1olbgS+sEl77qxEYbmt9TgRUz7iLqmjh8lYPpGlKQ= diff --git a/vendor/github.com/grafana/dskit/crypto/tls/tls.go b/vendor/github.com/grafana/dskit/crypto/tls/tls.go index 7ed818f399a..a5b3805b768 100644 --- a/vendor/github.com/grafana/dskit/crypto/tls/tls.go +++ b/vendor/github.com/grafana/dskit/crypto/tls/tls.go @@ -109,15 +109,7 @@ func (cfg *ClientConfig) GetTLSConfig() (*tls.Config, error) { config.RootCAs = caCertPool } - // Read Client Certificate - if cfg.CertPath != "" || cfg.KeyPath != "" { - if cfg.CertPath == "" { - return nil, errCertMissing - } - if cfg.KeyPath == "" { - return nil, errKeyMissing - } - + loadCert := func() (*tls.Certificate, error) { cert, err := reader.ReadSecret(cfg.CertPath) if err != nil { return nil, errors.Wrapf(err, "error loading client cert: %s", cfg.CertPath) @@ -131,7 +123,26 @@ func (cfg *ClientConfig) GetTLSConfig() (*tls.Config, error) { if err != nil { return nil, errors.Wrapf(err, "failed to load TLS certificate %s,%s", cfg.CertPath, cfg.KeyPath) } - config.Certificates = []tls.Certificate{clientCert} + return &clientCert, nil + + } + + // Read Client Certificate + if cfg.CertPath != "" || cfg.KeyPath != "" { + if cfg.CertPath == "" { + return nil, errCertMissing + } + if cfg.KeyPath == "" { + return nil, errKeyMissing + } + // Confirm that certificate and key paths are valid. + if _, err := loadCert(); err != nil { + return nil, err + } + + config.GetClientCertificate = func(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) { + return loadCert() + } } if cfg.MinVersion != "" { diff --git a/vendor/modules.txt b/vendor/modules.txt index 5fcc991f1d8..3120a59362c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -610,7 +610,7 @@ github.com/grafana/alerting/receivers/webex github.com/grafana/alerting/receivers/webhook github.com/grafana/alerting/receivers/wecom github.com/grafana/alerting/templates -# github.com/grafana/dskit v0.0.0-20240719153732-6e8a03e781de +# github.com/grafana/dskit v0.0.0-20240724161724-90da9087cc55 ## explicit; go 1.21 github.com/grafana/dskit/backoff github.com/grafana/dskit/ballast