Skip to content

Remove Servlet Spec 2.5 Support for SecurityContextHolderAwareRequestFilter #6260

Closed

Description

@jzheaux

Related to #6220

SecurityContextHolderAwareRequestFilter contains a condition which returns a different HttpServletRequestFactory based on whether the application is using Servlet Spec 3 or higher.

To support this, there are two request factories, one for servlet 2.5 called HttpServlet25RequestFactory and another called HttpServlet3RequestFactory.

These exist in order to expose additional features in Servlet 3, and also to return a version-specific implementation of SecurityContextHolderAwareRequestWrapper.

Since Spring Framework 5.x has a baseline of Servlet Spec 3.1, the if condition, and HttpServlet25RequestFactory are no longer necessary and we should remove them.

For now, we shouldn't move Servlet3SecurityContextHolderAwareRequestWrapper's functionality up into SecurityContextHolderAwareRequestWrapper since it is reliant on private state in HttpServlet3RequestFactory.

Activity

  1. added this to the 5.2.0.M1 milestone on Dec 7, 2018
  2. dongmyo commented on Dec 14, 2018

    @dongmyo
    Contributor

    @jzheaux
    what about changing HttpServlet3RequestFactory to the default implementation of HttpServletRequestFactory and moving Servlet3SecurityContextHolderAwareRequestWrapper's functionality up into SecurityContextHolderAwareRequestWrapper?

  3. jzheaux commented on Dec 14, 2018

    @jzheaux
    CollaboratorAuthor

    Good question, this was my thought originally as well.

    But, the reason to not do that yet is that Servlet3SecurityContextHolderAwareRequestWrapper depends on private state in HttpServlet3RequestFactory, like an authenticationEntryPoint. To move the functionality would also mean to move that configuration, which is a bigger task than simply dropping support for Servlet 2.5.

    I'm open to a proposal if you have a better way to do that, but I suspect we'll want to do it in a separate task.

  4. dongmyo commented on Dec 14, 2018

    @dongmyo
    Contributor

    @jzheaux okay, i totally understand what you mean now.
    thank you.

  5. added a commit that references this issue on Dec 17, 2018
    733a380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions