Expose RoleSet.EnumerateDatabaseUsers to Teleport Terminal #12070
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.
The Web UI and Teleport Terminal show a list of allowed logins when the user click the "Connect" button next to a server.
We wish to display a similar list in Teleport Terminal for database users (gravitational/webapps.e#177).
I actually have a PoC implementation ready on the
ravicious/teleterm-db-users
branch of the webapps repo. The readme inpackages/teleterm
includes instructions on how to launch the dev version of Teleterm, but this PR is simple enough where I don't expect you to go through that process if you've never built Teleterm on your machine.Teleport.Terminal.database.users.mov
To do this, we're going to use
RoleSet.EnumerateDatabaseUsers
introduced in #10458. We need to add an RPC method to the tsh daemon service that returns a list of database users. Teleport Terminal will request this list only when the user actually clicks on the button.I considered fetching the list of allowed users together with the list of available databases. however we fetch cluster resources pretty often in Teleterm and I was worried that it might slow down this action if the cluster has a lot of databases.
This PR adds that RPC method so that Teleport Terminal can fetch the db users when needed.
The first commit updates proto files, so there's a lot of autogenerated code there.