Skip to content

Commit 173a56a

Browse files
authored
Revamp onboarding flow (#376)
* sign up copy nits * first pass at new onboarding page * wip join onboard logic * refactor auth provider fetch logic * add member approval and invite link flag logic * update join request flow and remove jit logic * onboard guard * nits, onboard role check, invite link enabled check * fix bg color issue in onboarding page * refactor onboard UI * ui nits and more onboarding resource cards * revamp auth docs * change member approval default behavior and updated docs * merge prisma migrations * add id to resource card * feedback * feedback * feedback and fixed build * settings drop down UI nit * ui nits * handle join when max capacity case * add news data for member toggle * refactor for public access case * add iap bridge to onboard logic * fetch member approval req and invite link enabled flag on server * ui nits * fix invite link enable toggle snapping issue * ui nits * styling and ui nits, pass in invite id from server * add mcp resource in onboard step * get invite link in server * fix build issue * refactor docs on config * minor doc nit
1 parent 1384dd8 commit 173a56a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1982
-1432
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fixed issue with external source code links being broken for paths with spaces. [#364](https://github.com/sourcebot-dev/sourcebot/pull/364)
12+
- Revamped onboarding experience. [#370](https://github.com/sourcebot-dev/sourcebot/pull/376)
1213
- Makes base retry indexing configuration configurable and move from a default of `5s` to `60s`. [#377](https://github.com/sourcebot-dev/sourcebot/pull/377)
1314
- Fixed issue where files would sometimes never load in the code browser. [#365](https://github.com/sourcebot-dev/sourcebot/pull/365)
1415

docs/docs.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"group": "Configuration",
5353
"pages": [
5454
{
55-
"group": "Connecting your code",
55+
"group": "Indexing your code",
5656
"pages": [
5757
"docs/connections/overview",
5858
"docs/connections/github",
@@ -72,7 +72,10 @@
7272
"group": "Authentication",
7373
"pages": [
7474
"docs/configuration/auth/overview",
75-
"docs/configuration/auth/roles-and-permissions"
75+
"docs/configuration/auth/providers",
76+
"docs/configuration/auth/inviting-members",
77+
"docs/configuration/auth/roles-and-permissions",
78+
"docs/configuration/auth/faq"
7679
]
7780
},
7881
"docs/configuration/transactional-emails",

docs/docs/configuration/audit-logs.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ curl --request GET '$SOURCEBOT_URL/api/ee/audit' \
125125
| `user.join_requested` | `user` | `org` |
126126
| `user.join_request_approve_failed` | `user` | `account_join_request` |
127127
| `user.join_request_approved` | `user` | `account_join_request` |
128-
| `user.join_request_removed` | `user` | `account_join_request` |
129128
| `user.invite_failed` | `user` | `org` |
130129
| `user.invites_created` | `user` | `org` |
131130
| `user.invite_accept_failed` | `user` | `invite` |

docs/docs/configuration/auth/faq.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: FAQ
3+
---
4+
5+
This page covers a range of frequently asked questions about Sourcebot's built-in authentication system.
6+
7+
<AccordionGroup>
8+
<Accordion title="Can I disable the authentication system?">
9+
No, at this time it's not possible to disable the authentication system. If this is preventing you from deploying Sourcebot
10+
within your organization please [reach out](https://www.sourcebot.dev/contact)
11+
</Accordion>
12+
13+
<Accordion title="I don't want to restrict access to my Sourcebot deployment, what should I do?">
14+
Every user must register an account within your Sourcebot deployment. However, this dosn't mean their access
15+
is restricted.
16+
17+
Unless member approval is required, anyone can sign up for an account on your deployment and immediately be granted access.
18+
</Accordion>
19+
20+
<Accordion title="Does any data related to authentication (emails, passwords, etc) leave my deployment?">
21+
**No data related to authentication (or your code) leaves your deployment**. Authentication is handled
22+
purely by your deployment and the authentication providers you configure.
23+
24+
This data does not leave your device and is stored within in the database managed by your deployment. If you're
25+
using credential login, passwords are encrypted at rest and in transit.
26+
</Accordion>
27+
28+
<Accordion title="I'm deploying Sourcebot behind an identity proxy, do I still need to create an account in Sourcebot?">
29+
<Note>Please note that IAP bridges are an enterprise feature</Note>
30+
Sourcebot supports connecting your identity proxy directly into the built-in auth system using an IAP bridge. This allows Sourcebot to
31+
register and authenticate automatically on a successful identity proxy log in.
32+
33+
Sourcebot currently supports [GCP IAP](/docs/configuration/auth/providers#gcp-iap). If you're using a different IAP
34+
and require support, please [reach out](https://www.sourcebot.dev/contact)
35+
</Accordion>
36+
37+
<Accordion title="How does Sourcebot implement authentication?">
38+
Sourcebot uses [Auth.js](https://authjs.dev/) as its underlying authentication framework. Auth.js provides authentication providers
39+
(credientials, Google, GitHub, etc) and an interface to enable user registration and log in. Internally, Auth.js uses JWT to provide
40+
Sourcebot secure and reliable information about user authentication.
41+
</Accordion>
42+
</AccordionGroup>
43+
44+
45+
Have a question that's not answered here? Submit it on our [GitHub discussions](https://github.com/sourcebot-dev/sourcebot/discussions)
46+
page and we'll get back to you as soon as we can!
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Inviting Members
3+
sidebarTitle: Inviting members
4+
---
5+
6+
There are various ways to configure how members can join a Sourcebot deployment.
7+
8+
## Member Approval
9+
10+
**By default, Sourcebot requires new members to be approved by the owner of the deployment**. This section explains how approvals work and how
11+
to configure this behavior.
12+
13+
### Configuration
14+
Member approval can be configured by the owner of the deployment by navigating to **Settings -> Members**:
15+
16+
![Member Approval Toggle](/images/member_approval_toggle.png)
17+
18+
### Managing Requests
19+
20+
If member approval is enabled, new members will be asked to submit a join request after signing up. They will not have access to the Sourcebot deployment
21+
until this request is approved by the owner.
22+
23+
The owner can see and manage all pending join requests by navigating to **Settings -> Members**.
24+
25+
## Invite link
26+
27+
If member approval is required, an owner of the deployment can enable an invite link. When enabled, users
28+
can use this invite link to register and be automatically added to the organization without approval:
29+
30+
![Invite Link Toggle](/images/invite_link_toggle.png)

docs/docs/configuration/auth/overview.mdx

Lines changed: 16 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -4,124 +4,23 @@ title: Overview
44

55
<Warning>If you're deploying Sourcebot behind a domain, you must set the [AUTH_URL](/docs/configuration/environment-variables) environment variable.</Warning>
66

7-
Sourcebot has built-in authentication that gates access to your organization. OAuth, email codes, and email / password are supported.
7+
Sourcebot's built-in authentication system gates your deployment, and allows administrators to manage users and their permissions.
8+
9+
<CardGroup cols={2}>
10+
<Card horizontal title="Authentication providers" icon="lock" href="/docs/configuration/auth/providers">
11+
Configure additional authentication providers for your deployment.
12+
</Card>
13+
<Card horizontal title="Inviting members" icon="user" href="/docs/configuration/auth/inviting-members">
14+
Learn how to configure how members join your deployment.
15+
</Card>
16+
<Card horizontal title="Roles and permissions" icon="shield" href="/docs/configuration/auth/roles-and-permissions">
17+
Learn more about the different roles and permissions in Sourcebot.
18+
</Card>
19+
<Card horizontal title="FAQ" icon="question" href="/docs/configuration/auth/faq">
20+
Have a question about Sourcebot's auth system? We might have the answers here.
21+
</Card>
22+
</CardGroup>
823

9-
The first account that's registered on a Sourcebot deployment is made the owner. All other users who register must be [approved](/docs/configuration/auth/overview#approving-new-members) by the owner.
10-
11-
![Login Page](/images/login.png)
12-
13-
14-
# Approving New Members
15-
16-
All account registrations after the first account must be approved by the owner. The owner can see all join requests by going into **Settings -> Members**.
17-
18-
If you have an [enterprise license](/docs/license-key), you can enable [AUTH_EE_ENABLE_JIT_PROVISIONING](/docs/configuration/auth/overview#enterprise-authentication-providers) to
19-
have Sourcebot accounts automatically created and approved on registration.
20-
21-
You can setup emails to be sent when new join requests are created/approved by configurating [transactional emails](/docs/configuration/transactional-emails)
22-
# Authentication Providers
23-
24-
To enable an authentication provider in Sourcebot, configure the required environment variables for the provider. Under the hood, Sourcebot uses Auth.js which supports [many providers](https://authjs.dev/getting-started/authentication/oauth). Submit a [feature request on GitHub](https://github.com/sourcebot-dev/sourcebot/discussions/categories/ideas) if you want us to add support for a specific provider.
25-
26-
## Core Authentication Providers
27-
28-
### Email / Password
29-
---
30-
Email / password authentication is enabled by default. It can be **disabled** by setting `AUTH_CREDENTIALS_LOGIN_ENABLED` to `false`.
31-
32-
### Email codes
33-
---
34-
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when transactional emails are configured using the following environment variables:
35-
36-
- `AUTH_EMAIL_CODE_LOGIN_ENABLED`
37-
- `SMTP_CONNECTION_URL`
38-
- `EMAIL_FROM_ADDRESS`
39-
40-
41-
See [transactional emails](/docs/configuration/transactional-emails) for more details.
42-
43-
## Enterprise Authentication Providers
44-
45-
The following authentication providers require an [enterprise license](/docs/license-key) to be enabled.
46-
47-
By default, a new user registering using these providers must have their join request accepted by the owner of the organization to join. To allow a user to join automatically when
48-
they register for the first time, set the `AUTH_EE_ENABLE_JIT_PROVISIONING` environment variable to `true`.
49-
50-
### GitHub
51-
---
52-
53-
[Auth.js GitHub Provider Docs](https://authjs.dev/getting-started/providers/github)
54-
55-
**Required environment variables:**
56-
- `AUTH_EE_GITHUB_CLIENT_ID`
57-
- `AUTH_EE_GITHUB_CLIENT_SECRET`
58-
59-
Optional environment variables:
60-
- `AUTH_EE_GITHUB_BASE_URL` - Base URL for GitHub Enterprise (defaults to https://github.com)
61-
62-
### GitLab
63-
---
64-
65-
[Auth.js GitLab Provider Docs](https://authjs.dev/getting-started/providers/gitlab)
66-
67-
**Required environment variables:**
68-
- `AUTH_EE_GITLAB_CLIENT_ID`
69-
- `AUTH_EE_GITLAB_CLIENT_SECRET`
70-
71-
Optional environment variables:
72-
- `AUTH_EE_GITLAB_BASE_URL` - Base URL for GitLab instance (defaults to https://gitlab.com)
73-
74-
### Google
75-
---
76-
77-
[Auth.js Google Provider Docs](https://authjs.dev/getting-started/providers/google)
78-
79-
**Required environment variables:**
80-
- `AUTH_EE_GOOGLE_CLIENT_ID`
81-
- `AUTH_EE_GOOGLE_CLIENT_SECRET`
82-
83-
### GCP IAP
84-
---
85-
86-
<Note>If you're running Sourcebot in an environment that blocks egress, make sure you allow the [IAP IP ranges](https://www.gstatic.com/ipranges/goog.json)</Note>
87-
88-
Custom provider built to enable automatic Sourcebot account registration/login when using GCP IAP.
89-
90-
**Required environment variables**
91-
- `AUTH_EE_GCP_IAP_ENABLED`
92-
- `AUTH_EE_GCP_IAP_AUDIENCE`
93-
- This can be found by selecting the ⋮ icon next to the IAP-enabled backend service and pressing `Get JWT audience code`
94-
95-
### Okta
96-
---
97-
98-
[Auth.js Okta Provider Docs](https://authjs.dev/getting-started/providers/okta)
99-
100-
**Required environment variables:**
101-
- `AUTH_EE_OKTA_CLIENT_ID`
102-
- `AUTH_EE_OKTA_CLIENT_SECRET`
103-
- `AUTH_EE_OKTA_ISSUER`
104-
105-
### Keycloak
106-
---
107-
108-
[Auth.js Keycloak Provider Docs](https://authjs.dev/getting-started/providers/keycloak)
109-
110-
**Required environment variables:**
111-
- `AUTH_EE_KEYCLOAK_CLIENT_ID`
112-
- `AUTH_EE_KEYCLOAK_CLIENT_SECRET`
113-
- `AUTH_EE_KEYCLOAK_ISSUER`
114-
115-
### Microsoft Entra ID
116-
117-
[Auth.js Microsoft Entra ID Provider Docs](https://authjs.dev/getting-started/providers/microsoft-entra-id)
118-
119-
**Required environment variables:**
120-
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_ID`
121-
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_SECRET`
122-
- `AUTH_EE_MICROSOFT_ENTRA_ID_ISSUER`
123-
124-
---
12524

12625
# Troubleshooting
12726

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: Providers
3+
---
4+
5+
Sourcebot supports a wide range of different authentication providers through it's integration with [Auth.js](https://authjs.dev/). This page
6+
highlights how to configure the various supported providers.
7+
8+
If theres an authentication provider you'd like us to support, please [reach out](https://www.sourcebot.dev/contact).
9+
10+
# Core Authentication Providers
11+
12+
### Email / Password
13+
---
14+
Email / password authentication is enabled by default. It can be **disabled** by setting `AUTH_CREDENTIALS_LOGIN_ENABLED` to `false`.
15+
16+
### Email codes
17+
---
18+
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when transactional emails are configured using the following environment variables:
19+
20+
- `AUTH_EMAIL_CODE_LOGIN_ENABLED`
21+
- `SMTP_CONNECTION_URL`
22+
- `EMAIL_FROM_ADDRESS`
23+
24+
25+
See [transactional emails](/docs/configuration/transactional-emails) for more details.
26+
27+
# Enterprise Authentication Providers
28+
29+
The following authentication providers require an [enterprise license](/docs/license-key) to be enabled.
30+
31+
### GitHub
32+
---
33+
34+
[Auth.js GitHub Provider Docs](https://authjs.dev/getting-started/providers/github)
35+
36+
**Required environment variables:**
37+
- `AUTH_EE_GITHUB_CLIENT_ID`
38+
- `AUTH_EE_GITHUB_CLIENT_SECRET`
39+
40+
Optional environment variables:
41+
- `AUTH_EE_GITHUB_BASE_URL` - Base URL for GitHub Enterprise (defaults to https://github.com)
42+
43+
### GitLab
44+
---
45+
46+
[Auth.js GitLab Provider Docs](https://authjs.dev/getting-started/providers/gitlab)
47+
48+
**Required environment variables:**
49+
- `AUTH_EE_GITLAB_CLIENT_ID`
50+
- `AUTH_EE_GITLAB_CLIENT_SECRET`
51+
52+
Optional environment variables:
53+
- `AUTH_EE_GITLAB_BASE_URL` - Base URL for GitLab instance (defaults to https://gitlab.com)
54+
55+
### Google
56+
---
57+
58+
[Auth.js Google Provider Docs](https://authjs.dev/getting-started/providers/google)
59+
60+
**Required environment variables:**
61+
- `AUTH_EE_GOOGLE_CLIENT_ID`
62+
- `AUTH_EE_GOOGLE_CLIENT_SECRET`
63+
64+
### GCP IAP
65+
---
66+
67+
<Note>If you're running Sourcebot in an environment that blocks egress, make sure you allow the [IAP IP ranges](https://www.gstatic.com/ipranges/goog.json)</Note>
68+
69+
Custom provider built to enable automatic Sourcebot account registration/login when using GCP IAP.
70+
71+
**Required environment variables**
72+
- `AUTH_EE_GCP_IAP_ENABLED`
73+
- `AUTH_EE_GCP_IAP_AUDIENCE`
74+
- This can be found by selecting the ⋮ icon next to the IAP-enabled backend service and pressing `Get JWT audience code`
75+
76+
### Okta
77+
---
78+
79+
[Auth.js Okta Provider Docs](https://authjs.dev/getting-started/providers/okta)
80+
81+
**Required environment variables:**
82+
- `AUTH_EE_OKTA_CLIENT_ID`
83+
- `AUTH_EE_OKTA_CLIENT_SECRET`
84+
- `AUTH_EE_OKTA_ISSUER`
85+
86+
### Keycloak
87+
---
88+
89+
[Auth.js Keycloak Provider Docs](https://authjs.dev/getting-started/providers/keycloak)
90+
91+
**Required environment variables:**
92+
- `AUTH_EE_KEYCLOAK_CLIENT_ID`
93+
- `AUTH_EE_KEYCLOAK_CLIENT_SECRET`
94+
- `AUTH_EE_KEYCLOAK_ISSUER`
95+
96+
### Microsoft Entra ID
97+
98+
[Auth.js Microsoft Entra ID Provider Docs](https://authjs.dev/getting-started/providers/microsoft-entra-id)
99+
100+
**Required environment variables:**
101+
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_ID`
102+
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_SECRET`
103+
- `AUTH_EE_MICROSOFT_ENTRA_ID_ISSUER`
104+
105+
---

docs/docs/configuration/environment-variables.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The following environment variables allow you to configure your Sourcebot deploy
4141
| Variable | Default | Description |
4242
| :------- | :------ | :---------- |
4343
| `SOURCEBOT_EE_AUDIT_LOGGING_ENABLED` | `true` | <p>Enables/disables audit logging</p> |
44-
| `AUTH_EE_ENABLE_JIT_PROVISIONING` | `false` | <p>Enables/disables just-in-time user provisioning for SSO providers.</p> |
4544
| `AUTH_EE_GITHUB_BASE_URL` | `https://github.com` | <p>The base URL for GitHub Enterprise SSO authentication.</p> |
4645
| `AUTH_EE_GITHUB_CLIENT_ID` | `-` | <p>The client ID for GitHub Enterprise SSO authentication.</p> |
4746
| `AUTH_EE_GITHUB_CLIENT_SECRET` | `-` | <p>The client secret for GitHub Enterprise SSO authentication.</p> |

docs/docs/connections/local-repos.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ icon: folder
55

66
import GenericGitHost from '/snippets/schemas/v3/genericGitHost.schema.mdx'
77

8-
Sourcebot can sync code from generic git repositories stored in a local directory. This can be helpful in scenarios where you already have a large number of repos already checked out. Local repositories are treated as **read-only**, meaing Sourcebot will **not** `git fetch` new revisions.
8+
Sourcebot can sync code from generic git repositories stored in a local directory. This can be helpful in scenarios where you already have a large number of repos already checked out. Local repositories are treated as **read-only**, meaning Sourcebot will **not** `git fetch` new revisions.
99

1010
## Getting Started
1111

0 commit comments

Comments
 (0)