Add Access Request ID to response for UserContext#15653
Merged
Conversation
zmb3
reviewed
Aug 18, 2022
bc099e1 to
217c8a2
Compare
zmb3
approved these changes
Aug 19, 2022
Collaborator
zmb3
left a comment
There was a problem hiding this comment.
Approved with 2 minor suggestions.
33b9fb7 to
b5ffca4
Compare
kimlisa
reviewed
Aug 22, 2022
b5ffca4 to
2cade00
Compare
Contributor
Author
Changes:The |
zmb3
approved these changes
Aug 23, 2022
kimlisa
approved these changes
Aug 23, 2022
kimlisa
approved these changes
Aug 24, 2022
780b92f to
8f40df6
Compare
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.
Purpose
This PR resolves #14432
In the UI, when a user assumes a role from an approved access request, they need to include a
--request-idflag to thetsh logincommand in order to be able to connect to their desired resources via CLI. This was previously missing from the connection instructions shown in the UI, and led to confusion. This UX fix will automatically add the--request-idflag with the correct request ID to the connection instructions if the user is currently assuming a role from an access request.Implementation
When a request to extend a web session is made (when the user clicks "assume roles" on an access request in the UI), the access request ID that comes with the request is added to the newly created session under the field
assumedRoleRequestId.When the request is made to fetch Databases and Kubes, the
assumedRoleRequestIdis pulled from the session and included in the response so that it can be used by the UI and displayed in the connection instructions dialog.webapps counterpart PR: gravitational/webapps#1130