Skip to content

Commit 79697e0

Browse files
docs
1 parent 05c3d13 commit 79697e0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docs/docs/configuration/auth/providers.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ Optional environment variables:
5252

5353
[Auth.js GitLab Provider Docs](https://authjs.dev/getting-started/providers/gitlab)
5454

55+
Authentication using GitLab is supported via a [OAuth2.0 app](https://docs.gitlab.com/integration/oauth_provider/#create-an-instance-wide-application) installed on the GitLab instance. Follow the instructions in the [GitLab docs](https://docs.gitlab.com/integration/oauth_provider/) to create an app. The callback URL should be configurd to `<sourcebot_deployment_url>/api/auth/callback/gitlab`, and the following scopes need to be set:
56+
57+
| Scope | Required | Notes |
58+
|------------|----------|----------------------------------------------------------------------------------------------------|
59+
| read_user | Yes | Allows Sourcebot to read basic user information required for authentication. |
60+
| read_api | Conditional | Required **only** when [permission syncing](/docs/features/permission-syncing) is enabled. Enables Sourcebot to list all repositories and projects for the authenticated user. |
61+
62+
5563
**Required environment variables:**
5664
- `AUTH_EE_GITLAB_CLIENT_ID`
5765
- `AUTH_EE_GITLAB_CLIENT_SECRET`

docs/docs/features/permission-syncing.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We are actively working on supporting more code hosts. If you'd like to see a sp
3535
| Platform | Permission syncing |
3636
|:----------|------------------------------|
3737
| [GitHub (GHEC & GHEC Server)](/docs/features/permission-syncing#github) ||
38-
| GitLab | 🛑 |
38+
| [GitLab (Self-managed & Cloud)](/docs/features/permission-syncing#gitlab) | |
3939
| Bitbucket Cloud | 🛑 |
4040
| Bitbucket Data Center | 🛑 |
4141
| Gitea | 🛑 |
@@ -59,6 +59,18 @@ Permission syncing works with **github.com**, **GitHub Enterprise Cloud**, and *
5959
- A GitHub OAuth provider must be configured to (1) correlate a Sourcebot user with a GitHub user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
6060
- OAuth tokens must assume the `repo` scope in order to use the [List repositories for the authenticated user API](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user) during [User driven syncing](/docs/features/permission-syncing#how-it-works). Sourcebot **will only** use this token for **reads**.
6161

62+
## GitLab
63+
64+
Prerequisite: [Add GitLab as an OAuth provider](/docs/configuration/auth/providers#gitlab).
65+
66+
Permission syncing works with **GitLab Self-managed** and **GitLab Cloud**. Users with **Guest** role or above with membership to a group or project will have their access synced to Sourcebot. Both direct and indirect membership to a group or project will be synced with Sourcebot. For more details, see the [GitLab docs](https://docs.gitlab.com/user/project/members/#membership-types).
67+
68+
69+
**Notes:**
70+
- A GitLab OAuth provider must be configured to (1) correlate a Sourcebot user with a GitLab user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
71+
- OAuth tokens require the `read_api` scope in order to use the [List projects for the authenticated user API](https://docs.gitlab.com/ee/api/projects.html#list-all-projects) during [User driven syncing](/docs/features/permission-syncing#how-it-works).
72+
73+
6274
# How it works
6375

6476
Permission syncing works by periodically syncing ACLs from the code host(s) to Sourcebot to build an internal mapping between Users and Repositories. This mapping is hydrated in two directions:

0 commit comments

Comments
 (0)