Backend plugins: Prepare and clean request headers before resource calls (#22321)

Moves common request proxy utilities to proxyutil package with
support for removing X-Forwarded-Host, X-Forwarded-Port,
X-Forwarded-Proto headers, setting X-Forwarded-For header
and cleaning Cookie header.
Using the proxyutil package to prepare and clean request
headers before resource calls.

Closes #21512
This commit is contained in:
Marcus Efraimsson
2020-03-03 11:45:16 +01:00
committed by GitHub
parent 8b122ee464
commit e6cec8dbdc
10 changed files with 225 additions and 160 deletions

View File

@ -1,10 +1,11 @@
package backendplugin
import (
"encoding/json"
"strconv"
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2"
)
@ -69,7 +70,7 @@ type PluginConfig struct {
OrgID int64
PluginID string
PluginType string
JSONData json.RawMessage
JSONData *simplejson.Json
DecryptedSecureJSONData map[string]string
Updated time.Time
DataSourceConfig *DataSourceConfig