Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5211

Make CryptoMapper extendable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.8.0
    • 6.9.0, 7.0.0-M1
    • wicket
    • 3.8.0-21-generic x86_64 x86_64 x86_64 GNU/Linux
      Ubuntu 13.04 raring
      OpenJDK 1.7.0_21 64-Bit

    Description

      If one want to extends CryptoMapper and reuse the core logic in CryptoMapper, it is today not possible, since the below methods are private and not protected

      org.apache.wicket.core.request.mapper.CryptoMapper#encryptUrl(Url)
      org.apache.wicket.core.request.mapper.CryptoMapper#decryptUrl(Request, Url)

      These methods are used in the below and these are typically the one wanted to extends.

      org.apache.wicket.core.request.mapper.CryptoMapper#mapHandler(IRequestHandler)
      org.apache.wicket.core.request.mapper.CryptoMapper#mapRequest(Request

      ------------------------------------------
      Background for wanting to extends.
      ------------------------------------------
      I'm using url security constraint in my web.xml and I need to preserve the url prefix when encrypting the url with CryptoMapper.

      Example:

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>example-wicket</web-resource-name>
      <url-pattern>/user/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
      <description>These are the roles who have access.</description>
      <role-name>ROLE_USER</role-name>
      <role-name>ROLE_ADMIN</role-name>
      </auth-constraint>
      </security-constraint>

      I used to mount pages with mountPage("/user/" + Foo.class.getSimpleName(), Foo.class);

      which resulted in URL: http://localhost:8080/example-wicket/user/Foo

      now I would like to decrypt Foo and it's possible page parameters, but not 'user', e.g.

      http://localhost:8080/example-wicket/user/o9SSJ_GJqmO_wPa3pBY9hhdoDOXrAjrVc8kgLXVijrc6zKG3_zokAWSik-hyrZBXM4h5Qc2JOn0WfAGPQo8eYA/o9Sc8/Jqme5/9SS98

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            magnus.k.karlsson Magnus K Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified