mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Merge pull request #3892 from pfischermx/master
Allow the use of auth and credentials in opentsdb
This commit is contained in:
commit
2e20c680cb
@ -13,6 +13,8 @@ function (angular, _, dateMath) {
|
||||
this.type = 'opentsdb';
|
||||
this.url = instanceSettings.url;
|
||||
this.name = instanceSettings.name;
|
||||
this.withCredentials = instanceSettings.withCredentials;
|
||||
this.basicAuth = instanceSettings.basicAuth;
|
||||
this.supportMetrics = true;
|
||||
|
||||
// Called once per panel (graph)
|
||||
@ -71,6 +73,14 @@ function (angular, _, dateMath) {
|
||||
url: this.url + '/api/query',
|
||||
data: reqBody
|
||||
};
|
||||
if (this.basicAuth || this.withCredentials) {
|
||||
options.withCredentials = true;
|
||||
}
|
||||
if (this.basicAuth) {
|
||||
options.headers = {
|
||||
"Authorization": this.basicAuth
|
||||
};
|
||||
}
|
||||
|
||||
// In case the backend is 3rd-party hosted and does not suport OPTIONS, urlencoded requests
|
||||
// go as POST rather than OPTIONS+POST
|
||||
|
Loading…
Reference in New Issue
Block a user