diff --git a/pkg/api/pluginproxy/ds_proxy.go b/pkg/api/pluginproxy/ds_proxy.go index 0b0cd4ee79f..b861a344c75 100644 --- a/pkg/api/pluginproxy/ds_proxy.go +++ b/pkg/api/pluginproxy/ds_proxy.go @@ -180,9 +180,7 @@ func (proxy *DataSourceProxy) getDirector() func(req *http.Request) { func (proxy *DataSourceProxy) validateRequest() error { if proxy.ds.Type == m.DS_INFLUXDB { if proxy.ctx.Query("db") != proxy.ds.Database { - if !proxy.ds.JsonData.Get("allowDatabaseQuery").MustBool(false) { - return errors.New("Datasource is not configured to allow this database") - } + return errors.New("Datasource is not configured to allow this database") } } diff --git a/public/app/plugins/datasource/influxdb/datasource.ts b/public/app/plugins/datasource/influxdb/datasource.ts index 90337fdc3f2..8b213ca0f36 100644 --- a/public/app/plugins/datasource/influxdb/datasource.ts +++ b/public/app/plugins/datasource/influxdb/datasource.ts @@ -16,7 +16,6 @@ export default class InfluxDatasource { basicAuth: any; withCredentials: any; interval: any; - allowDatabaseQuery: boolean; supportAnnotations: boolean; supportMetrics: boolean; responseParser: any; @@ -35,7 +34,6 @@ export default class InfluxDatasource { this.basicAuth = instanceSettings.basicAuth; this.withCredentials = instanceSettings.withCredentials; this.interval = (instanceSettings.jsonData || {}).timeInterval; - this.allowDatabaseQuery = (instanceSettings.jsonData || {}).allowDatabaseQuery === true; this.supportAnnotations = true; this.supportMetrics = true; this.responseParser = new ResponseParser(); @@ -240,9 +238,6 @@ export default class InfluxDatasource { if (options && options.database) { params.db = options.database; - if (params.db !== this.database && !this.allowDatabaseQuery) { - return this.$q.reject({ message: 'This datasource does not allow changing database' }); - } } else if (this.database) { params.db = this.database; } diff --git a/public/app/plugins/datasource/influxdb/partials/config.html b/public/app/plugins/datasource/influxdb/partials/config.html index 4b861083928..a70a1de98a4 100644 --- a/public/app/plugins/datasource/influxdb/partials/config.html +++ b/public/app/plugins/datasource/influxdb/partials/config.html @@ -23,16 +23,24 @@ - + +
+
+
Database Access
+

+ Setting the database for this datasource does not deny access to other databases. The InfluxDB query syntax allows + switching the database in the query. For example: + SHOW MEASUREMENTS ON _internal or SELECT * FROM "_internal".."database" LIMIT 10 +

+ To support data isolation and security, make sure appropriate permissions are configured in InfluxDB. +

+
+
- Min time interval + Min time interval A lower limit for the auto group by time interval. Recommended to be set to write frequency,