Skip to content

Commit f737d06

Browse files
make only root commands by default requiresAuth true (#271)
1 parent ae79afc commit f737d06

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

lib/interface/cli/Command.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ class Command {
1111
this.root = command.root;
1212
delete command.root;
1313

14-
this.requiresAuthentication = command.hasOwnProperty('requiresAuthentication') ? command.requiresAuthentication : true;
14+
if (command.hasOwnProperty('requiresAuthentication')) {
15+
this.requiresAuthentication = command.requiresAuthentication;
16+
} else if (this.root) {
17+
this.requiresAuthentication = true;
18+
}
19+
1520
this.betaCommand = command.betaCommand || false;
1621
this.onPremCommand = command.onPremCommand || false;
1722

lib/interface/cli/commands/cli-config/cli-config.cmd.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const { outputCliConfig } = require('../../helpers/cli-config');
77
const cliConfig = new Command({
88
root: true,
99
command: 'cli-config',
10+
requiresAuthentication: false,
1011
description: 'Codefresh CLI configuration. Uses profiles',
1112
usage: 'CLI configuration is used for user-specific properties, for example pretty-print',
1213
category: 'cli config',

lib/interface/cli/commands/completion/completion.cmd.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function _generateCompletionScript(appPath, appName, completionCommand, shell) {
2121
const command = new Command({
2222
root: true,
2323
command: 'completion [shell-name]',
24+
requiresAuthentication: false,
2425
aliases: ['completions'],
2526
description: 'Generate codefresh completion',
2627
usage: 'Prints completion script with specified or default path to executable and command alias',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.10.1",
3+
"version": "0.10.2",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)