From cf616d5074003364f5aac0edf7b402e8e317eb73 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 6 Feb 2024 14:06:19 +0100 Subject: [PATCH] Remove X-Grafana-Device-Id from outbound requests (#81957) --- pkg/services/contexthandler/contexthandler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/contexthandler/contexthandler.go b/pkg/services/contexthandler/contexthandler.go index 3b83863da62..6ea987300f6 100644 --- a/pkg/services/contexthandler/contexthandler.go +++ b/pkg/services/contexthandler/contexthandler.go @@ -209,6 +209,9 @@ func WithAuthHTTPHeaders(ctx context.Context, cfg *setting.Cfg) context.Context // used by basic auth, api keys and potentially jwt auth list.Items = append(list.Items, "Authorization") + // remove X-Grafana-Device-Id as it is only used for auth in authn clients. + list.Items = append(list.Items, "X-Grafana-Device-Id") + // if jwt is enabled we add it to the list. We can ignore in case it is set to Authorization if cfg.JWTAuthEnabled && cfg.JWTAuthHeaderName != "" && cfg.JWTAuthHeaderName != "Authorization" { list.Items = append(list.Items, cfg.JWTAuthHeaderName)