Qpid
  1. Qpid
  2. QPID-4297

Broker should not rely on Subject.getPrincipals.iterator().next() to find 'username principal'

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.19
    • Component/s: Java Broker
    • Labels:
      None

      Description

      The Broker uses the idiom Subject.getPrincipals.iterator().next() in a couple of places to find the principal corresponding to the username of the logged on user. This assumes that corresponding principal will always be returned first. This may not be a safe assumption across different JVM providers, different JVM versions or when running Qpid with a container.

      This should be replaced by our utility methods AuthenticatedPrincipal#getOptionalAuthenticatedPrincipalFromSubject and
      AuthenticatedPrincipal#getAuthenticatedPrincipalFromSubject

        Activity

        Hide
        Keith Wall added a comment -

        Patch applied, Robbie could you review please?

        Show
        Keith Wall added a comment - Patch applied, Robbie could you review please?
        Hide
        Robbie Gemmell added a comment -

        Looks good to me.

        Show
        Robbie Gemmell added a comment - Looks good to me.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Keith Wall
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development