{translate('settings.almintegration.form.url.bitbucket.help')} | {translate('settings.almintegration.form.url.bitbucket.help')} | ||||
<br /> | <br /> | ||||
<br /> | <br /> | ||||
{translate('settings.almintegration.form.url.bitbucket.pat_warning')} | |||||
{translate('settings.almintegration.form.url.pat_warning')} | |||||
</> | </> | ||||
} | } | ||||
id="url.bitbucket" | id="url.bitbucket" |
{translate('settings.almintegration.form.url.gitlab.help')} | {translate('settings.almintegration.form.url.gitlab.help')} | ||||
<br /> | <br /> | ||||
<em>https://gitlab.com/api/v4</em> | <em>https://gitlab.com/api/v4</em> | ||||
<br /> | |||||
<br /> | |||||
{translate('settings.almintegration.form.url.pat_warning')} | |||||
</> | </> | ||||
} | } | ||||
id="url.gitlab" | id="url.gitlab" |
} | } | ||||
@Test | @Test | ||||
public void update_with_url() { | |||||
public void update_with_url_needs_pat() { | |||||
UserDto user = db.users().insertUser(); | UserDto user = db.users().insertUser(); | ||||
userSession.logIn(user).setSystemAdministrator(); | userSession.logIn(user).setSystemAdministrator(); | ||||
} | } | ||||
@Test | @Test | ||||
public void update_without_pat() { | |||||
public void fail_when_url_updated_without_pat() { | |||||
UserDto user = db.users().insertUser(); | UserDto user = db.users().insertUser(); | ||||
userSession.logIn(user).setSystemAdministrator(); | userSession.logIn(user).setSystemAdministrator(); | ||||
AlmSettingDto almSettingDto = db.almSettings().insertGitlabAlmSetting(); | AlmSettingDto almSettingDto = db.almSettings().insertGitlabAlmSetting(); | ||||
ws.newRequest() | |||||
TestRequest request = ws.newRequest() | |||||
.setParam("key", almSettingDto.getKey()) | .setParam("key", almSettingDto.getKey()) | ||||
.setParam("url", GITLAB_URL) | |||||
.execute(); | |||||
assertThat(db.getDbClient().almSettingDao().selectAll(db.getSession())) | |||||
.extracting(AlmSettingDto::getKey, AlmSettingDto::getUrl, s -> s.getDecryptedPersonalAccessToken(encryption)) | |||||
.containsOnly(tuple(almSettingDto.getKey(), GITLAB_URL, almSettingDto.getDecryptedPersonalAccessToken(encryption))); | |||||
.setParam("url", GITLAB_URL); | |||||
assertThatThrownBy(() -> request.execute()) | |||||
.isInstanceOf(IllegalArgumentException.class) | |||||
.hasMessage("Please provide the Personal Access Token to update the URL."); | |||||
} | } | ||||
@Test | @Test |
almSettingsSupport.checkAlmSettingDoesNotAlreadyExist(dbSession, newKey); | almSettingsSupport.checkAlmSettingDoesNotAlreadyExist(dbSession, newKey); | ||||
} | } | ||||
almSettingsSupport.checkPatOnUrlUpdate(almSettingDto, url, pat); | |||||
if (isNotBlank(pat)) { | if (isNotBlank(pat)) { | ||||
almSettingDto.setPersonalAccessToken(pat); | almSettingDto.setPersonalAccessToken(pat); | ||||
} | } |
settings.almintegration.form.url.azure.help2=For Azure DevOps Services, provide the full organization URL: | settings.almintegration.form.url.azure.help2=For Azure DevOps Services, provide the full organization URL: | ||||
settings.almintegration.form.url.bitbucket=Bitbucket Server URL | settings.almintegration.form.url.bitbucket=Bitbucket Server URL | ||||
settings.almintegration.form.url.bitbucket.help=Example: https://bitbucket-server.your-company.com | settings.almintegration.form.url.bitbucket.help=Example: https://bitbucket-server.your-company.com | ||||
settings.almintegration.form.url.bitbucket.pat_warning=For security reasons, please make sure to provide the Personal Access Token to update the URL. | |||||
settings.almintegration.form.url.github=GitHub API URL | settings.almintegration.form.url.github=GitHub API URL | ||||
settings.almintegration.form.url.github.help1=Example for GitHub Enterprise: | settings.almintegration.form.url.github.help1=Example for GitHub Enterprise: | ||||
settings.almintegration.form.url.github.help2=If using GitHub.com: | settings.almintegration.form.url.github.help2=If using GitHub.com: | ||||
settings.almintegration.form.url.github.private_key_warning=For security reasons, please make sure to provide the GitHub App private key to update the URL. | settings.almintegration.form.url.github.private_key_warning=For security reasons, please make sure to provide the GitHub App private key to update the URL. | ||||
settings.almintegration.form.url.gitlab=GitLab API URL | settings.almintegration.form.url.gitlab=GitLab API URL | ||||
settings.almintegration.form.url.gitlab.help=Provide the GitLab API URL. For example: | settings.almintegration.form.url.gitlab.help=Provide the GitLab API URL. For example: | ||||
settings.almintegration.form.url.pat_warning=For security reasons, please make sure to provide the Personal Access Token to update the URL. | |||||
settings.almintegration.form.app_id=GitHub App ID | settings.almintegration.form.app_id=GitHub App ID | ||||
settings.almintegration.form.client_id.github=Client ID | settings.almintegration.form.client_id.github=Client ID | ||||
settings.almintegration.form.client_id.github.help=The Client ID is found on your GitHub App's page. | settings.almintegration.form.client_id.github.help=The Client ID is found on your GitHub App's page. |