Skip to content

Commit

Permalink
Merge pull request #131 from Cox-Automotive/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
webbbarker committed Feb 12, 2020
2 parents 8f0a888 + 1fcd026 commit de622cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,4 @@ ALKS CLI will output in a variety of formats, it uses the developer default (set
* `fishshell`: Outputs environment variables for Fishshell
* `terraformenv`: Outputs environment variables prefixed with `ALKS`
* `terraformarg`: Outputs environment arguments to pass to a Docker run call prefixed with `ALKS`
* `aws`: Outputs environment arguments to pass to AWS [docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html)
Empty file modified bin/alks-iam-createtrustrole
100644 → 100755
Empty file.
13 changes: 11 additions & 2 deletions lib/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function updateCreds(key, profile, force){

exports.addKey = function(accessKey, secretKey, sessionToken, alksAccount, alksRole, expires, auth, isIAM, callback){
var enc = auth.token || auth.password;

getKeysCollection(function(err, keys){
keys.insert({
accessKey: encrypt(accessKey, enc),
Expand Down Expand Up @@ -260,7 +260,16 @@ exports.getKeyOutput = function(format, key, profile, force){
cmd, ' AWS_SECRET_ACCESS_KEY=', key.secretKey, ' && ',
cmd, ' AWS_SESSION_TOKEN=', key.sessionToken, ' && ',
cmd, ' AWS_SESSION_EXPIRES=', keyExpires
].join('');
].join('');
}
else if(format === 'aws'){
return JSON.stringify({
'Version': 1,
'AccessKeyId': key.accessKey,
'SecretAccessKey': key.secretKey,
'SessionToken': key.sessionToken,
'Expiration': keyExpires
});
}
else{
var cmd = utils.isWindows() ? 'SET' : 'export';
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ exports.getFilePathInHome = function(filename){

exports.getOutputValues = function(){
// if adding new output types be sure to update keys.js:getKeyOutput
return [ 'env', 'json', 'docker', 'creds', 'idea', 'export', 'set', 'powershell', 'fishshell', 'terraformenv', 'terraformarg' ];
return [ 'env', 'json', 'docker', 'creds', 'idea', 'export', 'set', 'powershell', 'fishshell', 'terraformenv', 'terraformarg', 'aws' ];
};

exports.trim = function(str){
Expand Down

0 comments on commit de622cc

Please sign in to comment.