Skip to content

Commit

Permalink
Fix tuning visibility in CLI (#4827)
Browse files Browse the repository at this point in the history
The API elides the value if it's empty, but empty has meaning. This adds
"hidden" as an option which is fundamentally identical to the default.
  • Loading branch information
jefferai authored and vishalnayak committed Jul 2, 2018
1 parent f2fb469 commit 24c7761
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -3709,6 +3709,7 @@ func sanitizeMountPath(path string) string {

func checkListingVisibility(visibility ListingVisibilityType) error {
switch visibility {
case ListingVisibilityDefault:
case ListingVisibilityHidden:
case ListingVisibilityUnauth:
default:
Expand Down
4 changes: 3 additions & 1 deletion vault/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ const (
type ListingVisibilityType string

const (
// ListingVisibilityDefault is the default value for listing visibility
ListingVisibilityDefault ListingVisibilityType = ""
// ListingVisibilityHidden is the hidden type for listing visibility
ListingVisibilityHidden ListingVisibilityType = ""
ListingVisibilityHidden ListingVisibilityType = "hidden"
// ListingVisibilityUnauth is the unauth type for listing visibility
ListingVisibilityUnauth ListingVisibilityType = "unauth"
)
Expand Down
8 changes: 5 additions & 3 deletions website/source/api/system/mounts.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ This endpoint enables a new secrets engine at the given path.
that will not be HMAC'd by audit devices in the response data object.

- `listing_visibility` `(string: "")` - Speficies whether to show this mount
in the UI-specific listing endpoint.
in the UI-specific listing endpoint. Valid values are `"unauth"` or
`"hidden"`. If not set, behaves like `"hidden"`.

- `passthrough_request_headers` `(array: [])` - Comma-separated list of headers
to whitelist and pass from the request to the backend.
Expand Down Expand Up @@ -229,8 +230,9 @@ This endpoint tunes configuration parameters for a given mount point.
list of keys that will not be HMAC'd by audit devices in the response data
object.

- `listing_visibility` `(string: "")` - Speficies whether to show this mount
in the UI-specific listing endpoint. Valid values are `"unauth"` or `""`.
- `listing_visibility` `(string: "")` - Speficies whether to show this mount in
the UI-specific listing endpoint. Valid values are `"unauth"` or `"hidden"`.
If not set, behaves like `"hidden"`.

- `passthrough_request_headers` `(array: [])` - Comma-separated list of headers
to whitelist and pass from the request to the backend.
Expand Down

0 comments on commit 24c7761

Please sign in to comment.