handavid opened a new pull request, #1522:
URL: https://github.com/apache/knox/pull/1522

   [KNOX-3585](https://issues.apache.org/jira/browse/KNOX-3585) - Optimize 
roles retrieval
   
   ## What changes were proposed in this pull request?
   
   Track the number of roles last seen by the LDAPRolesLookupInterceptor. If 
the number of entries is larger than the number of roles, then retrieve all 
roles. If the number of entries is smaller than the number of roles, then 
retrieve the roles for each entry through the roles lookup API.
   
   Add a @VisibleForTesting setNumRoles seam so tests can pin which strategy 
handleSearch selects, and cover the list strategy (listRoles plus one 
lookupRoleAssignees per role) added for large result sets: user and group role 
resolution, dedup, id lowercasing, per-role failure handling, and the numRoles 
threshold flipping a later smaller search back to the lookup path.
   
   ## How was this patch tested?
   
   Ran updated unit tests
   Ran workflow tests, workflow tests with role lookup, and workflow tests with 
rest role lookup
   Manually tested against file-based role lookup by running multiple ldap 
searches for all users, single user, all groups
   
   ## Integration Tests
   
   Integration tests were run, but no new tests were implemented. This 
functionality results in the same output as before. It is better covered by the 
unit tests.
   
   ## UI changes
   
   No UI changes
   


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