MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / createGitLabProvider

Function createGitLabProvider

packages/web/src/ee/features/sso/sso.ts:223–251  ·  view source on GitHub ↗
(id: string, clientId: string, clientSecret: string, baseUrl: string)

Source from the content-addressed store, hash-verified

221}
222
223const createGitLabProvider = async (id: string, clientId: string, clientSecret: string, baseUrl: string) => {
224 return Gitlab({
225 id,
226 clientId: clientId,
227 clientSecret: clientSecret,
228 authorization: {
229 url: `${baseUrl}/oauth/authorize`,
230 params: {
231 scope: [
232 "read_user",
233 // Permission syncing requires the `read_api` scope in order to fetch projects
234 // for the authenticated user and project members.
235 // @see: https://docs.gitlab.com/ee/api/projects.html#list-all-projects
236 ...(env.PERMISSION_SYNC_ENABLED === 'true' && await hasEntitlement('permission-syncing') ?
237 ['read_api'] :
238 []
239 ),
240 ].join(' '),
241 },
242 },
243 token: {
244 url: `${baseUrl}/oauth/token`,
245 },
246 userinfo: {
247 url: `${baseUrl}/api/v4/user`,
248 },
249 allowDangerousEmailAccountLinking: env.AUTH_EE_ALLOW_EMAIL_ACCOUNT_LINKING === 'true',
250 });
251}
252
253const createGoogleProvider = (id: string, clientId: string, clientSecret: string) => {
254 return Google({

Callers 1

getEEIdentityProvidersFunction · 0.85

Calls 1

hasEntitlementFunction · 0.90

Tested by

no test coverage detected