mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 19:26:38 +00:00
Point getTeamsGitLab method to self-hosted GitLab instance if applicable
This commit is contained in:
@@ -34,6 +34,7 @@ const getTeams = async ({
|
|||||||
switch (integrationAuth.integration) {
|
switch (integrationAuth.integration) {
|
||||||
case INTEGRATION_GITLAB:
|
case INTEGRATION_GITLAB:
|
||||||
teams = await getTeamsGitLab({
|
teams = await getTeamsGitLab({
|
||||||
|
integrationAuth,
|
||||||
accessToken,
|
accessToken,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -51,13 +52,17 @@ const getTeams = async ({
|
|||||||
* @returns {String} teams.teamId - id of team
|
* @returns {String} teams.teamId - id of team
|
||||||
*/
|
*/
|
||||||
const getTeamsGitLab = async ({
|
const getTeamsGitLab = async ({
|
||||||
|
integrationAuth,
|
||||||
accessToken,
|
accessToken,
|
||||||
}: {
|
}: {
|
||||||
|
integrationAuth: IIntegrationAuth;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const gitLabApiUrl = integrationAuth.url ? `${integrationAuth.url}/api` : INTEGRATION_GITLAB_API_URL;
|
||||||
|
|
||||||
let teams: Team[] = [];
|
let teams: Team[] = [];
|
||||||
const res = (await standardRequest.get(
|
const res = (await standardRequest.get(
|
||||||
`${INTEGRATION_GITLAB_API_URL}/v4/groups`,
|
`${gitLabApiUrl}/v4/groups`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${accessToken}`,
|
Authorization: `Bearer ${accessToken}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user