You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Alessio Soldano (Created) (JIRA)" <ji...@apache.org> on 2012/01/23 16:29:39 UTC

[jira] [Created] (CXF-4052) Crypto cache issues due and the PolicyBasedWSS4JInInterceptor used as a singleton

Crypto cache issues due and the PolicyBasedWSS4JInInterceptor used as a singleton
---------------------------------------------------------------------------------

                 Key: CXF-4052
                 URL: https://issues.apache.org/jira/browse/CXF-4052
             Project: CXF
          Issue Type: Bug
          Components: WS-* Components
    Affects Versions: 2.4.5
         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
            Reporter: Alessio Soldano


When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
{code}
...
this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
...
{code}

which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.

If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh reassigned CXF-4052:
----------------------------------------

    Assignee: Colm O hEigeartaigh
    
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Alessio Soldano (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alessio Soldano updated CXF-4052:
---------------------------------

    Summary: Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton  (was: Crypto cache issues due and the PolicyBasedWSS4JInInterceptor used as a singleton)
    
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Alessio Soldano (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alessio Soldano updated CXF-4052:
---------------------------------

    Fix Version/s: 2.6

Added 2.6 fix version (as it's committed on trunk too)
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5, 2.5.2
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>             Fix For: 2.4.7, 2.5.3, 2.6
>
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated CXF-4052:
-------------------------------------

    Attachment: cxf-4052.patch

Hi Alessio,

See attached for a patch for this issue against trunk. If you could review it and test it, that'd be great.

The basic idea is to override the way Crypto objects are loaded and cached in WSHandler. When Crypto objects are loaded via a property filename, we use the full path of the file as the key of the cache, rather than just the filename.

Colm.
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>         Attachments: cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Alessio Soldano (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193908#comment-13193908 ] 

Alessio Soldano commented on CXF-4052:
--------------------------------------

Hi Colm,
thanks for having worked on this. Unfortunately, I think the patch is not enough to solve the issue. AFAICS, AbstractWSS4JInterceptor::loadCrypto(...) still first tries looking up the Crypto using the refId that comes from the requestData message context ("RefId-bob.properties" in my case). I think that is set in PolicyBasedWSS4JInInterceptor::computeAction(...) when using WS-Policy.
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>         Attachments: cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205476#comment-13205476 ] 

Colm O hEigeartaigh commented on CXF-4052:
------------------------------------------

Hi Alessio,

I'll take care of the merge.

Colm.
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5, 2.5.2
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>             Fix For: 2.4.7, 2.5.3
>
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated CXF-4052:
-------------------------------------

    Affects Version/s: 2.5.2
        Fix Version/s: 2.5.3
                       2.4.7
    
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5, 2.5.2
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>             Fix For: 2.4.7, 2.5.3
>
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Alessio Soldano (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201435#comment-13201435 ] 

Alessio Soldano commented on CXF-4052:
--------------------------------------

Colm, are you still on this? I can probably trying providing a patch on my own unless you're already working on this.
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>         Attachments: cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Alessio Soldano (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205357#comment-13205357 ] 

Alessio Soldano commented on CXF-4052:
--------------------------------------

Hi Colm,
the patch is working, cool. I've merged it into 2.4.x branch to test it, let me know if you want me to commit or you're going ahead.
Thanks
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh resolved CXF-4052.
--------------------------------------

    Resolution: Fixed
    
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5, 2.5.2
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>             Fix For: 2.4.7, 2.5.3
>
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4052) Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

Posted by "Colm O hEigeartaigh (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated CXF-4052:
-------------------------------------

    Attachment: cxf-4052-2.patch


Here's a better attempt at solving this problem. The PolicyBasedWSS4JInInterceptor uses the URL of the Properties file as the cache key. No changes to WSS4J are required.

Colm.
                
> Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton
> -----------------------------------------------------------------------------
>
>                 Key: CXF-4052
>                 URL: https://issues.apache.org/jira/browse/CXF-4052
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.4.5
>         Environment: JBossWS-CXF integration, using Apache CXF 2.4.x
>            Reporter: Alessio Soldano
>            Assignee: Colm O hEigeartaigh
>         Attachments: cxf-4052-2.patch, cxf-4052.patch
>
>
> When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:
> {code}
> ...
> this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
> ...
> {code}
> which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
> Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
> So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.
> If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira