Spring Security
  1. Spring Security
  2. SEC-1309

Namespace configurations should support Spring EL

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0 RC1
    • Fix Version/s: 3.0.0.RC2
    • Component/s: Namespace
    • Labels:
      None

      Description

      The security namespace is very useful for default configurations, but I would also like to be able to abstract it a little more and do something like the following:

      <http>
      <intercept-url pattern="/**" access="ROLE_USER" />

      <intercept-url pattern="#

      { systemProperties['image.dir'] + '/**' }

      " filters="none" />
      <intercept-url pattern="#

      { systemProperties['css.dir'] + '/**' }

      " filters="none" />
      <intercept-url pattern="#

      { systemProperties['js.dir'] + '/**' }

      " filters="none" />

      <intercept-url pattern="#

      { '/' + systemProperties['login.page'] }" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https" />
      <form-login login-page="#{ '/' + systemProperties['login.page'] }

      " />

      <port-mappings>
      <port-mapping http=#

      { systemProperties['http.port'] }

      " https=#

      { systemProperties['https.port'] }

      " /> </port-mappings>

      <logout />
      </http>

      In other words, I would like to be able to configure some of this through properties referenced via Spring EL.

      Right now this doesn't work at all and I am forced to hand configure the required beans. This is not a major issue since I can get this to work, but long term, it makes maintenance harder since someone has to understand more about the underlying mechanics to be able to create the correct bean definitions.

        Activity

        Hide
        AngerClown added a comment -

        I realized I can use org.springframework.beans.factory.config.PropertyPlaceholderConfigurer to accomplish what I needed.

        However, I am wondering if Spring EL would still be generally useful for the configuration.

        Show
        AngerClown added a comment - I realized I can use org.springframework.beans.factory.config.PropertyPlaceholderConfigurer to accomplish what I needed. However, I am wondering if Spring EL would still be generally useful for the configuration.
        Hide
        Luke Taylor added a comment -

        As far as I can see, the reason EL configuration in URL paths was failing was due to the conversion of the path to lower case. I've removed the code that does this and added some tests.

        Show
        Luke Taylor added a comment - As far as I can see, the reason EL configuration in URL paths was failing was due to the conversion of the path to lower case. I've removed the code that does this and added some tests.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: