Skip to content
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

Add endpoint to webapi to generate DB join token #10914

Merged
merged 20 commits into from
Mar 14, 2022

Conversation

mcbattirola
Copy link
Contributor

@mcbattirola mcbattirola commented Mar 7, 2022

The purpose of this PR is to add a new endpoint that creates DB join tokens in the web API.

To simplify DB manual steps, we want to have a join token on the web UI, so the user doesn't have to generate it via tctl tokens add --type=db.

There is already an endpoint to get a join token to apps and nodes, now we're adding it for databases.

Changes:

  • new endpoint /webapi/databases/token
  • rename createScriptJoinToken to createJoinToken, since it just returns a token, without relation to any script necessarily
  • createJoinToken now receives a list of roles to create tokens to, instead of always creating for app and node

Here is the PR on gravitational/webapps that consumes this endpoint: gravitational/webapps#653

Part of #10340

@github-actions github-actions bot requested review from fspmarshall and lxea March 7, 2022 18:01
@mcbattirola mcbattirola changed the title Matheus/simplify manual db join Add endpoint to webapi to generate DB join toksn Mar 7, 2022
@mcbattirola mcbattirola changed the title Add endpoint to webapi to generate DB join toksn Add endpoint to webapi to generate DB join token Mar 7, 2022
lib/web/apiserver.go Outdated Show resolved Hide resolved
Copy link
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay.

lib/web/join_tokens.go Show resolved Hide resolved
lib/web/apiserver.go Outdated Show resolved Hide resolved
lib/web/join_tokens.go Outdated Show resolved Hide resolved
@mcbattirola mcbattirola requested a review from hatched March 11, 2022 15:11
@mcbattirola
Copy link
Contributor Author

@codingllama @zmb3
Hey folks,
I've added in this commit the new endpoint to token generation and removed createDatabaseJoinTokenHandle.

PTAL, thanks

lib/web/apiserver.go Outdated Show resolved Hide resolved
@mcbattirola mcbattirola merged commit a73bcc4 into master Mar 14, 2022
@mcbattirola mcbattirola deleted the matheus/simplify-manual-db-join branch March 14, 2022 19:18
mcbattirola added a commit that referenced this pull request Mar 18, 2022
* Add endpoint to generate join tokens with any roles
mcbattirola added a commit that referenced this pull request Mar 18, 2022
* Add endpoint to generate join tokens with any roles
@russjones russjones added the cloud Cloud label Mar 18, 2022
mcbattirola added a commit that referenced this pull request Mar 23, 2022
* Add endpoint to generate join tokens with any roles
mcbattirola added a commit that referenced this pull request Mar 23, 2022
* Add endpoint to generate join tokens with any roles
@webvictim webvictim mentioned this pull request Apr 19, 2022
@webvictim webvictim mentioned this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud Cloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants