-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add token_auth_metadata field for built-in Auth methods #31327
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
Conversation
In case there are ENT only tests affected by these changes, I have created PR https://github.com/hashicorp/vault-enterprise/pull/8470. Moreover, I have created a suit of bats tests that cover token auth metadata definition all built-in Auth methods:
These tests are available in vault-tools (see PR https://github.com/hashicorp/vault-tools/pull/258). |
Build Results: |
CI Results: |
dd753de
to
f11f58f
Compare
In tokenutil.go, add support for generic Auth metadata: * Add a `TokenMetadata map[string]string` field to struct `TokenParams`. * Update method `ParseTokenFields` to populate the metadata field using request data. * Update method `PopulateTokenAuth` to add the metadata to field `Auth.Metadata`. * Update other helper methods.
f11f58f
to
61b8eaa
Compare
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.
Looks good to me, some nits but nothing I feel strongly about.
Doc updates will be handled using the new repo I assume?
Co-authored-by: Steven Clark <[email protected]>
Co-authored-by: Steven Clark <[email protected]>
Yes, the documentation changes will be in the new repository. |
@@ -273,6 +273,10 @@ can only be set during role creation and once set, it can't be reset later.`, | |||
Required: true, | |||
Description: "The maximum number of times a token may be used, a value of zero means unlimited", | |||
}, | |||
"token_auth_metadata": { |
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.
TODO: Make this call the helper method.
We have decided to take a slightly different approach, so I am closing this PR without merging. |
Description
Add token_auth_metadata field for built-in Auth methods.
In tokenutil.go, add support for generic Auth metadata:
Add a
TokenMetadata map[string]string
field to structTokenParams
.Update method
ParseTokenFields
to populate the metadata field using request data.Update method
PopulateTokenAuth
to add the metadata to fieldAuth.Metadata
.Update other helper methods.
The changes are described in RFC VLT-353.
Please note that external Auth methods and documentation updates will be addressed in separate pull requests.
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.
PCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.