Skip to content

Knox-3386: LDAP Proxy pages backends - #1332

Closed
handavid wants to merge 2 commits into
apache:v3.0.0from
handavid:ldap-paging-v3.0.0
Closed

Knox-3386: LDAP Proxy pages backends#1332
handavid wants to merge 2 commits into
apache:v3.0.0from
handavid:ldap-paging-v3.0.0

Conversation

@handavid

Copy link
Copy Markdown
Contributor

KNOX-3386 - LDAP Proxy pages backends

What changes were proposed in this pull request?

Adds a gateway.ldap.max.size.limit and max.time.limit configs to the LDAP Proxy. Thes configs are uses to set the LDAP server's maxSizeLimit and maxTimeLimit fields. The size limit indictes the maximum total number of search results for a request across all pages. The time limit is in milliseconds.

Implements paging to the backend LDAP servers. This is controlled by a new "pageSize" config on the LDAP Proxy Backends.

A bug was found during testing where the getUserGroups method will doubly retrieve the groups. This has been fixed.

How was this patch tested?

(Please explain how this patch was tested. For instance: running automated unit/integration tests, manual tests. Please write down your test steps as detailed as possible)

Unit tests were added/updated in LdapProxyBackendTest and LdapProxyBackendSslTest

manual testing was performed against AD by setting the following values in the gateway-site.xml

<property>
    <name>gateway.ldap.sizelimit</name>
    <value>5000</value>
    <description>Base DN for LDAP entries in the proxy server. Default is dc=proxy,dc=com.</description>
</property>

<property>
    <name>gateway.ldap.interceptor.localldap.pageSize</name>
    <value>3</value>
</property>
<property>
    <name>gateway.ldap.interceptor.ad.pageSize</name>
    <value>3</value> 
</property>

Logging was increased to DEBUG level to see the paging-related log messages.

Integration Tests

(Please add or update integration tests .github/workflows/tests for the feature you are adding. If no unit test is added, please explain why. Check out .github/workflows/tests/README.md for instructions)

The gateway-site was modified for the workflow tests to set a small page size. This ensure that the proxy needs to page to return the results in the tests.

UI changes

none

Adds a gateway.ldap.max.size.limit and max.time.limit configs to the
LDAP Proxy. Thes configs are uses to set the LDAP server's maxSizeLimit
and maxTimeLimit fields. The size limit indictes the maximum total number
of search results for a request across all pages. The time limit is in
milliseconds.

Implements paging to the backend LDAP servers. This is controlled
by a new "pageSize" config on the LDAP Proxy Backends.

A bug was found during testing where the getUserGroups method will
doubly retrieve the groups. This has been fixed.
@handavid

Copy link
Copy Markdown
Contributor Author

@smolnar82

@github-actions

Copy link
Copy Markdown

Test Results

40 tests   40 ✅  5s ⏱️
 3 suites   0 💤
 3 files     0 ❌

Results for commit 4c23e47.

@handavid

Copy link
Copy Markdown
Contributor Author

closing since pr is identical to #1331. commit will be cherry-picked directly after that PR is merged

@handavid handavid closed this Jul 31, 2026
@handavid
handavid deleted the ldap-paging-v3.0.0 branch July 31, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant