Merge pull request #4189 from cuonglm/issue-4188
Disable auth for cobra shell request completion hidden commands
This commit is contained in:
commit
355d28195e
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue