Personal git tokens 🪪
Description
Personal git tokens allow every user to add one or more git credentials in Brainboard to be able to do pull requests.
Pull requests initiated by the user will use the credential specified with its associated scope in a way that you can track who does which pull request.
If you use Github, refer to this page to setup Github app integration.
Supported git providers
Gitlab
To add Gitlab personal git tokens in Brainboard, you first need to generate Gitlab access token.
Steps to generate a personal token on your Gitlab account.
- Go to your Gitlab personal tokens page.
- Add a name and specify
API
rights, then click onCreate personal access token
button: - The token is generated, you can copy it to add to Brainboard:
To add the generated token in Brainboard:
- Go to personal git tokens settings page:
- Click on Gitlab row, then click on the
plus
button location on the right: - Add your credentials in the displayed window:
- Name of the token. This is only for Brainboard, it will not be used when you do a pull request.
- The URL of your Gitlab server: by default Brainboard uses
https://gitlab.com
but if you have a private Gitlab instance accessible through internet or if you use a single-tenant Brainboard offering you can specify a different URL. - Token: the token (secret) generated from your Gitlab account.
- Then click on
Submit
button. - Brainboard will verify if the credentials are valid. If they are not, you'll receive this error:
- If the token is valid, you'll now configure the scope associated to it:
- Click on
Submit
button to save the configuration.
Azure DevOps
To add Azure DevOps personal git tokens in Brainboard, you first need to generate Azure DO personal access token.
Steps to generate a personal access token on your Azure DO account.
- Go to your Azure DO page.
- Click on the icon on the top right, then click on the option
Personal access tokens
: - It will open the page of access tokens. Click on
New token
button. - In the menu, add the following information:
- Name of the token.
- You can set an expiration date.
- In the
code
section, selectFull
- The token is generated, you can copy it to add to Brainboard:
To add the generated token in Brainboard:
- Go to personal git tokens settings page:
- Click on Azure DevOps row, then click on the
plus
button location on the right: - Add your credentials in the displayed window:
- Name of the token. This is only for Brainboard, it will not be used when you do a pull request.
- The URL of your Azure DevOps organization.
- To get this URL, the simplest way is to click on
Azure DevOps
on the top-left button then copy the URL of the browser
- To get this URL, the simplest way is to click on
- Token: the token (secret) generated from your Azure DO account.
- Then click on
Submit
button. - Brainboard will verify if the credentials are valid. If they are not, you'll receive this error:
- If the token is valid, you'll now configure the scope associated to it:
- Click on
Submit
button to save the configuration.
Bitbucket
To add Bitbucket personal app password in Brainboard, you first need to generate it in your Bitbucket account.
Steps to generate a personal app password on your Bitbucket account.
- Go to your Bitbucket app passwords page.
- Click on the icon on the top right, then click on the option
Personal settings
:- Got to
App passwords
accessible from the left bar options. - Click on
Create app password
.
- Got to
- Add a name and grant
read-write
access for:- Projects.
- Repositories.
- Pull requests.
- The token is generated, you can copy it to add to Brainboard:
To add the generated token in Brainboard:
- Go to personal git tokens settings page:
- Click on Bitbucket row, then click on the
plus
button location on the right: - Add your credentials in the displayed window:
- Name of the token. This is only for Brainboard, it will not be used when you do a pull request.
- The URL of your Bitbucket server: by default Brainboard uses
https://api.bitbucket.org/2.0
but you can set your own URL. - Username: this is
not
your email. You get it from your personal Bitbucket account settings. - Password: the app password generated from your Bitbucket account.
- Then click on
Submit
button. - Brainboard will verify if the credentials are valid. If they are not, you'll receive this error:
- If the token is valid, you'll now configure the scope associated to it:
- Click on
Submit
button to save the configuration.
Git token scope
Brainboard allows you to specify where a git token will be used by setting its scope. This provides you with fine grain flexibility when managing tokens and separating concerns.
So, when you add a personal git token, you can specify in which project, environment or architecture it will be used. This is what is called setting the scope
of the credentials.
To change the scope of the token:
- Go to personal git tokens settings page:
- Hover the token row you want to change, and click on the
Change the scope of the credential
button: - Choose from the list of the projects, environments and architectures displayed where you want this credential to be used
Edit token
To edit a personal git token:
- Hover the token row you want to change, and click on the
Edit the credential
button: - Change the information of the credential, then click on
Submit
button to save the changes.
Delete token
To delete a personal git token:
- Hover the token row you want to change, and click on the
Delete the credential
button: - You'll be prompted to confirm your action. If you click on
Delete
button, the credential will be permanently deleted.
Best practices
- It is a best practice to define at least one default git credential.
- To do it, click on the toggle
Default credentials for all your organization
:
- To do it, click on the toggle
- Always set an expiration date for your personal git tokens on your git provider.
- When you rotate your personal git tokens, don't delete and add new ones in Brainboard but edit them to only change the token.
Every token in Brainboard has a unique identifier, so updating any credential will not affect its scope.