alephdata / aleph

Search and browse documents and data; find the people and companies you look for.
http://docs.aleph.occrp.org
MIT License
2k stars 267 forks source link

BUG: UI constructs excessively long URLs #3820

Closed tillprochaska closed 1 month ago

tillprochaska commented 1 month ago

Describe the bug The auto-suggest input in the collection access control dialog uses the /roles/_suggest API. To not suggest users that already have access to the collection, the UI passes the IDs of all users and groups that already have access as a query parameter:

Given a collection that is already shared with users 1, 2, and 3, the API URL would look something like this:

/roles/_suggest?prefix=jane.doe&exclude:id=1&exclude_id=2&exclude:id=3

To Reproduce Steps to reproduce the behavior:

  1. Create a large number of groups (250+) and add yourself to these groups. You can also temporarily reduce the Gunicorn request line limit and will experience the issue with a lower number of groups.
  2. Navigate to a collection and open the sharing settings from the settings dropdown.
  3. Click on "Choose a user" and start typing"
  4. Observe the API requests the UI sends in the browser developer tools network tab. You should see requests to /api/2/roles/_suggest with one exclude:id query parameter for every group your user is part of. If the total length of the request URI exceeds the Gunicorn limits, the request will fail.

Expected behavior The auto-suggest input should work even for users that are members of many groups.

Aleph version 3.15.7, 3.4.0-rc*

Screenshots image

Additional context