From 4f3856adfbfc71f1d779f3dd49994e295098c346 Mon Sep 17 00:00:00 2001 From: Matt Bostock Date: Mon, 2 Oct 2017 15:06:02 +0100 Subject: [PATCH] Retain old name for TLS client auth I renamed `tlsAuth` to `tlsClientAuth` to better describe the fact that this variable is used to enable TLS client authentication (as opposed to server authentication) in c04d95f35. However, changing the name breaks backwards compatibility for existing installations using this feature and Grafana does not have a standardised way of migrating changes in the schema: https://github.com/grafana/grafana/pull/9377#issuecomment-333063543 For reasons of expediency given the severity of the bug (not verifying TLS), keep the old name. --- pkg/models/datasource_cache.go | 2 +- pkg/models/datasource_cache_test.go | 2 +- public/app/features/plugins/partials/ds_http_settings.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/models/datasource_cache.go b/pkg/models/datasource_cache.go index 79c67691df7..b4a4e7f8a4d 100644 --- a/pkg/models/datasource_cache.go +++ b/pkg/models/datasource_cache.go @@ -48,7 +48,7 @@ func (ds *DataSource) GetHttpTransport() (*http.Transport, error) { var tlsSkipVerify, tlsClientAuth, tlsAuthWithCACert bool if ds.JsonData != nil { - tlsClientAuth = ds.JsonData.Get("tlsClientAuth").MustBool(false) + tlsClientAuth = ds.JsonData.Get("tlsAuth").MustBool(false) tlsAuthWithCACert = ds.JsonData.Get("tlsAuthWithCACert").MustBool(false) tlsSkipVerify = ds.JsonData.Get("tlsSkipVerify").MustBool(false) } diff --git a/pkg/models/datasource_cache_test.go b/pkg/models/datasource_cache_test.go index d427cc84bf9..85ece0bbdcc 100644 --- a/pkg/models/datasource_cache_test.go +++ b/pkg/models/datasource_cache_test.go @@ -87,7 +87,7 @@ func TestDataSourceCache(t *testing.T) { setting.SecretKey = "password" json := simplejson.New() - json.Set("tlsClientAuth", true) + json.Set("tlsAuth", true) tlsClientCert, err := util.Encrypt([]byte(clientCert), "password") So(err, ShouldBeNil) diff --git a/public/app/features/plugins/partials/ds_http_settings.html b/public/app/features/plugins/partials/ds_http_settings.html index 1d8582c06d1..ac21c6f9ed8 100644 --- a/public/app/features/plugins/partials/ds_http_settings.html +++ b/public/app/features/plugins/partials/ds_http_settings.html @@ -45,7 +45,7 @@
- +
@@ -73,7 +73,7 @@ -
+
TLS Auth Details
TLS Certs are encrypted and stored in the Grafana database. @@ -94,7 +94,7 @@
-
+