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

Function createGitLabFromOAuthToken

packages/backend/src/gitlab.ts:25–34  ·  view source on GitHub ↗
({ oauthToken, url }: { oauthToken?: string, url?: string })

Source from the content-addressed store, hash-verified

23}
24
25export const createGitLabFromOAuthToken = async ({ oauthToken, url }: { oauthToken?: string, url?: string }) => {
26 const isGitLabCloud = url ? new URL(url).hostname === GITLAB_CLOUD_HOSTNAME : true;
27 return new Gitlab({
28 ...(oauthToken ? { oauthToken } : {}),
29 ...(isGitLabCloud ? {} : {
30 host: url,
31 }),
32 queryTimeout: env.GITLAB_CLIENT_QUERY_TIMEOUT_SECONDS * 1000,
33 });
34}
35
36export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) => {
37 const hostname = config.url ?

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected