Upgrade to Porter secret protocol v2 - #2
Open
carolynvs wants to merge 1 commit into
Open
Conversation
This updates the plugin to work with v2 of the secrets protocol, which adds support for context.Context and persisting secrets. While I was making these changes, I was having a hard time getting the paths to work (with respect to the data key). I have created a new struct Secret that manages where data should be read from and written to. * If the secret value itself uses subpaths, the subpath is used to resolve the secret location. The final path segment is the secret key. For example, if the path_prefix is myorg/myapp, and the parameter set's secret value is set to v1/mysql/connstr, the secret path is myorg/data/myapp/v1/mysql and the plugin returns the secret's connstr. * When writing secrets, we apply the PorterSecret configuration value as a suffix to the secret path. For example, if the path prefix is myorg/myapp, and we are saving a key named v1/mysql/connstr, the secret path is myorg/data/myapp/v1/mysql/PORTER_SECRET. If PorterSecret is not configured, we default it to "porter". Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Author
|
Until this changed it merged, you can install my patch for the plugin with the following command: I'm just using that fork temporarily so that people can install the plugin with the changes from this pull request. |
carolynvs
marked this pull request as ready for review
May 26, 2022 14:04
carolynvs
added a commit
to carolynvs/hashicorp-plugins
that referenced
this pull request
Oct 17, 2022
Remove publish to atom feed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the plugin to work with v2 of the secrets protocol, which adds support for context.Context and persisting secrets.
While I was making these changes, I was having a hard time getting the paths to work (with respect to the data key). I have created a new struct Secret that manages where data should be read from and written to.
If the secret value itself uses subpaths, the subpath is used to resolve the secret location. The final path segment is the secret key.
For example, if the path_prefix is myorg/myapp, and the parameter set's secret value is set to v1/mysql/connstr, the secret path is myorg/data/myapp/v1/mysql and the plugin returns the secret's connstr.
When writing secrets, we apply the PorterSecret configuration value as a suffix to the secret path.
For example, if the path prefix is myorg/myapp, and we are saving a key named v1/mysql/connstr, the secret path is myorg/data/myapp/v1/mysql/PORTER_SECRET. If PorterSecret is not configured, we default it to "porter".