api: remove create from auth-tokens help (#3341)
The auth-tokens help command included a reference to a non-existent auth-tokens create command. Replace the default help and also add a helpful pointer to the authenticate command.
This commit is contained in:
1 parent
103b1e78aa
commit
9474b373b8
5 files changed
+36
-7
No files matched your search
@@ -44,7 +44,6 @@ func (n AuthTokenReadResult) GetResponse() *api.Response {
|
||||
return n.response
|
||||
}
|
||||
|
||||
type AuthTokenCreateResult = AuthTokenReadResult
|
||||
type AuthTokenUpdateResult = AuthTokenReadResult
|
||||
|
||||
type AuthTokenDeleteResult struct {
|
||||
|
||||
@@ -486,7 +486,7 @@ var inputStructs = []*structInfo{
|
||||
listTemplate,
|
||||
},
|
||||
pluralResourceName: "auth-tokens",
|
||||
createResponseTypes: []string{CreateResponseType, ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType},
|
||||
createResponseTypes: []string{ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType},
|
||||
recursiveListing: true,
|
||||
},
|
||||
// Credentials
|
||||
|
||||
@@ -79,7 +79,7 @@ func (c *Command) Help() string {
|
||||
|
||||
default:
|
||||
|
||||
helpStr = helpMap["base"]()
|
||||
helpStr = c.extraHelpFunc(helpMap)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package authtokenscmd
|
||||
|
||||
import "github.com/hashicorp/boundary/internal/cmd/base"
|
||||
|
||||
func (c *Command) extraHelpFunc(helpMap map[string]func() string) string {
|
||||
var helpStr string
|
||||
switch c.Func {
|
||||
case "":
|
||||
return base.WrapForHelpText([]string{
|
||||
"Usage: boundary auth-tokens [sub command] [options] [args]",
|
||||
"",
|
||||
" This command allows operations on Boundary auth token resources. Example:",
|
||||
"",
|
||||
" List all auth tokens:",
|
||||
"",
|
||||
` $ boundary auth-tokens list -recursive `,
|
||||
"",
|
||||
" Please see the auth-tokens subcommand help for detailed usage information.",
|
||||
" Note: To create an auth token, see the authenticate subcommand.",
|
||||
})
|
||||
|
||||
default:
|
||||
helpStr = helpMap["base"]()
|
||||
}
|
||||
return helpStr
|
||||
}
|
||||
@@ -204,10 +204,11 @@ var inputStructs = map[string][]*cmdInfo{
|
||||
},
|
||||
"authtokens": {
|
||||
{
|
||||
ResourceType: resource.AuthToken.String(),
|
||||
Pkg: "authtokens",
|
||||
StdActions: []string{"read", "delete", "list"},
|
||||
Container: "Scope",
|
||||
ResourceType: resource.AuthToken.String(),
|
||||
Pkg: "authtokens",
|
||||
StdActions: []string{"read", "delete", "list"},
|
||||
HasExtraHelpFunc: true,
|
||||
Container: "Scope",
|
||||
},
|
||||
},
|
||||
"credentialstores": {
|
||||
|
||||
Reference in new issue
Block a user