aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorWojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com>2023-11-20 10:58:15 +0100
committersonartech <sonartech@sonarsource.com>2023-11-20 20:02:38 +0000
commit0c7fd2fe339f3969a67553b333ce4a5e67cf9c2d (patch)
treeb89b3878c077af833dd5a3f2c23e50cf71c4f1db /server
parent6f37b467c20c37fb83fc4cd388b333f121e05c64 (diff)
downloadsonarqube-0c7fd2fe339f3969a67553b333ce4a5e67cf9c2d.tar.gz
sonarqube-0c7fd2fe339f3969a67553b333ce4a5e67cf9c2d.zip
SONAR-21015 Move GitHub permission mapping endpoints to dop-translation domain
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/api/provisioning.ts10
-rw-r--r--server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/WebApiEndpoints.java1
2 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/provisioning.ts b/server/sonar-web/src/main/js/api/provisioning.ts
index a3bef28efb1..e8c7ea90dc1 100644
--- a/server/sonar-web/src/main/js/api/provisioning.ts
+++ b/server/sonar-web/src/main/js/api/provisioning.ts
@@ -22,6 +22,8 @@ import { throwGlobalError } from '../helpers/error';
import { getJSON, post, postJSON } from '../helpers/request';
import { GitHubConfigurationStatus, GitHubMapping, GithubStatus } from '../types/provisioning';
+const GITHUB_PERMISSION_MAPPINGS = '/api/v2/dop-translation/github-permission-mappings';
+
export function fetchIsScimEnabled(): Promise<boolean> {
return getJSON('/api/scim_management/status')
.then((r) => r.enabled)
@@ -58,7 +60,7 @@ export function syncNowGithubProvisioning(): Promise<void> {
export function fetchGithubRolesMapping() {
return axios
- .get<{ githubPermissionsMappings: GitHubMapping[] }>('/api/v2/github-permission-mappings')
+ .get<{ githubPermissionsMappings: GitHubMapping[] }>(GITHUB_PERMISSION_MAPPINGS)
.then((data) => data.githubPermissionsMappings);
}
@@ -67,15 +69,15 @@ export function updateGithubRolesMapping(
data: Partial<Pick<GitHubMapping, 'permissions'>>,
) {
return axios.patch<GitHubMapping>(
- `/api/v2/github-permission-mappings/${encodeURIComponent(role)}`,
+ `${GITHUB_PERMISSION_MAPPINGS}/${encodeURIComponent(role)}`,
data,
);
}
export function addGithubRolesMapping(data: Omit<GitHubMapping, 'id'>) {
- return axios.post<GitHubMapping>(`/api/v2/github-permission-mappings/`, data);
+ return axios.post<GitHubMapping>(GITHUB_PERMISSION_MAPPINGS, data);
}
export function deleteGithubRolesMapping(role: string) {
- return axios.delete(`/api/v2/github-permission-mappings/${encodeURIComponent(role)}`);
+ return axios.delete(`${GITHUB_PERMISSION_MAPPINGS}/${encodeURIComponent(role)}`);
}
diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/WebApiEndpoints.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/WebApiEndpoints.java
index aacc93538c8..9e5c9aa684d 100644
--- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/WebApiEndpoints.java
+++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/WebApiEndpoints.java
@@ -26,7 +26,6 @@ public class WebApiEndpoints {
public static final String USERS_MANAGEMENT_DOMAIN = "/users-management";
public static final String USER_ENDPOINT = USERS_MANAGEMENT_DOMAIN + "/users";
- public static final String GITHUB_PERMISSIONS_ENDPOINT = "/github-permission-mappings";
public static final String JSON_MERGE_PATCH_CONTENT_TYPE = "application/merge-patch+json";
private WebApiEndpoints() {