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

   …ervice
   
   [KNOX-3570](https://issues.apache.org/jira/browse/KNOX-3570) - Make the 
roles lookup in the auth service optional per principal with a configurable 
pattern
   
   ## What changes were proposed in this pull request?
   
   When the identity assertion provider hasn't already done the roles lookup 
(`ROLES_LOOKUP_EXECUTED` isn't set), `AbstractAuthResource.lookupRoles()` calls 
`LDAPRolesLookupService` for every principal on every pre-auth/ext-authz check. 
With the REST-backed `RestApiLdapRolesLookup`, every request makes an uncached 
cross-cluster REST call, LDAP users included.
   
   This adds a new service parameter, `preauth.roles.lookup.principal.pattern`:
   - When it's set, the roles lookup runs only for principals that fully match 
the regex. Use `|` for multiple alternatives, e.g. 
`system:serviceaccount:.*|svc-.*`, the same way as 
`group.lookup.skip.principal.pattern`.
   - Principals that don't match skip the lookup and get their groups only.
   - When it's not set or blank, every principal is looked up as before.
   
   ## How was this patch tested?
   
   New unit tests in `PreAuthResourceTest` cover these cases:
   - pattern not set
   - blank pattern
   - principal matches
   - principal matches one alternative of a `|` pattern
   - principal doesn't match
   - principal only partially matches
   


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