-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the bug
It looks as though the Sys.Capabilities*
related Go API methods only apply against 1 path; however, it looks as though the API moving forward expects paths
as an array. This currently works as the API is backwards compatible; however, the methods no longer align with the API.
func (c *Sys) CapabilitiesSelf(path string) ([]string, error)
func (c *Sys) CapabilitiesSelfWithContext(ctx context.Context, path string) ([]string, error)
func (c *Sys) Capabilities(token, path string) ([]string, error)
func (c *Sys) CapabilitiesWithContext(ctx context.Context, token, path string) ([]string, error)
func (c *Sys) CapabilitiesAccessor(accessor, path string) ([]string, error)
func (c *Sys) CapabilitiesAccessorWithContext(ctx context.Context, accessor, path string) ([]string, error)
To Reproduce
n/a: https://github.com/hashicorp/vault/blob/v1.20.1/api/sys_capabilities.go
Expected behavior
I would expect the Go API methods to match that which is expected of the API. Spec example (for /sys/capabilities-self
): https://developer.hashicorp.com/vault/api-docs/system/capabilities-self#sample-payload
Environment:
- Vault Server Version (retrieve with
vault status
): n/a (currentmain
, andv1.20.1
tag) - Vault CLI Version (retrieve with
vault version
): n/a - Server Operating System/Architecture: n/a
Additional context
Not sure if it's typical to break the client API module to keep it in sync with the API. If so, this would be a breaking change to correct it; otherwise, you'd have to maintain additional methods for all of the highlighted functions.