Copilot commented on code in PR #1534:
URL: https://github.com/apache/knox/pull/1534#discussion_r4647593033
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/backend/LdapProxyBackend.java:
##########
@@ -648,6 +657,46 @@ private static String
resolvedMatchingRuleOid(SchemaManager schemaManager, Match
return oid != null &&
schemaManager.getMatchingRuleRegistry().contains(oid) ? oid : null;
}
+ /**
+ * Returns the remote attribute's equality matching rule OID when the
bundled schema can resolve it.
+ * When the remote type declares no equality, or one the bundled schema
does not know, this falls
+ * back to octetStringMatch rather than leaving the attribute without an
equality rule: a strict
+ * schema cannot evaluate an equality filter against an attribute that has
none, so without the
+ * fallback the imported attribute would register but be unusable in
equality assertions. This
+ * mirrors the octet string syntax fallback, and matches the convention
used for the bundled
+ * octet-string attribute types (e.g. objectGUID).
+ */
+ private String resolvedEqualityOid(SchemaManager schemaManager,
AttributeType remoteType) {
+ final String resolved = resolvedMatchingRuleOid(schemaManager,
remoteType.getEquality(), remoteType.getEqualityOid());
+ if (resolved != null) {
+ return resolved;
+ }
+ LOG.ldapRemoteAttributeEqualityFallback(getName(),
remoteType.getName(), String.valueOf(remoteType.getEqualityOid()));
+ return OCTET_STRING_MATCH_OID;
Review Comment:
The new DirectoryString test checks registration and rule OIDs, but never
exercises values under the octet-string equality rule.
`RemoteSchemaConverter.copyAttribute()` uses schema-aware `contains`/`add`, so
value loss or incorrect deduplication in this combination would go undetected.
Add a behavioral regression that copies multiple distinct strings (including
non-ASCII), verifies unchanged values and duplicate handling, and
parses/serializes an equality filter without changing its assertion value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]