[
https://issues.apache.org/jira/browse/KNOX-3604?focusedWorklogId=1056314&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1056314
]
ASF GitHub Bot logged work on KNOX-3604:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Nov/26 20:16
Start Date: 20/Nov/26 20:16
Worklog Time Spent: 10m
Work Description: handavid opened a new pull request, #1534:
URL: https://github.com/apache/knox/pull/1534
[KNOX-3604](https://issues.apache.org/jira/browse/KNOX-3604) - Give imported
remote attributes usable equality and ordering rules
## What changes were proposed in this pull request?
An imported remote attribute type that declares no equality or ordering
matching rule the bundled schema can resolve was registered with that rule left
null. A strict schema then rejects assertions on it: an equality filter cannot
be evaluated, and a range (>=, <=) filter fails to even parse with
ERR_13301_NO_ORDERING_MR_FOR_AT - which blocks Active Directory delta-sync
clients that filter with e.g. (uSNChanged>=N).
When the rule cannot be resolved, fall back to the octet-string matching
rules (octetStringMatch for equality, octetStringOrderingMatch for ordering)
instead of dropping it to null, mirroring the existing octet-string syntax
fallback and the bundled octet-string attribute types (e.g. objectGUID). The
ordering fallback is applied only when the bundled schema actually defines the
rule, so an environment without it keeps the previous behavior. The
octet-string rules compare raw bytes; the backend forwards the real comparison
to the remote server, which applies its own schema.
Add unit tests for both fallbacks, including one that reproduces the
delta-sync range filter that previously failed to parse, and document the
fallback in the extraAttributes section of service_ldap_server.md.
## How was this patch tested?
New unit tests were added to that parse a search filter with the imported
attribute using a range filter.
Manual tests were run against Active Directory using the `uSNChanged`
attribute. This previously failed with the error
ERR_13301_NO_ORDERING_MR_FOR_AT but now works.
```
ldapsearch -v -x -H ldap://localhost:3890 -D
'uid=bind,ou=people,dc=proxy,dc=com' -w bind-password -E pr=250/noprompt -b
'ou=people,DC=proxy,DC=com' -s sub
'(&(objectClass=inetOrgPerson)(|(modifyTimestamp>=20261115074418.0Z)(uSNChanged>=2337200000)))'
'*' '+'
```
## Integration Tests
No integration tests were added since the remote ldap has the same schema as
the ldap proxy.
## UI changes
No UI changes
Issue Time Tracking
-------------------
Worklog Id: (was: 1056314)
Remaining Estimate: 0h
Time Spent: 10m
> Imported remote attribute types support range matches
> -----------------------------------------------------
>
> Key: KNOX-3604
> URL: https://issues.apache.org/jira/browse/KNOX-3604
> Project: Apache Knox
> Issue Type: Improvement
> Components: LDAP
> Affects Versions: 3.1.0
> Reporter: David Han
> Assignee: David Han
> Priority: Major
> Fix For: 3.1.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> LdapProxyBackends can be configured to import extra attributes from the
> remote LDAP. These attribute types cannot be compared if the equality and
> ordering oid of the attribute type is null. For example, importing the
> "uSNChanged" attribute from Active Directory cannot be used in search filters
> with >= or <= like "(uSNChanged>=37510)".
> Augment the imported attributes with some equality and ordering oid if they
> are not provided by the remote schema.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)