[ 
https://issues.apache.org/jira/browse/WSS-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657819#action_12657819
 ] 

Colm O hEigeartaigh commented on WSS-154:
-----------------------------------------


Hi Guillaume,

thanks for your patch, the changes seems largely fine to me. I have a few 
concerns though before I merge it:

 - First off any new functionality needs to be unit tested. See 
test/wssec/TestWSSecurityUserProcessor for some tests on customer processors, 
if you could add some similar testing that'd be great.

 - I think the cast below will throw a NPE when a processor instance isn't 
found, rather than return null:

   +        // Try the instances Map (will return null if nothing found)
   +        return (Processor) this.processorInstanceMap.get(el);

 - Rather than injecting WSSConfig into WSHandler, why not just follow the 
pattern with "doSenderAction" and get the WSSConfig object from RequestData? 
e.g.

    WSSConfig wssConfig = reqData.getWssConfig();
        if (wssConfig == null) {
            wssConfig = WSSConfig.getNewInstance();
        }

Colm.

    


> Allow WSSConfig injection in WSHandler and improve WSSConfig for injection of 
> Processors instances
> --------------------------------------------------------------------------------------------------
>
>                 Key: WSS-154
>                 URL: https://issues.apache.org/jira/browse/WSS-154
>             Project: WSS4J
>          Issue Type: Improvement
>          Components: WSS4J Core
>         Environment: Apache CXF 2.1.3, with Spring based configuration
>            Reporter: Guillaume Sauthier
>            Assignee: Ruchith Udayanga Fernando
>         Attachments: wss4j.patch
>
>
> Hi
> I've worked on WSS4J to allow Processor configuration.
> In CXF, security interceptor (based on WSS4J) are configured using a Spring 
> configuration file.
> In my case, I wanted to add a Processor to handle my specific security token.
> In the current WSS4J, there is an extension mechanism 
> (WSSConfig.setProcessor(QName, String)), but it doesn't accept a Processor 
> instance, instead it nderstand a Processor classname tht will be instanciated.
> I need to have a Processor instance instead because my Processor is itself 
> configured with Spring.
> So I propose a patch that change WSSConfig with a new method 
> setProcessorInstances(Map<QName, Processor>).
> I've also changed the WSHandler.doReceiveAction method because it was 
> creating a new WSSConfig instance each time it's invoked.
> So in my change, a WSSConfig instance (configured with my map of Processors 
> instances) can be injected (WSHandler.setWssConfig) in WSHandler.
> So, in doReceiveAction, it will use that WSSConfig instead of creating a new 
> one each time. If the wssConfig has not been injected, it recreates a new 
> one, like the old behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to