Skip to content

Commit

Permalink
Provide option to specify token with upgradekvm
Browse files Browse the repository at this point in the history
  • Loading branch information
vilobhmm committed Dec 5, 2018
1 parent 41532e7 commit 67982a3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions cli/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ const setup = function setup() {
keyGenerator.revoke(options, (err) => {
err ? process.exit(1) : process.exit(0);
});
})
});

});

Expand All @@ -438,6 +438,7 @@ const setup = function setup() {
.option('-e, --env <env>', 'the environment')
.option('-u, --username <user>', 'username of the organization admin')
.option('-p, --password <password>', 'password of the organization admin')
.option('-t, --token <token>', 'OAuth token to use with management API')
.option('-v, --virtualhost <virtualhost>', 'virtual host of the proxy')
.option('-b, --baseuri <baseuri>', 'baseuri for management apis')
.description('upgrade kvm to support JWT Key rotation')
Expand All @@ -452,12 +453,19 @@ const setup = function setup() {
if (!options.env) {
return options.error('env is required');
}
promptForPassword(options, (options) => {
if (!options.password) {
return options.error('password is required');
}
if (options.token) {
upgradekvm.upgradekvm(options, () => {});
})
} else {
if (!options.username) {
return options.error('username is required');
}
promptForPassword(options, (options) => {
if (!options.password) {
return options.error('password is required');
}
upgradekvm.upgradekvm(options, () => {});
});
}
});

commander
Expand Down

0 comments on commit 67982a3

Please sign in to comment.