id forwarding: transfer Grafana id token to app plugins (#81967)

* id forwarding: allow for app plugins as well

* Add test
This commit is contained in:
Gabriel MABILLE
2024-02-06 16:26:17 +01:00
committed by GitHub
parent eab7990349
commit 4af5aef417
2 changed files with 22 additions and 2 deletions

View File

@ -28,8 +28,8 @@ type ForwardIDMiddleware struct {
func (m *ForwardIDMiddleware) applyToken(ctx context.Context, pCtx backend.PluginContext, req backend.ForwardHTTPHeaders) error {
reqCtx := contexthandler.FromContext(ctx)
// if request not for a datasource or no HTTP request context skip middleware
if req == nil || reqCtx == nil || reqCtx.SignedInUser == nil || pCtx.DataSourceInstanceSettings == nil {
// no HTTP request context => skip middleware
if req == nil || reqCtx == nil || reqCtx.SignedInUser == nil {
return nil
}