[
https://issues.apache.org/jira/browse/KNOX-3575?focusedWorklogId=1054781&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1054781
]
ASF GitHub Bot logged work on KNOX-3575:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Nov/26 18:17
Start Date: 14/Nov/26 18:17
Worklog Time Spent: 10m
Work Description: handavid opened a new pull request, #1514:
URL: https://github.com/apache/knox/pull/1514
[KNOX-3757](https://issues.apache.org/jira/browse/KNOX-3575) - LDAP Proxy
passes sizelimit to backend
## What changes were proposed in this pull request?
Thread the per-request size and time limits from the SearchOperationContext
through UserSearchInterceptor into the backends.
FileBackend respects sizeLimit by truncating results (timeLimit is not
applicable to its in-memory lookups). LdapProxyBackend forwards timeLimit to
the remote server on each page and enforces sizeLimit client-side, combined
with the configured maxResultSetSize (smaller positive bound wins).
A backward-compatible default search() overload delegates with no limits.
## How was this patch tested?
Ran updated unit tests.
Manually tested through ldapsearch with sizelimit against an Active
Directory backend with ~500 users
search w/o sizelimit for comparison
```
time ldapsearch -v -x -H ldap://localhost:3890 -D
'uid=bind2,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -e
"1.3.6.1.4.1.18060.18.0.1=AQH/" -b 'ou=people,DC=proxy,DC=com' -s sub
'(objectClass=inetOrgPerson)' '*'
...
# numResponses: 472
# numEntries: 470
ldapsearch -v -x -H ldap://localhost:3890 -D -w bind-password -E -e -b
-s 0.01s user 0.02s system 0% cpu 6.726 total
```
search w/ sizelimit 10 prior to this change
```
time ldapsearch -v -x -H ldap://localhost:3890 -z 10 -D
'uid=bind2,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -e
"1.3.6.1.4.1.18060.18.0.1=AQH/" -b 'ou=people,DC=proxy,DC=com' -s sub
'(objectClass=inetOrgPerson)' '*'
...
# numEntries: 10
ldapsearch -v -x -H ldap://localhost:3890 -z 10 -D -w bind-password -E -e
0.01s user 0.01s system 0% cpu 6.075 total
```
search w/ sizelimit 10 after this change
```
time ldapsearch -v -x -H ldap://localhost:3890 -z 10 -D
'uid=bind2,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -e
"1.3.6.1.4.1.18060.18.0.1=AQH/" -b 'ou=people,DC=proxy,DC=com' -s sub
'(objectClass=inetOrgPerson)' '*'
...
# numEntries: 10
ldapsearch -v -x -H ldap://localhost:3890 -z 10 -D -w bind-password -E -e
0.01s user 0.01s system 1% cpu 1.078 total
```
## Integration Tests
No integration tests were updated because this feature is not visible
through the integration tests (other than potentially execution time)
## UI changes
No UI changes
Issue Time Tracking
-------------------
Worklog Id: (was: 1054781)
Remaining Estimate: 0h
Time Spent: 10m
> LDAP Proxy passes size and time limits to backend
> -------------------------------------------------
>
> Key: KNOX-3575
> URL: https://issues.apache.org/jira/browse/KNOX-3575
> Project: Apache Knox
> Issue Type: Improvement
> Components: LDAP
> Affects Versions: 3.0.0
> Reporter: David Han
> Assignee: David Han
> Priority: Major
> Fix For: 3.1.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The backend search should also receive the sizelimit and timelimit parameters
> to limit search if the originating search request was limited. i.e., the
> backend shouldn't return all results if the search operation has a size limit
> of 10.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)