This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #4 + various changes in dynamic node handling
- Loading branch information
Showing
22 changed files
with
154 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name" : "node1", | ||
"name" : "default", | ||
"kong_admin_ip": "127.0.0.1", | ||
"kong_admin_port": "8001", | ||
"active": true | ||
}, | ||
{ | ||
"id": 2, | ||
"name" : "node2", | ||
"kong_admin_ip": "192.168.1.116", | ||
"kong_admin_port": "8183", | ||
"active": true | ||
"active": false | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ | |
*/ | ||
config.data.token = token; | ||
config.headers.authorization = 'Bearer ' + token; | ||
|
||
|
||
} | ||
|
||
return config; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Auth interceptor for HTTP and Socket request. This interceptor will add required | ||
* JWT (Json Web Token) token to each requests. That token is validated in server side | ||
* application. | ||
* | ||
* @see http://angular-tips.com/blog/2014/05/json-web-tokens-introduction/ | ||
* @see http://angular-tips.com/blog/2014/05/json-web-tokens-examples/ | ||
*/ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('frontend.core.interceptors') | ||
.factory('KongaInterceptor', [ | ||
'$q', '$injector', '$localStorage', | ||
function( | ||
$q, $injector, $localStorage | ||
) { | ||
return { | ||
/** | ||
* Interceptor method for $http requests. Main purpose of this method is to add JWT token | ||
* to every request that application does. | ||
* | ||
* @param {*} config HTTP request configuration | ||
* | ||
* @returns {*} | ||
*/ | ||
request: function requestCallback(config) { | ||
|
||
var konga_node_id = ''; | ||
|
||
// Yeah we have some user data on local storage | ||
if ($localStorage.credentials) { | ||
konga_node_id = $localStorage.credentials.user.node_id | ||
} | ||
|
||
config.headers['kong-admin-url'] = konga_node_id; | ||
|
||
return config; | ||
} | ||
}; | ||
} | ||
]) | ||
; | ||
}()); |
Oops, something went wrong.