Datasource: Prefix SigV4 json data keys with sigV4 (#28195)

Prefixes SigV4 json data and secure json data keys with sigV4 to make 
sure they don't collide with any other settings. Also minor fixes to UI.

Ref #27552
This commit is contained in:
Marcus Efraimsson
2020-10-12 17:52:17 +02:00
committed by GitHub
parent 7b5decdbb0
commit 519ec93c7d
2 changed files with 30 additions and 34 deletions

View File

@ -193,13 +193,13 @@ func (ds *DataSource) sigV4Middleware(next http.RoundTripper) http.RoundTripper
return &SigV4Middleware{
Config: &Config{
AccessKey: decrypted["accessKey"],
SecretKey: decrypted["secretKey"],
Region: ds.JsonData.Get("region").MustString(),
AssumeRoleARN: ds.JsonData.Get("assumeRoleArn").MustString(),
AuthType: ds.JsonData.Get("authType").MustString(),
ExternalID: ds.JsonData.Get("externalId").MustString(),
Profile: ds.JsonData.Get("profile").MustString(),
AccessKey: decrypted["sigV4AccessKey"],
SecretKey: decrypted["sigV4SecretKey"],
Region: ds.JsonData.Get("sigV4Region").MustString(),
AssumeRoleARN: ds.JsonData.Get("sigV4AssumeRoleArn").MustString(),
AuthType: ds.JsonData.Get("sigV4AuthType").MustString(),
ExternalID: ds.JsonData.Get("sigV4ExternalId").MustString(),
Profile: ds.JsonData.Get("sigV4Profile").MustString(),
},
Next: next,
}