IDForwarding: Require that id forwarding is enabled for data source (#77131)

* Require that id forwarding is enabled for data source

* Address feedback
This commit is contained in:
Karl Persson
2023-10-27 08:30:33 +02:00
committed by GitHub
parent 7d2bfea777
commit 1b6d39f823
4 changed files with 65 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ import (
glog "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/auth"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/featuremgmt"
@@ -269,7 +270,7 @@ func (proxy *DataSourceProxy) director(req *http.Request) {
}
}
if proxy.features.IsEnabled(featuremgmt.FlagIdForwarding) {
if proxy.features.IsEnabled(featuremgmt.FlagIdForwarding) && auth.IsIDForwardingEnabledForDataSource(proxy.ds) {
proxyutil.ApplyForwardIDHeader(req, proxy.ctx.SignedInUser)
}
}