Browse Source

SONAR-20184 Don't return group and token count in API v2 users responses.

tags/10.2.0.77647
Wojtek Wajerowicz 9 months ago
parent
commit
c096cbf6f2

+ 0
- 4
server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/converter/UsersSearchRestResponseGenerator.java View File

@@ -76,8 +76,6 @@ public class UsersSearchRestResponseGenerator implements UsersSearchResponseGene
Boolean managed = userSearchResult.managed();
String sqLastConnectionDate = toDateTime(userDto.getLastConnectionDate());
String slLastConnectionDate = toDateTime(userDto.getLastSonarlintConnectionDate());
int groupSize = userSearchResult.groups().size();
int tokensCount = userSearchResult.tokensCount();
List<String> scmAccounts = userSearchResult.userDto().getSortedScmAccounts();
return new RestUserForAdmins(
login,
@@ -92,8 +90,6 @@ public class UsersSearchRestResponseGenerator implements UsersSearchResponseGene
avatar,
sqLastConnectionDate,
slLastConnectionDate,
groupSize,
tokensCount,
scmAccounts);
}
return new RestUserForLoggedInUsers(login, login, name, email, active, local, externalIdentityProvider, avatar);

+ 0
- 4
server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/user/model/RestUserForAdmins.java View File

@@ -45,10 +45,6 @@ public record RestUserForAdmins(
@Nullable
String sonarLintLastConnectionDate,
@Nullable
Integer groupsCount,
@Nullable
Integer tokensCount,
@Nullable
List<String> scmAccounts
) implements RestUser {
}

+ 0
- 2
server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/api/user/controller/DefaultUserControllerTest.java View File

@@ -213,8 +213,6 @@ public class DefaultUserControllerTest {
userSearchResult.avatar().orElse(""),
formatDateTime(userSearchResult.userDto().getLastConnectionDate()),
formatDateTime(userSearchResult.userDto().getLastSonarlintConnectionDate()),
userSearchResult.groups().size(),
userSearchResult.tokensCount(),
userSearchResult.userDto().getSortedScmAccounts());
}


+ 0
- 4
server/sonar-webserver-webapi-v2/src/test/java/org/sonar/server/v2/api/user/converter/UsersSearchRestResponseGeneratorTest.java View File

@@ -96,8 +96,6 @@ public class UsersSearchRestResponseGeneratorTest {
userSearchResult.avatar().orElse(null),
toDateTime(userDto.getLastConnectionDate()),
toDateTime(userDto.getLastSonarlintConnectionDate()),
userSearchResult.groups().size(),
userSearchResult.tokensCount(),
userSearchResult.userDto().getSortedScmAccounts()
);
}
@@ -178,8 +176,6 @@ public class UsersSearchRestResponseGeneratorTest {

when(userSearchResult.userDto()).thenReturn(user1);
when(userSearchResult.managed()).thenReturn(booleanFlagsValue);
when(userSearchResult.tokensCount()).thenReturn(i);
when(userSearchResult.groups().size()).thenReturn(i * 100);
return userSearchResult;
}


Loading…
Cancel
Save