Skip to content

Commit

Permalink
Merge pull request cli#4189 from cuonglm/issue-4188
Browse files Browse the repository at this point in the history
Disable auth for cobra shell request completion hidden commands
  • Loading branch information
mislav authored Aug 24, 2021
2 parents a94cadc 6cf6bb4 commit 355d281
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmdutil/auth_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 34,11 @@ func CheckAuth(cfg config.Config) bool {
}

func IsAuthCheckEnabled(cmd *cobra.Command) bool {
if cmd.Name() == "help" {
switch cmd.Name() {
case "help", cobra.ShellCompRequestCmd, cobra.ShellCompNoDescRequestCmd:
return false
}

for c := cmd; c.Parent() != nil; c = c.Parent() {
if c.Annotations != nil && c.Annotations["skipAuthCheck"] == "true" {
return false
Expand Down

0 comments on commit 355d281

Please sign in to comment.