You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Magnus K Karlsson (JIRA)" <ji...@apache.org> on 2013/05/29 07:54:21 UTC

[jira] [Created] (WICKET-5211) Make CryptoMapper extendable

Magnus K Karlsson created WICKET-5211:
-----------------------------------------

             Summary: Make CryptoMapper extendable
                 Key: WICKET-5211
                 URL: https://issues.apache.org/jira/browse/WICKET-5211
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 6.8.0
         Environment: 3.8.0-21-generic x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 13.04 raring
OpenJDK 1.7.0_21 64-Bit
            Reporter: Magnus K Karlsson
            Priority: Minor


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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira