diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2020-12-22 16:39:32 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-01-11 20:20:38 +0000 |
commit | a915585e9181af099ee293977126dc117ffdc15a (patch) | |
tree | 03c6a6b7a5b5cb5cba0eb16a97942ba6637738a0 /sonar-ws | |
parent | 177ce9bc1e0e79ea6fb76f798ebbef7e787a6078 (diff) | |
download | sonarqube-a915585e9181af099ee293977126dc117ffdc15a.tar.gz sonarqube-a915585e9181af099ee293977126dc117ffdc15a.zip |
SONAR-13930 Allow migration of auth system
Diffstat (limited to 'sonar-ws')
3 files changed, 92 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java index 434814810ca..fd15902dec0 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/user/UsersWsParameters.java @@ -27,9 +27,9 @@ public class UsersWsParameters { public static final String ACTION_CREATE = "create"; public static final String ACTION_DEACTIVATE = "deactivate"; public static final String ACTION_UPDATE = "update"; - public static final String ACTION_GROUPS = "groups"; public static final String ACTION_SKIP_ONBOARDING_TUTORIAL = "skip_onboarding_tutorial"; public static final String ACTION_CURRENT = "current"; + public static final String ACTION_UPDATE_IDENTITY_PROVIDER = "update_identity_provider"; public static final String PARAM_LOGIN = "login"; public static final String PARAM_PASSWORD = "password"; @@ -40,6 +40,8 @@ public class UsersWsParameters { public static final String PARAM_SCM_ACCOUNT = "scmAccount"; public static final String PARAM_LOCAL = "local"; public static final String PARAM_SELECTED = "selected"; + public static final String PARAM_NEW_EXTERNAL_PROVIDER = "newExternalProvider"; + public static final String PARAM_NEW_EXTERNAL_IDENTITY = "newExternalIdentity"; private UsersWsParameters() { // Only static stuff diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UpdateIdentityProviderRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UpdateIdentityProviderRequest.java new file mode 100644 index 00000000000..31c40d1bcb4 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UpdateIdentityProviderRequest.java @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonarqube.ws.client.users; + +import java.util.List; +import javax.annotation.Generated; + +/** + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/users/update_identity_provider">Further information about this action online (including a response example)</a> + * @since 8.7 + */ +@Generated("sonar-ws-generator") +public class UpdateIdentityProviderRequest { + + private String login; + private String newExternalIdentity; + private String newExternalProvider; + + /** + * This is a mandatory parameter. + */ + public UpdateIdentityProviderRequest setLogin(String login) { + this.login = login; + return this; + } + + public String getLogin() { + return login; + } + + /** + */ + public UpdateIdentityProviderRequest setNewExternalIdentity(String newExternalIdentity) { + this.newExternalIdentity = newExternalIdentity; + return this; + } + + public String getNewExternalIdentity() { + return newExternalIdentity; + } + + /** + * This is a mandatory parameter. + */ + public UpdateIdentityProviderRequest setNewExternalProvider(String newExternalProvider) { + this.newExternalProvider = newExternalProvider; + return this; + } + + public String getNewExternalProvider() { + return newExternalProvider; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UsersService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UsersService.java index 694d3037b5a..edcad0df8be 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UsersService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/UsersService.java @@ -227,4 +227,21 @@ public class UsersService extends BaseService { .setParam("newLogin", request.getNewLogin()) .setMediaType(MediaTypes.JSON)).content(); } + + /** + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/users/update_identity_provider">Further information about this action online (including a response example)</a> + * @since 8.7 + */ + public void updateIdentityProvider(UpdateIdentityProviderRequest request) { + call( + new PostRequest(path("update_identity_provider")) + .setParam("login", request.getLogin()) + .setParam("newExternalIdentity", request.getNewExternalIdentity()) + .setParam("newExternalProvider", request.getNewExternalProvider()) + .setMediaType(MediaTypes.JSON) + ).content(); + } } |