From cd7b454e25645e86a44ea26d3cea675707a75f50 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Tue, 9 Oct 2018 16:36:45 +0200 Subject: [PATCH] stackdriver: add default value for authentication type --- pkg/api/pluginproxy/ds_auth_provider.go | 2 +- pkg/tsdb/stackdriver/test_datasource_query.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/pluginproxy/ds_auth_provider.go b/pkg/api/pluginproxy/ds_auth_provider.go index 194e4e8e964..60360733923 100644 --- a/pkg/api/pluginproxy/ds_auth_provider.go +++ b/pkg/api/pluginproxy/ds_auth_provider.go @@ -55,7 +55,7 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route } } - authenticationType := ds.JsonData.Get("authenticationType").MustString() + authenticationType := ds.JsonData.Get("authenticationType").MustString("jwt") if route.JwtTokenAuth != nil && authenticationType == "jwt" { logger.Info("authenticationType", "authenticationType", "jwt") if token, err := tokenProvider.getJwtAccessToken(ctx, data); err != nil { diff --git a/pkg/tsdb/stackdriver/test_datasource_query.go b/pkg/tsdb/stackdriver/test_datasource_query.go index 822ca725f49..4ea79a79e43 100644 --- a/pkg/tsdb/stackdriver/test_datasource_query.go +++ b/pkg/tsdb/stackdriver/test_datasource_query.go @@ -17,7 +17,7 @@ import ( ) func (e *StackdriverExecutor) executeTestDataSource(ctx context.Context, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) { - authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString() + authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString("jwt") if authenticationType == "gce" { defaultProject, err := e.getDefaultProject(ctx) if err != nil {