daml icon indicating copy to clipboard operation
daml copied to clipboard

Allow to list all users in the Java bindings

Open stefanobaghino-da opened this issue 3 years ago • 1 comments

Affected Daml version

2.0.0+

Bug description

The listUsers method in the UserManagementService doesn't allow to take a token and page size to take advantage of the pagination. As such, users are limited to retrieving the first page, which is currently limited to 1000 users.

Expected behavior

The listUsers method allows to retrieve all users.

Additional context

In order to avoid breaking existing code, the current method can be adapted into listing and retrieving all users while marking it as deprecated and adding the possibility of using pagination to retrieve all users.

The default for server-side user pagination is defined here: https://github.com/digital-asset/daml/blob/56306eb387c2f61dbd255f6f80b6a70e7db6e8c4/ledger/participant-integration-api/src/main/scala/platform/usermanagement/PersistentUserManagementStore.scala#L33

The semantics of calls to ListUsers on the Ledger API are described here: https://github.com/digital-asset/daml/blob/56306eb387c2f61dbd255f6f80b6a70e7db6e8c4/ledger-api/grpc-definitions/com/daml/ledger/api/v1/admin/user_management_service.proto#L175-L187

The current implementation is here: https://github.com/digital-asset/daml/blob/56306eb387c2f61dbd255f6f80b6a70e7db6e8c4/language-support/java/bindings-rxjava/src/main/java/com/daml/ledger/rxjava/grpc/UserManagementClientImpl.java#L92-L98

stefanobaghino-da avatar Jun 13 '22 16:06 stefanobaghino-da

orignal convo: https://discuss.daml.com/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/3?u=stephenott

StephenOTT avatar Jun 13 '22 16:06 StephenOTT