Skip to content

Commit

Permalink
Fix description of StringSliceVar options (#14439)
Browse files Browse the repository at this point in the history
These options must be specified multiple times in order to be properly
parsed. However, the present description suggests that a comma-separated
list would work as well, however this isn't the case and results in a
slice containing a single string (with all comma-separated values) in
the API request. Clarify the argument help text to make this clearer.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
  • Loading branch information
cipherboy committed Mar 14, 2022
1 parent e7c238c commit f983879
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions command/auth_enable.go
Expand Up @@ -117,15 +117,15 @@ func (c *AuthEnableCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACRequestKeys,
Target: &c.flagAuditNonHMACRequestKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the request data object.",
Usage: "Key that will not be HMAC'd by audit devices in the request data object. " +
"To specify multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACResponseKeys,
Target: &c.flagAuditNonHMACResponseKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the response data object.",
Usage: "Key that will not be HMAC'd by audit devices in the response data object. " +
"To specify multiple values, specify this flag multiple times.",
})

f.StringVar(&StringVar{
Expand All @@ -137,15 +137,15 @@ func (c *AuthEnableCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNamePassthroughRequestHeaders,
Target: &c.flagPassthroughRequestHeaders,
Usage: "Comma-separated string or list of request header values that " +
"will be sent to the plugin",
Usage: "Request header value that will be sent to the plugin. To specify multiple " +
"values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAllowedResponseHeaders,
Target: &c.flagAllowedResponseHeaders,
Usage: "Comma-separated string or list of response header values that " +
"plugins will be allowed to set",
Usage: "Response header value that plugins will be allowed to set. To specify multiple " +
"values, specify this flag multiple times.",
})

f.StringVar(&StringVar{
Expand Down
16 changes: 8 additions & 8 deletions command/auth_tune.go
Expand Up @@ -62,15 +62,15 @@ func (c *AuthTuneCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACRequestKeys,
Target: &c.flagAuditNonHMACRequestKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the request data object.",
Usage: "Key that will not be HMAC'd by audit devices in the request data " +
"object. To specify multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACResponseKeys,
Target: &c.flagAuditNonHMACResponseKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the response data object.",
Usage: "Key that will not be HMAC'd by audit devices in the response data " +
"object. To specify multiple values, specify this flag multiple times.",
})

f.DurationVar(&DurationVar{
Expand Down Expand Up @@ -112,15 +112,15 @@ func (c *AuthTuneCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNamePassthroughRequestHeaders,
Target: &c.flagPassthroughRequestHeaders,
Usage: "Comma-separated string or list of request header values that " +
"will be sent to the plugin",
Usage: "Request header value that will be sent to the plugin. To specify " +
"multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAllowedResponseHeaders,
Target: &c.flagAllowedResponseHeaders,
Usage: "Comma-separated string or list of response header values that " +
"plugins will be allowed to set",
Usage: "Response header value that plugins will be allowed to set. To specify " +
"multiple values, specify this flag multiple times.",
})

f.StringMapVar(&StringMapVar{
Expand Down
16 changes: 8 additions & 8 deletions command/secrets_enable.go
Expand Up @@ -125,15 +125,15 @@ func (c *SecretsEnableCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACRequestKeys,
Target: &c.flagAuditNonHMACRequestKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the request data object.",
Usage: "Key that will not be HMAC'd by audit devices in the request data object. " +
"To specify multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACResponseKeys,
Target: &c.flagAuditNonHMACResponseKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the response data object.",
Usage: "Key that will not be HMAC'd by audit devices in the response data object. " +
"To specify multiple values, specify this flag multiple times.",
})

f.StringVar(&StringVar{
Expand All @@ -145,15 +145,15 @@ func (c *SecretsEnableCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNamePassthroughRequestHeaders,
Target: &c.flagPassthroughRequestHeaders,
Usage: "Comma-separated string or list of request header values that " +
"will be sent to the plugins",
Usage: "Request header value that will be sent to the plugins. To specify multiple " +
"values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAllowedResponseHeaders,
Target: &c.flagAllowedResponseHeaders,
Usage: "Comma-separated string or list of response header values that " +
"plugins will be allowed to set",
Usage: "Response header value that plugins will be allowed to set. To specify multiple " +
"values, specify this flag multiple times.",
})

f.BoolVar(&BoolVar{
Expand Down
16 changes: 8 additions & 8 deletions command/secrets_tune.go
Expand Up @@ -62,15 +62,15 @@ func (c *SecretsTuneCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACRequestKeys,
Target: &c.flagAuditNonHMACRequestKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the request data object.",
Usage: "Key that will not be HMAC'd by audit devices in the request data " +
"object. To specify multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAuditNonHMACResponseKeys,
Target: &c.flagAuditNonHMACResponseKeys,
Usage: "Comma-separated string or list of keys that will not be HMAC'd by audit " +
"devices in the response data object.",
Usage: "Key that will not be HMAC'd by audit devices in the response data " +
"object. To specify multiple values, specify this flag multiple times.",
})

f.DurationVar(&DurationVar{
Expand Down Expand Up @@ -112,15 +112,15 @@ func (c *SecretsTuneCommand) Flags() *FlagSets {
f.StringSliceVar(&StringSliceVar{
Name: flagNamePassthroughRequestHeaders,
Target: &c.flagPassthroughRequestHeaders,
Usage: "Comma-separated string or list of request header values that " +
"will be sent to the plugin",
Usage: "Request header value that will be sent to the plugin. To specify " +
"multiple values, specify this flag multiple times.",
})

f.StringSliceVar(&StringSliceVar{
Name: flagNameAllowedResponseHeaders,
Target: &c.flagAllowedResponseHeaders,
Usage: "Comma-separated string or list of response header values that " +
"plugins will be allowed to set",
Usage: "Response header value that plugins will be allowed to set. To " +
"specify multiple values, specify this flag multiple times.",
})

f.StringMapVar(&StringMapVar{
Expand Down

0 comments on commit f983879

Please sign in to comment.