Skip to content

Commit

Permalink
Set SAAS Gitlab url if endpint is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Oct 30, 2024
1 parent 14f7556 commit e4245cd
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/
package org.eclipse.che.api.factory.server.gitlab;

import static com.google.common.base.Strings.isNullOrEmpty;

import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.che.api.factory.server.scm.*;
Expand All @@ -22,11 +24,17 @@ public class GitlabUserDataFetcher extends AbstractGitlabUserDataFetcher {
/** Name of this OAuth provider as found in OAuthAPI. */
private static final String OAUTH_PROVIDER_NAME = "gitlab";

private static final String GITLAB_SAAS_ENDPOINT = "https://gitlab.com";

@Inject
public GitlabUserDataFetcher(
@Nullable @Named("che.integration.gitlab.oauth_endpoint") String serverUrl,
@Named("che.api") String apiEndpoint,
PersonalAccessTokenManager personalAccessTokenManager) {
super(serverUrl, apiEndpoint, personalAccessTokenManager, OAUTH_PROVIDER_NAME);
super(
isNullOrEmpty(serverUrl) ? GITLAB_SAAS_ENDPOINT : serverUrl,
apiEndpoint,
personalAccessTokenManager,
OAUTH_PROVIDER_NAME);
}
}

0 comments on commit e4245cd

Please sign in to comment.