Typo in Visibility + Add accepted values in Description (#4638)

This commit is contained in:
Martin 2018-05-25 19:39:35 +02:00 committed by Jeff Mitchell
parent fa372dc1ae
commit a259c16c8b
2 changed files with 23 additions and 23 deletions

View File

@ -2092,7 +2092,7 @@ func (b *SystemBackend) handleTuneWriteCommon(ctx context.Context, path string,
if rawVal, ok := data.GetOk("listing_visibility"); ok { if rawVal, ok := data.GetOk("listing_visibility"); ok {
lvString := rawVal.(string) lvString := rawVal.(string)
listingVisibility := ListingVisiblityType(lvString) listingVisibility := ListingVisibilityType(lvString)
if err := checkListingVisibility(listingVisibility); err != nil { if err := checkListingVisibility(listingVisibility); err != nil {
return logical.ErrorResponse(fmt.Sprintf("invalid listing_visibility %s", listingVisibility)), nil return logical.ErrorResponse(fmt.Sprintf("invalid listing_visibility %s", listingVisibility)), nil
@ -3744,7 +3744,7 @@ func sanitizeMountPath(path string) string {
return path return path
} }
func checkListingVisibility(visibility ListingVisiblityType) error { func checkListingVisibility(visibility ListingVisibilityType) error {
switch visibility { switch visibility {
case ListingVisibilityHidden: case ListingVisibilityHidden:
case ListingVisibilityUnauth: case ListingVisibilityUnauth:
@ -4341,7 +4341,7 @@ This path responds to the following HTTP methods.
"This function can be used to generate high-entropy random bytes.", "This function can be used to generate high-entropy random bytes.",
}, },
"listing_visibility": { "listing_visibility": {
"Determines the visibility of the mount in the UI-specific listing endpoint.", "Determines the visibility of the mount in the UI-specific listing endpoint. Accepted value are 'unauth' and ''.",
"", "",
}, },
"passthrough_request_headers": { "passthrough_request_headers": {

View File

@ -41,14 +41,14 @@ const (
mountTableType = "mounts" mountTableType = "mounts"
) )
// ListingVisiblityType represents the types for listing visilibity // ListingVisibilityType represents the types for listing visibility
type ListingVisiblityType string type ListingVisibilityType string
const ( const (
// ListingVisibilityHidden is the hidden type for listing visibility // ListingVisibilityHidden is the hidden type for listing visibility
ListingVisibilityHidden ListingVisiblityType = "" ListingVisibilityHidden ListingVisibilityType = ""
// ListingVisibilityUnauth is the unauth type for listing visibility // ListingVisibilityUnauth is the unauth type for listing visibility
ListingVisibilityUnauth ListingVisiblityType = "unauth" ListingVisibilityUnauth ListingVisibilityType = "unauth"
) )
var ( var (
@ -194,26 +194,26 @@ type MountEntry struct {
// MountConfig is used to hold settable options // MountConfig is used to hold settable options
type MountConfig struct { type MountConfig struct {
DefaultLeaseTTL time.Duration `json:"default_lease_ttl" structs:"default_lease_ttl" mapstructure:"default_lease_ttl"` // Override for global default DefaultLeaseTTL time.Duration `json:"default_lease_ttl" structs:"default_lease_ttl" mapstructure:"default_lease_ttl"` // Override for global default
MaxLeaseTTL time.Duration `json:"max_lease_ttl" structs:"max_lease_ttl" mapstructure:"max_lease_ttl"` // Override for global default MaxLeaseTTL time.Duration `json:"max_lease_ttl" structs:"max_lease_ttl" mapstructure:"max_lease_ttl"` // Override for global default
ForceNoCache bool `json:"force_no_cache" structs:"force_no_cache" mapstructure:"force_no_cache"` // Override for global default ForceNoCache bool `json:"force_no_cache" structs:"force_no_cache" mapstructure:"force_no_cache"` // Override for global default
PluginName string `json:"plugin_name,omitempty" structs:"plugin_name,omitempty" mapstructure:"plugin_name"` PluginName string `json:"plugin_name,omitempty" structs:"plugin_name,omitempty" mapstructure:"plugin_name"`
AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" structs:"audit_non_hmac_request_keys" mapstructure:"audit_non_hmac_request_keys"` AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" structs:"audit_non_hmac_request_keys" mapstructure:"audit_non_hmac_request_keys"`
AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" structs:"audit_non_hmac_response_keys" mapstructure:"audit_non_hmac_response_keys"` AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" structs:"audit_non_hmac_response_keys" mapstructure:"audit_non_hmac_response_keys"`
ListingVisibility ListingVisiblityType `json:"listing_visibility,omitempty" structs:"listing_visibility" mapstructure:"listing_visibility"` ListingVisibility ListingVisibilityType `json:"listing_visibility,omitempty" structs:"listing_visibility" mapstructure:"listing_visibility"`
PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" structs:"passthrough_request_headers" mapstructure:"passthrough_request_headers"` PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" structs:"passthrough_request_headers" mapstructure:"passthrough_request_headers"`
} }
// APIMountConfig is an embedded struct of api.MountConfigInput // APIMountConfig is an embedded struct of api.MountConfigInput
type APIMountConfig struct { type APIMountConfig struct {
DefaultLeaseTTL string `json:"default_lease_ttl" structs:"default_lease_ttl" mapstructure:"default_lease_ttl"` DefaultLeaseTTL string `json:"default_lease_ttl" structs:"default_lease_ttl" mapstructure:"default_lease_ttl"`
MaxLeaseTTL string `json:"max_lease_ttl" structs:"max_lease_ttl" mapstructure:"max_lease_ttl"` MaxLeaseTTL string `json:"max_lease_ttl" structs:"max_lease_ttl" mapstructure:"max_lease_ttl"`
ForceNoCache bool `json:"force_no_cache" structs:"force_no_cache" mapstructure:"force_no_cache"` ForceNoCache bool `json:"force_no_cache" structs:"force_no_cache" mapstructure:"force_no_cache"`
PluginName string `json:"plugin_name,omitempty" structs:"plugin_name,omitempty" mapstructure:"plugin_name"` PluginName string `json:"plugin_name,omitempty" structs:"plugin_name,omitempty" mapstructure:"plugin_name"`
AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" structs:"audit_non_hmac_request_keys" mapstructure:"audit_non_hmac_request_keys"` AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" structs:"audit_non_hmac_request_keys" mapstructure:"audit_non_hmac_request_keys"`
AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" structs:"audit_non_hmac_response_keys" mapstructure:"audit_non_hmac_response_keys"` AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" structs:"audit_non_hmac_response_keys" mapstructure:"audit_non_hmac_response_keys"`
ListingVisibility ListingVisiblityType `json:"listing_visibility,omitempty" structs:"listing_visibility" mapstructure:"listing_visibility"` ListingVisibility ListingVisibilityType `json:"listing_visibility,omitempty" structs:"listing_visibility" mapstructure:"listing_visibility"`
PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" structs:"passthrough_request_headers" mapstructure:"passthrough_request_headers"` PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" structs:"passthrough_request_headers" mapstructure:"passthrough_request_headers"`
} }
// Clone returns a deep copy of the mount entry // Clone returns a deep copy of the mount entry