Skip to content

Commit

Permalink
Fix auth tests (x-vault-token)
Browse files Browse the repository at this point in the history
  • Loading branch information
chelshaw committed Nov 12, 2020
1 parent 8f9b7b1 commit 89cb174
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions ui/app/services/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default Service.extend({
},

setCluster(clusterId) {
this.set('activeCluster', clusterId);
this.activeCluster = clusterId;
},

ajax(url, method, options) {
Expand Down Expand Up @@ -118,7 +118,7 @@ export default Service.extend({
let now = this.now();
const ttl = resp.ttl || resp.lease_duration;
const tokenExpirationEpoch = now + ttl * 1e3;
this.set('expirationCalcTS', now);
this.expirationCalcTS = now;
return {
ttl,
tokenExpirationEpoch,
Expand Down Expand Up @@ -194,8 +194,8 @@ export default Service.extend({
data.displayName = get(this.getTokenData(tokenName) || {}, 'displayName');
}
tokens.addObject(tokenName);
this.set('tokens', tokens);
this.set('allowExpiration', false);
this.tokens = tokens;
this.allowExpiration = false;
this.setTokenData(tokenName, data);
return resolve({
namespace: currentNamespace || data.userRootNamespace,
Expand Down Expand Up @@ -346,7 +346,7 @@ export default Service.extend({
deleteToken(tokenName) {
const tokenNames = this.tokens.without(tokenName);
this.removeTokenData(tokenName);
this.set('tokens', tokenNames);
this.tokens = tokenNames;
},

// returns the key for the token to use
Expand Down
8 changes: 4 additions & 4 deletions ui/tests/integration/services/auth-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ module('Integration | Service | auth', function(hooks) {
this.server = new Pretender(function() {
this.get('/v1/auth/token/lookup-self', function(request) {
let resp = copy(ROOT_TOKEN_RESPONSE, true);
resp.id = request.requestHeaders['x-vault-token'];
resp.data.id = request.requestHeaders['x-vault-token'];
resp.id = request.requestHeaders['X-Vault-Token'];
resp.data.id = request.requestHeaders['X-Vault-Token'];
return [200, {}, resp];
});
this.post('/v1/auth/userpass/login/:username', function(request) {
Expand Down Expand Up @@ -308,8 +308,8 @@ module('Integration | Service | auth', function(hooks) {
this.server.map(function() {
this.get('/v1/auth/token/lookup-self', function(request) {
let resp = copy(tokenResp, true);
resp.id = request.requestHeaders['x-vault-token'];
resp.data.id = request.requestHeaders['x-vault-token'];
resp.id = request.requestHeaders['X-Vault-Token'];
resp.data.id = request.requestHeaders['X-Vault-Token'];
return [200, {}, resp];
});
});
Expand Down

0 comments on commit 89cb174

Please sign in to comment.