Skip to content

Commit

Permalink
Merge pull request #152 from Cox-Automotive/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
webbbarker authored Jun 18, 2020
2 parents d877af8 + 7baa72f commit 08ac57a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
★ Release Notes: 2020-05-20
★ Release Notes: 2020-06-17
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Thanks for upgrading to the latest version of the ALKS CLI!

→ Updated README.md to include `-o` and `-u` documentation
→ Normalized the "expires" field when working with sessions
→ [BUGFIX] Corrects an issue where the ALKS sessions command would return expired keys

→ Have feedback? https://github.com/Cox-Automotive/ALKS-CLI/issues

Expand Down
6 changes: 3 additions & 3 deletions lib/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ exports.addKey = function(accessKey, secretKey, sessionToken, alksAccount, alksR
alksAccount: encrypt(alksAccount, enc),
alksRole: encrypt(alksRole, enc),
isIAM: isIAM,
expires: expires
expires: expires.toDate()
});

db.save(function(err, data){
Expand All @@ -141,11 +141,11 @@ exports.addKey = function(accessKey, secretKey, sessionToken, alksAccount, alksR

exports.getKeys = function(auth, isIAM, callback){
getKeysCollection(function(err, keys){
var now = new Date().getTime(),
var now = moment(),
enc = auth.token || auth.password;

// first delete any expired keys
keys.removeWhere({ expires : { '$lte': now } });
keys.removeWhere({ expires : { '$lte': now.toDate() } });
// save the db to prune expired keys, wait for transaction to complete
db.save(function(){
// now get valid keys, decrypt their values and return
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alks",
"version": "3.0.8",
"version": "3.0.9",
"description": "CLI for working with ALKS",
"main": "bin/alks",
"scripts": {
Expand Down

0 comments on commit 08ac57a

Please sign in to comment.