Spring Security
  1. Spring Security
  2. SEC-1596

Make SecurityContextHolderStrategy implementations extendable

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.1.0.M2
    • Component/s: Core
    • Labels:
      None

      Description

      We need to update SLF4J'S MDC with information from the current Authentication object.
      For this we've developed a ThreadLocal based SecurityContextHolderStrategy which updates the MDC as required.

      Unfortunately all implementations of SecurityContextHolderStrategy are final and package-private and therefore not open for extension. We had to copy and paste the code from ThreadLocalSecurityContextHolderStrategy.

      I don't know if there's any good reason for that - if not it would be very handy for developers, who need to provide their own implementations, to make these classes extendable.

        Activity

        Hide
        Johannes Scharf added a comment -

        This also applies to Spring Security 2.0.6.

        Show
        Johannes Scharf added a comment - This also applies to Spring Security 2.0.6.
        Hide
        Luke Taylor added a comment -

        The intended integration point here is the interface. The implementations are all very simple so I don't really think there's a lot to be gained by making them public and encouraging inheritance.

        Show
        Luke Taylor added a comment - The intended integration point here is the interface. The implementations are all very simple so I don't really think there's a lot to be gained by making them public and encouraging inheritance.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Johannes Scharf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: