diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2024-01-16 14:32:47 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-01-17 20:02:43 +0000 |
commit | 3ee9c8734918331ac00e4ebf0665a12f62b626ca (patch) | |
tree | 1116944882c4d27daf5b2a83aaf02da804031eb2 | |
parent | ddf2308f12399b4f0823e0f9f1d6d16870506052 (diff) | |
download | sonarqube-3ee9c8734918331ac00e4ebf0665a12f62b626ca.tar.gz sonarqube-3ee9c8734918331ac00e4ebf0665a12f62b626ca.zip |
SONAR-21114 deprecate migrated Users api v1 endpoints
8 files changed, 30 insertions, 10 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/AnonymizeAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/AnonymizeAction.java index 37ec13723af..7ad72d64354 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/AnonymizeAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/AnonymizeAction.java @@ -19,6 +19,7 @@ */ package org.sonar.server.user.ws; +import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; @@ -50,7 +51,9 @@ public class AnonymizeAction implements UsersWsAction { .setDescription("Anonymize a deactivated user. Requires Administer System permission") .setSince("9.7") .setPost(true) - .setHandler(this); + .setHandler(this) + .setDeprecatedSince("10.4") + .setChangelog(new Change("10.4", "Deprecated. Use DELETE api/v2/users-management/users/{id}?anonymize=true instead")); action.createParam(PARAM_LOGIN) .setDescription("User login") diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/CreateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/CreateAction.java index f3de3c37b4d..14dea222731 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/CreateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/CreateAction.java @@ -77,7 +77,9 @@ public class CreateAction implements UsersWsAction { new Change("6.3", "The 'infos' message is no more returned when a user is reactivated")) .setPost(true) .setResponseExample(getClass().getResource("create-example.json")) - .setHandler(this); + .setHandler(this) + .setDeprecatedSince("10.4") + .setChangelog(new Change("10.4", "Deprecated. Use POST api/v2/users-management/users instead"));; action.createParam(PARAM_LOGIN) .setRequired(true) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/DeactivateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/DeactivateAction.java index 5359305116f..74185e224a7 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/DeactivateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/DeactivateAction.java @@ -21,6 +21,7 @@ package org.sonar.server.user.ws; import java.util.HashSet; import java.util.Set; +import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; @@ -60,7 +61,9 @@ public class DeactivateAction implements UsersWsAction { .setSince("3.7") .setPost(true) .setResponseExample(getClass().getResource("deactivate-example.json")) - .setHandler(this); + .setHandler(this) + .setDeprecatedSince("10.4") + .setChangelog(new Change("10.4", "Deprecated. Use DELETE api/v2/users-management/users/{id} instead")); action.createParam(PARAM_LOGIN) .setDescription("User login") diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/GroupsAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/GroupsAction.java index 2a20c80ffe0..c645eba2821 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/GroupsAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/GroupsAction.java @@ -77,9 +77,12 @@ public class GroupsAction implements UsersWsAction { .addSelectionModeParam() .addSearchQuery("users", "group names") .addPagingParams(25) - .setChangelog(new Change("6.4", "Paging response fields moved to a Paging object"), + .setChangelog( + new Change("10.4", "Deprecated. Use GET api/v2/authorizations/groups-memberships?userId={} instead"), + new Change("6.4", "Paging response fields moved to a Paging object"), new Change("6.4", "'default' response field has been added")) - .setSince("5.2"); + .setSince("5.2") + .setDeprecatedSince("10.4"); action.createParam(PARAM_LOGIN) .setDescription("A user login") diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/SearchAction.java index 16f34642c75..637a3d791df 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/SearchAction.java @@ -80,6 +80,7 @@ public class SearchAction implements UsersWsAction { "Field 'lastConnectionDate' is only updated every hour, so it may not be accurate, for instance when a user authenticates many times in less than one hour.") .setSince("3.6") .setChangelog( + new Change("10.4", "Deprecated. Use GET api/v2/users-management/users instead"), new Change("10.3", "New optional parameters " + EXTERNAL_IDENTITY + " to find a user by its IdP login"), new Change("10.1", "New optional parameters " + SONAR_LINT_LAST_CONNECTION_DATE_FROM + " and " + SONAR_LINT_LAST_CONNECTION_DATE_TO + " to filter users by SonarLint last connection date. Only available with Administer System permission."), @@ -96,7 +97,8 @@ public class SearchAction implements UsersWsAction { new Change("6.4", "Avatar has been added to the response"), new Change("6.4", "Email is only returned when user has Administer System permission")) .setHandler(this) - .setResponseExample(getClass().getResource("search-example.json")); + .setResponseExample(getClass().getResource("search-example.json")) + .setDeprecatedSince("10.4"); action.addPagingParams(50, SearchOptions.MAX_PAGE_SIZE); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateAction.java index 18a5327c42b..10379067f27 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateAction.java @@ -80,10 +80,12 @@ public class UpdateAction implements UsersWsAction { "Requires Administer System permission") .setSince("3.7") .setChangelog( + new Change("10.4", "Deprecated. Use PATCH api/v2/users-management/users/{id} instead"), new Change("5.2", "User's password can only be changed using the 'change_password' action.")) .setPost(true) .setHandler(this) - .setResponseExample(getClass().getResource("update-example.json")); + .setResponseExample(getClass().getResource("update-example.json")) + .setDeprecatedSince("10.4"); action.createParam(PARAM_LOGIN) .setRequired(true) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateIdentityProviderAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateIdentityProviderAction.java index cad8de36c43..a86c3e5a91e 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateIdentityProviderAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateIdentityProviderAction.java @@ -78,7 +78,9 @@ public class UpdateIdentityProviderAction implements UsersWsAction { .setSince("8.7") .setInternal(false) .setPost(true) - .setHandler(this); + .setHandler(this) + .setDeprecatedSince("10.4") + .setChangelog(new Change("10.4", "Deprecated. Use PATCH api/v2/users-management/users/{id} instead")); action.createParam(PARAM_LOGIN) .setDescription("User login") diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateLoginAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateLoginAction.java index 03fe245c440..006f97e6e21 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateLoginAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/UpdateLoginAction.java @@ -19,14 +19,15 @@ */ package org.sonar.server.user.ws; +import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.user.UserDto; -import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.common.management.ManagedInstanceChecker; +import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.user.UpdateUser; import org.sonar.server.user.UserSession; import org.sonar.server.user.UserUpdater; @@ -60,7 +61,9 @@ public class UpdateLoginAction implements UsersWsAction { "Requires Administer System permission") .setSince("7.6") .setPost(true) - .setHandler(this); + .setHandler(this) + .setDeprecatedSince("10.4") + .setChangelog(new Change("10.4", "Deprecated. Use PATCH api/v2/users-management/users/{id} instead")); action.createParam(PARAM_LOGIN) .setRequired(true) |