Add ability to consume Manifest groups as Authorities
Notify: @bhill6 @ahoffmann @paul.erickson
Merge request reports
Activity
Build finished. Tests PASSED. Build results available at: https://ia-builds.doit.wisc.edu:8443/job/uw-spring-security-master-pull-requests/87/
Agree with @npblair's suggestion. Giving a conditional
with that change. Nice work!Added 1 commit:
- ebae124b - Add tests. Bump minor version.
Build finished. Tests PASSED. Build results available at: https://ia-builds.doit.wisc.edu:8443/job/uw-spring-security-master-pull-requests/88/
mentioned in commit 7c9c0655
87 88 uddsMembership = Collections.list(uddsHeaders); 88 89 } 89 90 String email = request.getHeader(emailAddressHeader); 90 UWUserDetailsImpl result = new UWUserDetailsImpl(pvi, uid, "", cn, email, uddsMembership); 91 Collection<String> manifestGroups = new ArrayList<>(); I realize I'm late to the party, but instead of allocating a new ArrayList just to discard it if manifestHeaders is not null (and it should be non-null), consider
final Collection<String> manifestGroups; Enumeration<String> manifestHeaders = request.getHeaders(manifestHeader); if (manifestHeaders != null) { manifestGroups = Collections.list(manifestHeaders); } else { manifestGroups = Collections.emptyList(); }
On the other hand, I wonder if a null result is a valid reason to freak out and throw an exception, since it means tomcat is blocking access. From the javadoc:
Returns: an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null