-
Notifications
You must be signed in to change notification settings - Fork 387
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
Add method to set the default issuer #1198
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Stephan Austermühle <[email protected]>
Signed-off-by: Stephan Austermühle <[email protected]>
Signed-off-by: Stephan Austermühle <[email protected]>
Signed-off-by: Stephan Austermühle <[email protected]>
@@ -798,6 +798,30 @@ def list_issuers(self, mount_point=DEFAULT_MOUNT_POINT): | |||
url=api_path, | |||
) | |||
|
|||
def set_issuers(self, params, mount_point=DEFAULT_MOUNT_POINT): |
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.
This method should be probably be named set_issuers_configuration
since it corresponds to that API: https://developer.hashicorp.com/vault/api-docs/secret/pki#set-issuers-configuration
We also don't want to take a generic params
parameter. Instead we should accept a parameter called default
(or maybe default_issuer
to be more specific), and a default_follows_latest_issuer
parameter so that these can be validated and documented properly.
The tests should then reflect these changes and test for success and failure conditions.
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.
Using set_issuers_configuration
vs. set_issuers
is somewhat inconsistent with list_issuers
(titled Read issuers configuration in the API docs, by the way).
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.
default_follows_latest_issuer
is optional in the HTTP API. Taking it as an argument with an implicit default would probably unintentionally change the configured value.
This reverts commit 5f19830.
Add the missing method
hvac.api.secrets_engines.pki.set_issuers()
to configure the default PKI issuer.Fixes #1197