Skip to content
Snippets Groups Projects

Add ability to consume Manifest groups as Authorities

Merged Benjamin Sousa requested to merge bjsousa/uw-spring-security:consume_manifest into master

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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

Please register or sign in to reply
Loading