mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
fix(influxdb): enforce database restriction, fixes #6352
This commit is contained in:
parent
401c67d136
commit
b32bbbd1a2
@ -95,6 +95,13 @@ func ProxyDataSourceRequest(c *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if ds.Type == m.DS_INFLUXDB {
|
||||
if c.Query("db") != ds.Database {
|
||||
c.JsonApiErr(403, "Datasource is not configured to allow this database", nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
targetUrl, _ := url.Parse(ds.Url)
|
||||
if len(setting.DataProxyWhiteList) > 0 {
|
||||
if _, exists := setting.DataProxyWhiteList[targetUrl.Host]; !exists {
|
||||
|
Loading…
Reference in New Issue
Block a user