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.
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
Native Login method for Go client #12796
Native Login method for Go client #12796
Changes from 17 commits
cb638e5
f62007f
4b56a1b
0a93b48
3649428
4fd0d35
f68182f
61ce205
81d104c
c20b118
fa24af1
ae75ce6
8b435a7
9b3b833
7dfe2a9
be26874
8f54369
8516130
73f02a8
0233ede
090730c
23859a1
1ef3949
a6af8d8
ffa0fac
2e574c0
d0fa46e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we also attach any
X-Vault-State
headers we get back here? That way we by default cover any eventual consistency issues? cc @ncabatoffThere 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.
It'll be cumbersome to do this using the callbacks as they are now: we'd need Login to return a new Client that contains a request callback to set the header.
There are two easier options available to users: if the Vault is 1.9+, do nothing and rely on index bearing tokens. Otherwise, they can create a client with ReadYourWrites enabled. The catch with the latter is if we encourage people to use that at login time, they're probably not going to turn it off afterwards, and we don't everyone running with that setting enabled due to the performance implications.
So maybe we add another special-purpose Client field that stores the state resulting from the login, and then we blindly add an index request header in RawRequestWithContext for that state, e.g. here. Vault is happy to accept multiple index request headers, so this shouldn't interact badly with the existing index request header mechanisms. The new Client field should be copied by Clone.
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 seems to be out of the scope of this PR so I'll go ahead and create a new task on the devex team's Jira to track this.