tapis-project / authenticator

BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Update ldap module to return zero records when offset exceeds collection size #68

Closed joestubbs closed 4 months ago

joestubbs commented 4 months ago

This issue describes a change to the behavior of the limit and offset paging query parameters in the Profiles API so that, whenever an offset value is sent that is larger that the size of the collection, no records are returned.

Currently, whenever an offset larger than the collection was sent, the query would "wrap" around and send results from the start of the collection. For example, in the dev tenant on a local checkout, a curl with limit of 2 and offset of 12 results in two records returned (the first two in the list):

`curl -H "x-tapis-token: $tok" 'localhost:5000/v3/oauth2/profiles?limit=2&offset=12'|jq

{ "message": "Profiles retrieved successfully.", "metadata": {}, "result": [ { "create_time": null, "dn": "cn=testuser1,ou=tenants.dev,dc=tapis", "email": "testuser1@test.tapis.io", "given_name": "testuser1", "last_name": "testuser1", "mobile_phone": null, "phone": null, "uid": null, "username": "testuser1" }, { "create_time": null, "dn": "cn=testuser2,ou=tenants.dev,dc=tapis", "email": "testuser2@test.tapis.io", "given_name": "testuser2", "last_name": "testuser2", "mobile_phone": null, "phone": null, "uid": null, "username": "testuser2" } ], "status": "success", "version": "dev" } `

We want to change the behavior so that 0 records are returned, i.e.:

`curl -H "x-tapis-token: $tok" 'localhost:5000/v3/oauth2/profiles?limit=2&offset=12'|jq

{ "message": "Profiles retrieved successfully.", "metadata": {}, "result": [], "status": "success", "version": "dev" }

`

joestubbs commented 4 months ago

Released as part of 1.6.1