mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
AC-654 Added 'X-Auth-Token' as a header in all requests. This will give the API a way to distinguish requests between UI an API Browser and invoke correct RBAC rules. Without this we run into a collision of sorts when user logs into UI and API Browser at the same time from the same browser.
This commit is contained in:
@@ -62,6 +62,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) {
|
|||||||
}
|
}
|
||||||
else if (token) {
|
else if (token) {
|
||||||
this.setHeader({ Authorization: 'Token ' + token });
|
this.setHeader({ Authorization: 'Token ' + token });
|
||||||
|
this.setHeader({ "X-Auth-Token": 'Token ' + token });
|
||||||
return $http({method: 'GET',
|
return $http({method: 'GET',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -80,6 +81,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) {
|
|||||||
}
|
}
|
||||||
else if (token) {
|
else if (token) {
|
||||||
this.setHeader({ Authorization: 'Token ' + token });
|
this.setHeader({ Authorization: 'Token ' + token });
|
||||||
|
this.setHeader({ "X-Auth-Token": 'Token ' + token });
|
||||||
return $http({
|
return $http({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
@@ -98,6 +100,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) {
|
|||||||
}
|
}
|
||||||
else if (token) {
|
else if (token) {
|
||||||
this.setHeader({ Authorization: 'Token ' + token });
|
this.setHeader({ Authorization: 'Token ' + token });
|
||||||
|
this.setHeader({ "X-Auth-Token": 'Token ' + token });
|
||||||
return $http({
|
return $http({
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
@@ -116,6 +119,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) {
|
|||||||
}
|
}
|
||||||
else if (token) {
|
else if (token) {
|
||||||
this.setHeader({ Authorization: 'Token ' + token });
|
this.setHeader({ Authorization: 'Token ' + token });
|
||||||
|
this.setHeader({ "X-Auth-Token": 'Token ' + token });
|
||||||
return $http({
|
return $http({
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
@@ -134,6 +138,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) {
|
|||||||
}
|
}
|
||||||
else if (token) {
|
else if (token) {
|
||||||
this.setHeader({ Authorization: 'Token ' + token });
|
this.setHeader({ Authorization: 'Token ' + token });
|
||||||
|
this.setHeader({ "X-Auth-Token": 'Token ' + token });
|
||||||
return $http({
|
return $http({
|
||||||
method: 'OPTIONS',
|
method: 'OPTIONS',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user