Shared Azure middleware between Azure Monitor and Prometheus datasources (#46002)

* Scopes in Azure middleware

* Enable Azure middleware without feature flag

* Use common Azure middleware in Azure Monitor

* Apply feature flag to JsonData configuration of Azure auth

* Enforce feature flag in Prometheus datasource

* Prometheus provider tests

* Datasource service tests

* Fix http client provider tests

* Pass sdkhttpclient.Options by reference

* Add middleware to httpclient.Options

* Remove dependency on Grafana settings

* Unit-tests updated

* Fix ds_proxy_test

* Fix service_test
This commit is contained in:
Sergey Kostrukov
2022-04-01 04:26:49 -07:00
committed by GitHub
parent 16db1ad46d
commit 656ade9884
39 changed files with 729 additions and 434 deletions

View File

@@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor/azsettings"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor/metrics"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor/types"
"github.com/stretchr/testify/require"
@@ -99,7 +99,7 @@ func Test_handleResourceReq(t *testing.T) {
im: &fakeInstance{
services: map[string]types.DatasourceService{
azureMonitor: {
URL: routes[setting.AzurePublic][azureMonitor].URL,
URL: routes[azsettings.AzurePublic][azureMonitor].URL,
HTTPClient: &http.Client{},
},
},