Add ability to store refresh token into a secrets plugin #107
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.
Overview
This PR adds configuration options to store a received refresh_token into the given path in vault. It has been tested with the Puppet Labs oauthapp vault plugin and the corresponding pull request that accepts the refresh token.
These options make it possible for a user to authenticate with vault once and from then on be able to get access tokens from the OIDC provider via the secrets plugin. This is needed by the High Energy Physics science community as they migrate their global computing from X.509 certificates to OIDC tokens.
Design of Change
The role configuration option
refresh_store_path
can be set to specify a vault path to write into. The path may contain any claim names from the id_token surrounded by double curly brackets (for example "{{email}}", which are replaced by the value of the claim. The role configuration optionrefresh_store_cred
should contain a vault token with sufficient privileges to write to the path, or the token set in the environment variable VAULT_TOKEN.Related Issues/Pull Requests
Addresses issue #101.
Contributor Checklist
I will write the docs if this PR is otherwise deemed acceptable.
[ ] Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet
[ ] Add output for any tests not ran in CI to the PR description (eg, acceptance tests)
[x] Backwards compatible