-
Notifications
You must be signed in to change notification settings - Fork 2
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
Vault 28310 hvs integrations poc #125
base: main
Are you sure you want to change the base?
Conversation
The upside of this approach, is that we have no integration specific subcommands, and so our command structure is relatively uncluttered. The downsides of this approach, are that (a) we'll need to do some integration specific handling for now anyways in the CLI, and (b) without some additional backend changes to furnish a help blurb detailing the expected fields to fit into the The alternative to this approach, at least for integrations, would be one where integrations have their own bespoke subcommands like |
The config files in the screenshots are present in this PR, with the sensitive data parts being stubbed out. Another thing to keep in mind, is that with a config file approach we probably want to have some sort of templating support, so that data in env vars can be used easily in the files. |
Hmmm, this is interesting. Definitely seems like the approach where each integration type has its own subcommands would (a) be easier to document on the hcp cli docs page and (b) match to API endpoints better since there's one for each type. This would obviously be quite different from the standard CRUD operations across other command groups, but seems like it might be the most helpful for users. Would be interested in @dadgar opinion here. |
So two main thoughts:
|
This is a valid point, but i think we can assume we will have this API at some point. We can then add some helper commands to the CLI like:
|
Thanks everyone for the feedback!! @briankassouf ahh perfect, yeah if we have an API to support such help and sample config commands, that'll be awesome! For further followups around this work, I'll leave y'all in the very capable hands of @mercedesbh who'll take over here while i move on to PnP work. |
Changes proposed in this PR:
This PR shows one possible way that integrations support could be added to the CLI. The goal of this approach is to achieve this without having bespoke CLI subcommands for each integration type, instead having a generic CLI pattern into which integration specific details can be added in. The approach to support creating rotating secrets also follows a similar mentality and pattern.
For integration creation, a config file input is supported to a create subcommand, like
hcp vs integrations create --config-file=config.yaml
. The config file will contain atype
, based on which the CLI code will pick the endpoint to call and request params to parse out, aname
for the integration name, and adetails
struct containing details needed to create the integration.For rotating secret creation, a config file input is supported to a create-rotating subcommand, like
hcp vs secrets create-rotating --config-file=mongo-config.yaml
. The config file here also contains a type and name, alongside integration specific details, and adetails
field for any additional details needed to create the secret.The POC code and the 2 example config files, deal only with creating a mongodb rotationg integration, and a mongodb rotating secret. Below are screenshots showing how they can be used.
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: