maheshbandal15 opened a new pull request, #1156:
URL: https://github.com/apache/ranger/pull/1156

   ## What changes were proposed in this pull request?
   
   Align case-insensitive folding in RangerResourceTrie with the folding used 
by resource matchers.
   
   When ignoreCase is enabled, the resource trie indexes child nodes using 
getLookupChar(), while policy resource matching uses 
StringUtils.equalsIgnoreCase() (equivalent to String.regionMatches(true, …)). 
Those two paths did not use the same Unicode case fold:
   
   Trie lookup (before): Character.toLowerCase(ch)
   Matchers: upper-case, then lower-case (equalsIgnoreCase semantics)
   For some Unicode characters these folds diverge (for example i / ı, s / ſ, 
and other BMP equivalents). The trie could route a request to a different 
branch than the matcher would treat as equal, so candidate policy evaluators 
returned from trie pre-filtering could be incomplete relative to full matcher 
evaluation.
   
   This change updates getLookupChar() to use 
Character.toLowerCase(Character.toUpperCase(ch)) when ignoreCase is true, 
matching the matcher’s ignore-case behavior. Case-sensitive resources are 
unchanged.
   
   
   ## How was this patch tested?
   
   New unit tests (TestRangerResourceTrieCaseFolding):
   * Documents Unicode pairs where equalsIgnoreCase and plain toLowerCase differ
   * Confirms RangerDefaultResourceMatcher treats equivalent Unicode variants 
as matches
   * Verifies trie lookup returns the expected evaluators for case-variant 
resources at branch boundaries
   * Covers single-character resources, sibling-branch splits, wildcard + 
exact-resource combinations, ASCII regression, compressed trie nodes, and 
bidirectional lookup (i <--> ı)
   
   Manual verification: Built ranger locally using mvn clean install; all 
targeted and related tests pass.
   


-- 
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]

Reply via email to