diff options
author | Antoine Vigneau <antoine.vigneau@sonarsource.com> | 2023-12-10 18:51:02 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-22 20:03:02 +0000 |
commit | b2cd0f3ff50d504cd88ecf7eec9887ef4fb46ea3 (patch) | |
tree | d8d195f51dc474d486020480d7817d372d086028 /sonar-ws/src | |
parent | 0b634fb2bf2c75f30193e406e16e1ebcba266f8f (diff) | |
download | sonarqube-b2cd0f3ff50d504cd88ecf7eec9887ef4fb46ea3.tar.gz sonarqube-b2cd0f3ff50d504cd88ecf7eec9887ef4fb46ea3.zip |
SONAR-21119 Add Gitlab BBT for user provisioning
Diffstat (limited to 'sonar-ws/src')
3 files changed, 16 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/users/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/SearchRequest.java index 577fe35bbc6..0739127a6cb 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/users/SearchRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/users/SearchRequest.java @@ -34,6 +34,7 @@ public class SearchRequest { private String ps; private String q; private Boolean deactivated; + private Boolean managed; /** * Example value: "42" @@ -78,4 +79,13 @@ public class SearchRequest { this.deactivated = deactivated; return this; } + + public Boolean getManaged() { + return managed; + } + + public SearchRequest setManaged(Boolean managed) { + this.managed = managed; + return this; + } } 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 078546cde0e..25457cf5aa0 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 @@ -149,7 +149,8 @@ public class UsersService extends BaseService { .setParam("p", request.getP()) .setParam("ps", request.getPs()) .setParam("q", request.getQ()) - .setParam("deactivated", request.getDeactivated()), + .setParam("deactivated", request.getDeactivated()) + .setParam("managed", request.getManaged()), SearchWsResponse.parser()); } diff --git a/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java b/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java index f5dbe9bb912..885bff99aef 100644 --- a/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java +++ b/sonar-ws/src/testFixtures/java/org/sonarqube/ws/tester/UserTester.java @@ -172,6 +172,10 @@ public class UserTester { return queryForUser(name, t -> t.getName().equals(name)); } + public List<Users.SearchWsResponse.User> getAllManagedUsers() { + return service().search(new SearchRequest().setManaged(true)).getUsersList(); + } + public void changePassword(String login, String previousPassword, String newPassword) { service().changePassword(new ChangePasswordRequest().setLogin(login).setPreviousPassword(previousPassword).setPassword(newPassword)); } |