-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistent consul secrets parameter names #15400
Conversation
After taking more time to consider the UX with these changes yesterday, I am backtracking on which parameters could be changed to feel "consistent". I also made a mistake with TTL.
The current changes in the PR now are:
With this implementation, Vault will accept Consul policies via either name |
… remove double ttl value from role read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good! I agree with your assessment of the various fields in the comment. Left a few small suggestions.
…_type, add to policies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looking good! Should we add some unit tests to cover the new fields?
* Add "consul_policies" parameter and deprecate "policies" parameter * Update tests and remove superfluous log statements
Description
With the Consul secrets engine improvements, several new parameters were added. Roles for example, but since Vault uses the term roles already, the parameter was named
consul_roles
. Similarly, the parameter for Consul namespaces was namedconsul_namespace
. For example:$ vault write consul/roles/my-role consul_roles="role1"
and
$ vault write -namespace="ns1" consul/roles/my-role consul_namespace="ns2"
This has created an inconsistent naming convention for the parameters. A counterexample to the above is policies, as both Consul and Vault use them, yet the parameter is simply named
policies
without the "consul_" prefix:$ vault write consul/roles/my-role policies="global-management"
Solution
We could consider renaming the parameters to be consistent, and if so decide which parameters would get renamed.
This draft PR changes most of the remaining parameters for configuring Vault roles to use with Consul. They are listed below:
local
->consul_local
policies
->consul_policies
partition
->consul_partition
ttl
->consul_ttl
max_ttl
->consul_max_ttl
service_identities
->consul_service_identities
node_identities
->consul_node_identities
As you can see, some of these become particularly long-winded which may not be good UX:
$ vault write consul/roles/my-role consul_local=true consul_ttl=1h consul_max_ttl=2h consul_service_identities="myserv-1:dc1"
Perhaps only a subset of these could be changed yet still make it feel more consistent?