import org.sonar.db.alm.setting.ALM;
import org.sonar.db.alm.setting.AlmSettingDto;
import org.sonar.server.user.UserSession;
+import org.sonarqube.ws.AlmSettings;
import org.sonarqube.ws.AlmSettings.AlmSettingBitbucketCloud;
import org.sonarqube.ws.AlmSettings.AlmSettingGithub;
case BITBUCKET:
validateBitbucketServer(almSettingDto);
break;
+ case BITBUCKET_CLOUD:
+ validateBitbucketCloud(almSettingDto);
case AZURE_DEVOPS:
validateAzure(almSettingDto);
break;
bitbucketServerRestClient.validateToken(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
bitbucketServerRestClient.validateReadPermission(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
}
+
+ private void validateBitbucketCloud(AlmSettingDto almSettingDto) {
+ bitbucketServerRestClient.validateUrl(almSettingDto.getUrl());
+ bitbucketServerRestClient.validateToken(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
+ bitbucketServerRestClient.validateReadPermission(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
+ }
}