Modified: axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/RampartMessageData.java.html URL: http://svn.apache.org/viewvc/axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/RampartMessageData.java.html?rev=1725383&r1=1725382&r2=1725383&view=diff ============================================================================== --- axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/RampartMessageData.java.html (original) +++ axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/RampartMessageData.java.html Mon Jan 18 23:07:55 2016 @@ -26,12 +26,14 @@ import org.apache.axis2.description.Para import org.apache.axis2.engine.AxisConfiguration; import org.apache.axis2.util.PolicyUtil; import org.apache.axis2.wsdl.WSDLConstants; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; import org.apache.neethi.PolicyComponent; import org.apache.neethi.PolicyEngine; import org.apache.rahas.RahasConstants; import org.apache.rahas.SimpleTokenStore; import org.apache.rahas.TokenStorage; +import org.apache.rampart.handler.RampartUsernameTokenValidator; import org.apache.rampart.handler.WSSHandlerConstants; import org.apache.rampart.policy.RampartPolicyBuilder; import org.apache.rampart.policy.RampartPolicyData; @@ -46,6 +48,7 @@ import org.apache.ws.secpolicy.WSSPolicy import org.apache.ws.security.SOAPConstants; import org.apache.ws.security.WSConstants; import org.apache.ws.security.WSSConfig; +import org.apache.ws.security.WSSecurityEngine; import org.apache.ws.security.WSSecurityEngineResult; import org.apache.ws.security.WSSecurityException; import org.apache.ws.security.conversation.ConversationConstants; @@ -58,6 +61,7 @@ import org.apache.ws.security.util.WSSec import org.w3c.dom.Document; import java.util.ArrayList; +import java.util.Collection; import java.util.List; public class RampartMessageData { @@ -113,17 +117,17 @@ public class RampartMessageData { public final static String X509_CERT ="X509Certificate"; -<span class="fc" id="L116"> private MessageContext msgContext = null;</span> +<span class="fc" id="L120"> private MessageContext msgContext = null;</span> -<span class="fc" id="L118"> private RampartPolicyData policyData = null;</span> +<span class="fc" id="L122"> private RampartPolicyData policyData = null;</span> -<span class="fc" id="L120"> private WSSecHeader secHeader = null;</span> +<span class="fc" id="L124"> private WSSecHeader secHeader = null;</span> -<span class="fc" id="L122"> private WSSConfig config = null;</span> +<span class="fc" id="L126"> private WSSConfig config = null;</span> -<span class="fc" id="L124"> private int timeToLive = 300;</span> +<span class="fc" id="L128"> private int timeToLive = 300;</span> -<span class="fc" id="L126"> private int timestampMaxSkew = 0;</span> +<span class="fc" id="L130"> private int timestampMaxSkew = 0;</span> private String timestampId; @@ -139,9 +143,9 @@ public class RampartMessageData { * RahasConstants.VERSION_05_12 */ -<span class="fc" id="L142"> private int wstVersion = RahasConstants.VERSION_05_12;</span> +<span class="fc" id="L146"> private int wstVersion = RahasConstants.VERSION_05_12;</span> -<span class="fc" id="L144"> private int secConvVersion = ConversationConstants.VERSION_05_12;</span> +<span class="fc" id="L148"> private int secConvVersion = ConversationConstants.VERSION_05_12;</span> /* * IssuedTokens or SecurityContextTokens can be used @@ -165,58 +169,64 @@ public class RampartMessageData { private SOAPConstants soapConstants; -<span class="fc" id="L168"> public RampartMessageData(MessageContext msgCtx, boolean sender) throws RampartException {</span> +<span class="fc" id="L172"> public RampartMessageData(MessageContext msgCtx, boolean sender) throws RampartException {</span> -<span class="fc" id="L170"> this.msgContext = msgCtx;</span> +<span class="fc" id="L174"> this.msgContext = msgCtx;</span> try { + + // Set the WSSConfig +<span class="fc" id="L179"> this.config = WSSConfig.getNewInstance();</span> + + //Update the UsernameToken validator +<span class="fc" id="L182"> this.config.setValidator(WSSecurityEngine.USERNAME_TOKEN, RampartUsernameTokenValidator.class);</span> // First obtain the axis service as we have to do a null check, there can be situations // where Axis Service is null -<span class="fc" id="L176"> AxisService axisService = msgCtx.getAxisService(); </span> +<span class="fc" id="L186"> AxisService axisService = msgCtx.getAxisService(); </span> -<span class="pc bpc" id="L178" title="1 of 4 branches missed."> if(axisService != null && axisService.getParameter(PARAM_CLIENT_SIDE) != null) {</span> -<span class="fc" id="L179"> this.isInitiator = true;</span> +<span class="pc bpc" id="L188" title="1 of 4 branches missed."> if(axisService != null && axisService.getParameter(PARAM_CLIENT_SIDE) != null) {</span> +<span class="fc" id="L189"> this.isInitiator = true;</span> } else { -<span class="fc bfc" id="L181" title="All 2 branches covered."> this.isInitiator = !msgCtx.isServerSide();</span> +<span class="fc bfc" id="L191" title="All 2 branches covered."> this.isInitiator = !msgCtx.isServerSide();</span> //TODO if Axis Service is null at this point, do we have to create a dummy one ?? -<span class="pc bpc" id="L183" title="1 of 4 branches missed."> if(this.isInitiator && axisService != null ) {</span> -<span class="fc" id="L184"> Parameter clientSideParam = new Parameter();</span> -<span class="fc" id="L185"> clientSideParam.setName(PARAM_CLIENT_SIDE);</span> -<span class="fc" id="L186"> clientSideParam.setLocked(true);</span> -<span class="fc" id="L187"> msgCtx.getAxisService().addParameter(clientSideParam);</span> +<span class="pc bpc" id="L193" title="1 of 4 branches missed."> if(this.isInitiator && axisService != null ) {</span> +<span class="fc" id="L194"> Parameter clientSideParam = new Parameter();</span> +<span class="fc" id="L195"> clientSideParam.setName(PARAM_CLIENT_SIDE);</span> +<span class="fc" id="L196"> clientSideParam.setLocked(true);</span> +<span class="fc" id="L197"> msgCtx.getAxisService().addParameter(clientSideParam);</span> } } -<span class="fc bfc" id="L191" title="All 2 branches covered."> if(msgCtx.getProperty(KEY_RAMPART_POLICY) != null) {</span> -<span class="fc" id="L192"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_POLICY);</span> +<span class="fc bfc" id="L201" title="All 2 branches covered."> if(msgCtx.getProperty(KEY_RAMPART_POLICY) != null) {</span> +<span class="fc" id="L202"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_POLICY);</span> } // Checking which flow we are in -<span class="fc" id="L197"> int flow = msgCtx.getFLOW();</span> +<span class="fc" id="L207"> int flow = msgCtx.getFLOW();</span> // If we are IN flow or IN_FAULT flow and the KEY_RAMPART_IN_POLICY is set , we set the // merge that policy to the KEY_RAMPART_POLICY if it is present. Else we set // KEY_RAMPART_IN_POLICY as the service policy -<span class="pc bpc" id="L202" title="1 of 6 branches missed."> if ( (flow == MessageContext.IN_FLOW || flow == MessageContext.IN_FAULT_FLOW ) </span> +<span class="pc bpc" id="L212" title="1 of 6 branches missed."> if ( (flow == MessageContext.IN_FLOW || flow == MessageContext.IN_FAULT_FLOW ) </span> && msgCtx.getProperty(KEY_RAMPART_IN_POLICY) != null) { -<span class="nc bnc" id="L204" title="All 2 branches missed."> if ( this.servicePolicy == null ) {</span> -<span class="nc" id="L205"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_IN_POLICY);</span> +<span class="nc bnc" id="L214" title="All 2 branches missed."> if ( this.servicePolicy == null ) {</span> +<span class="nc" id="L215"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_IN_POLICY);</span> } else { -<span class="nc" id="L207"> this.servicePolicy = this.servicePolicy.merge((Policy)msgCtx</span> +<span class="nc" id="L217"> this.servicePolicy = this.servicePolicy.merge((Policy)msgCtx</span> .getProperty(KEY_RAMPART_IN_POLICY)); } // If we are OUT flow or OUT_FAULT flow and the KEY_RAMPART_OUT_POLICY is set , we set // the merge that policy to the KEY_RAMPART_POLICY if it is present. Else we set // KEY_RAMPART_OUT_POLICY as the service policy -<span class="pc bpc" id="L214" title="1 of 6 branches missed."> } else if ( (flow == MessageContext.OUT_FLOW || flow == MessageContext.OUT_FAULT_FLOW ) </span> +<span class="pc bpc" id="L224" title="1 of 6 branches missed."> } else if ( (flow == MessageContext.OUT_FLOW || flow == MessageContext.OUT_FAULT_FLOW ) </span> && msgCtx.getProperty(KEY_RAMPART_OUT_POLICY) != null) { -<span class="nc bnc" id="L216" title="All 2 branches missed."> if (this.servicePolicy == null) {</span> -<span class="nc" id="L217"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_OUT_POLICY);</span> +<span class="nc bnc" id="L226" title="All 2 branches missed."> if (this.servicePolicy == null) {</span> +<span class="nc" id="L227"> this.servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_OUT_POLICY);</span> } else { -<span class="nc" id="L219"> this.servicePolicy = this.servicePolicy.merge((Policy)msgCtx</span> +<span class="nc" id="L229"> this.servicePolicy = this.servicePolicy.merge((Policy)msgCtx</span> .getProperty(KEY_RAMPART_OUT_POLICY)); } } @@ -228,262 +238,250 @@ public class RampartMessageData { * If it is missing then try to obtain from the configuration files. */ -<span class="fc bfc" id="L231" title="All 2 branches covered."> if (this.servicePolicy == null) {</span> +<span class="fc bfc" id="L241" title="All 2 branches covered."> if (this.servicePolicy == null) {</span> try { -<span class="fc" id="L233"> this.servicePolicy = msgCtx.getEffectivePolicy();</span> -<span class="fc" id="L234"> } catch (NullPointerException e) {</span> +<span class="fc" id="L243"> this.servicePolicy = msgCtx.getEffectivePolicy();</span> +<span class="fc" id="L244"> } catch (NullPointerException e) {</span> //TODO remove this once AXIS2-4114 is fixed -<span class="pc bpc" id="L236" title="1 of 2 branches missed."> if (axisService != null) {</span> -<span class="fc" id="L237"> List<PolicyComponent> policyList = new ArrayList<PolicyComponent>();</span> -<span class="fc" id="L238"> policyList.addAll(axisService.getPolicySubject().getAttachedPolicyComponents());</span> -<span class="fc" id="L239"> AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();</span> -<span class="fc" id="L240"> policyList.addAll(axisConfiguration.getPolicySubject().getAttachedPolicyComponents());</span> -<span class="fc" id="L241"> this.servicePolicy = PolicyUtil.getMergedPolicy(policyList, axisService);</span> +<span class="pc bpc" id="L246" title="1 of 2 branches missed."> if (axisService != null) {</span> +<span class="fc" id="L247"> Collection<PolicyComponent> policyList = new ArrayList<PolicyComponent>();</span> +<span class="fc" id="L248"> policyList.addAll(axisService.getPolicySubject().getAttachedPolicyComponents());</span> +<span class="fc" id="L249"> AxisConfiguration axisConfiguration = axisService.getAxisConfiguration();</span> +<span class="fc" id="L250"> policyList.addAll(axisConfiguration.getPolicySubject().getAttachedPolicyComponents());</span> +<span class="fc" id="L251"> this.servicePolicy = PolicyUtil.getMergedPolicy(policyList, axisService);</span> } -<span class="fc" id="L243"> }</span> +<span class="fc" id="L253"> }</span> } -<span class="fc bfc" id="L246" title="All 2 branches covered."> if(this.servicePolicy == null) {</span> -<span class="fc" id="L247"> Parameter param = msgCtx.getParameter(RampartMessageData.KEY_RAMPART_POLICY);</span> -<span class="pc bpc" id="L248" title="1 of 2 branches missed."> if(param != null) {</span> -<span class="nc" id="L249"> OMElement policyElem = param.getParameterElement().getFirstElement();</span> -<span class="nc" id="L250"> this.servicePolicy = PolicyEngine.getPolicy(policyElem);</span> +<span class="pc bpc" id="L256" title="1 of 2 branches missed."> if(this.servicePolicy == null) {</span> +<span class="nc" id="L257"> Parameter param = msgCtx.getParameter(RampartMessageData.KEY_RAMPART_POLICY);</span> +<span class="nc bnc" id="L258" title="All 2 branches missed."> if(param != null) {</span> +<span class="nc" id="L259"> OMElement policyElem = param.getParameterElement().getFirstElement();</span> +<span class="nc" id="L260"> this.servicePolicy = PolicyEngine.getPolicy(policyElem);</span> } } -<span class="fc bfc" id="L254" title="All 2 branches covered."> if(this.servicePolicy != null){</span> -<span class="fc" id="L255"> List it = (List)this.servicePolicy.getAlternatives().next();</span> +<span class="pc bpc" id="L264" title="1 of 2 branches missed."> if(this.servicePolicy != null){</span> +<span class="fc" id="L265"> List<Assertion> it = this.servicePolicy.getAlternatives().next();</span> //Process policy and build policy data -<span class="fc" id="L258"> this.policyData = RampartPolicyBuilder.build(it);</span> +<span class="fc" id="L268"> this.policyData = RampartPolicyBuilder.build(it);</span> //Set the version -<span class="fc" id="L261"> setWSSecurityVersions(this.policyData.getWebServiceSecurityPolicyNS());</span> +<span class="fc" id="L271"> setWSSecurityVersions(this.policyData.getWebServiceSecurityPolicyNS());</span> } -<span class="fc bfc" id="L265" title="All 2 branches covered."> if(this.policyData != null) {</span> +<span class="pc bpc" id="L275" title="1 of 2 branches missed."> if(this.policyData != null) {</span> // Get the SOAP envelope as document, then create a security // header and insert into the document (Envelope) // WE SHOULD ONLY DO THE CONVERTION IF THERE IS AN APPLICABLE POLICY -<span class="fc" id="L270"> this.document = Axis2Util.getDocumentFromSOAPEnvelope(msgCtx.getEnvelope(), true);</span> -<span class="fc" id="L271"> msgCtx.setEnvelope((SOAPEnvelope)this.document.getDocumentElement());</span> +<span class="fc" id="L280"> this.document = Axis2Util.getDocumentFromSOAPEnvelope(msgCtx.getEnvelope(), true);</span> +<span class="fc" id="L281"> msgCtx.setEnvelope((SOAPEnvelope)this.document.getDocumentElement());</span> -<span class="fc" id="L273"> this.soapConstants = WSSecurityUtil.getSOAPConstants(this.document.getDocumentElement());</span> +<span class="fc" id="L283"> this.soapConstants = WSSecurityUtil.getSOAPConstants(this.document.getDocumentElement());</span> // Update the Rampart Config if RampartConfigCallbackHandler is present in the // RampartConfig -<span class="fc" id="L278"> RampartConfigCallbackHandler rampartConfigCallbackHandler = RampartUtil</span> +<span class="fc" id="L288"> RampartConfigCallbackHandler rampartConfigCallbackHandler = RampartUtil</span> .getRampartConfigCallbackHandler(msgCtx, policyData); -<span class="fc bfc" id="L281" title="All 2 branches covered."> if (rampartConfigCallbackHandler != null) {</span> -<span class="fc" id="L282"> rampartConfigCallbackHandler.update(policyData.getRampartConfig());</span> +<span class="fc bfc" id="L291" title="All 2 branches covered."> if (rampartConfigCallbackHandler != null) {</span> +<span class="fc" id="L292"> rampartConfigCallbackHandler.update(policyData.getRampartConfig());</span> } // Update TTL and max skew time -<span class="fc" id="L286"> RampartConfig policyDataRampartConfig = policyData.getRampartConfig();</span> -<span class="pc bpc" id="L287" title="1 of 2 branches missed."> if (policyDataRampartConfig != null) {</span> -<span class="fc" id="L288"> String timeToLiveString = policyDataRampartConfig.getTimestampTTL();</span> -<span class="pc bpc" id="L289" title="2 of 4 branches missed."> if (timeToLiveString != null && !timeToLiveString.equals("")) {</span> -<span class="fc" id="L290"> this.setTimeToLive(Integer.parseInt(timeToLiveString));</span> +<span class="fc" id="L296"> RampartConfig policyDataRampartConfig = policyData.getRampartConfig();</span> +<span class="fc bfc" id="L297" title="All 2 branches covered."> if (policyDataRampartConfig != null) {</span> +<span class="fc" id="L298"> String timeToLiveString = policyDataRampartConfig.getTimestampTTL();</span> +<span class="pc bpc" id="L299" title="2 of 4 branches missed."> if (timeToLiveString != null && !timeToLiveString.equals("")) {</span> +<span class="fc" id="L300"> this.setTimeToLive(Integer.parseInt(timeToLiveString));</span> } -<span class="fc" id="L293"> String maxSkewString = policyDataRampartConfig.getTimestampMaxSkew();</span> -<span class="pc bpc" id="L294" title="2 of 4 branches missed."> if (maxSkewString != null && !maxSkewString.equals("")) {</span> -<span class="fc" id="L295"> this.setTimestampMaxSkew(Integer.parseInt(maxSkewString));</span> +<span class="fc" id="L303"> String maxSkewString = policyDataRampartConfig.getTimestampMaxSkew();</span> +<span class="pc bpc" id="L304" title="2 of 4 branches missed."> if (maxSkewString != null && !maxSkewString.equals("")) {</span> +<span class="fc" id="L305"> this.setTimestampMaxSkew(Integer.parseInt(maxSkewString));</span> } } //Check for RST and RSTR for an SCT -<span class="fc" id="L300"> String wsaAction = msgContext.getWSAAction();</span> -<span class="fc bfc" id="L301" title="All 4 branches covered."> if(WSSHandlerConstants.RST_ACTON_SCT.equals(wsaAction)</span> +<span class="fc" id="L310"> String wsaAction = msgContext.getWSAAction();</span> +<span class="fc bfc" id="L311" title="All 4 branches covered."> if(WSSHandlerConstants.RST_ACTON_SCT.equals(wsaAction)</span> || WSSHandlerConstants.RSTR_ACTON_SCT.equals(wsaAction)) { //submissive version -<span class="fc" id="L304"> setTrustParameters();</span> -<span class="fc bfc" id="L305" title="All 4 branches covered."> }else if(WSSHandlerConstants.RST_ACTON_SCT_STANDARD.equals(wsaAction)</span> +<span class="fc" id="L314"> setTrustParameters();</span> +<span class="fc bfc" id="L315" title="All 4 branches covered."> }else if(WSSHandlerConstants.RST_ACTON_SCT_STANDARD.equals(wsaAction)</span> || WSSHandlerConstants.RSTR_ACTON_SCT_STANDARD.equals(wsaAction)) { //standard policy spec 1.2 -<span class="fc" id="L308"> setTrustParameters();</span> +<span class="fc" id="L318"> setTrustParameters();</span> } } -<span class="fc" id="L313"> this.sender = sender;</span> +<span class="fc" id="L323"> this.sender = sender;</span> -<span class="fc" id="L315"> OperationContext opCtx = this.msgContext.getOperationContext();</span> +<span class="fc" id="L325"> OperationContext opCtx = this.msgContext.getOperationContext();</span> -<span class="fc bfc" id="L317" title="All 4 branches covered."> if(!this.isInitiator && this.sender) {</span> +<span class="fc bfc" id="L327" title="All 4 branches covered."> if(!this.isInitiator && this.sender) {</span> //Get hold of the incoming msg ctx MessageContext inMsgCtx; -<span class="pc bpc" id="L320" title="1 of 6 branches missed."> if (opCtx != null</span> +<span class="pc bpc" id="L330" title="2 of 6 branches missed."> if (opCtx != null</span> && (inMsgCtx = opCtx .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE)) != null && msgContext.getProperty(WSHandlerConstants.RECV_RESULTS) == null) { -<span class="fc" id="L324"> msgContext.setProperty(WSHandlerConstants.RECV_RESULTS, </span> +<span class="fc" id="L334"> msgContext.setProperty(WSHandlerConstants.RECV_RESULTS, </span> inMsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS)); //If someone set the sct_id externally use it at the receiver -<span class="fc" id="L328"> msgContext.setProperty(SCT_ID, inMsgCtx.getProperty(SCT_ID));</span> +<span class="fc" id="L338"> msgContext.setProperty(SCT_ID, inMsgCtx.getProperty(SCT_ID));</span> } } -<span class="fc bfc" id="L332" title="All 4 branches covered."> if(this.isInitiator && !this.sender) {</span> +<span class="fc bfc" id="L342" title="All 4 branches covered."> if(this.isInitiator && !this.sender) {</span> MessageContext outMsgCtx; -<span class="pc bpc" id="L334" title="1 of 4 branches missed."> if (opCtx != null</span> +<span class="pc bpc" id="L344" title="1 of 4 branches missed."> if (opCtx != null</span> && (outMsgCtx = opCtx .getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)) != null) { //If someone set the sct_id externally use it at the receiver -<span class="fc" id="L339"> msgContext.setProperty(SCT_ID, outMsgCtx.getProperty(SCT_ID));</span> +<span class="fc" id="L349"> msgContext.setProperty(SCT_ID, outMsgCtx.getProperty(SCT_ID));</span> } } - - // Check whether RampartConfig is present -<span class="pc bpc" id="L344" title="1 of 4 branches missed."> if (this.policyData != null && this.policyData.getRampartConfig() != null) {</span> - -<span class="fc" id="L346"> boolean timestampPrecisionInMilliseconds = Boolean.valueOf(this.policyData</span> - .getRampartConfig().getTimestampPrecisionInMilliseconds()).booleanValue(); - - // This is not the default behavior, we clone the default WSSConfig to prevent this - // affecting globally -<span class="pc bpc" id="L351" title="1 of 2 branches missed."> if (timestampPrecisionInMilliseconds == WSSConfig.getNewInstance()</span> - .isPrecisionInMilliSeconds()) { -<span class="fc" id="L353"> this.config = WSSConfig.getNewInstance();</span> - } else { -<span class="nc" id="L355"> this.config = RampartUtil.getWSSConfigInstance();</span> -<span class="nc" id="L356"> this.config.setPrecisionInMilliSeconds(timestampPrecisionInMilliseconds); </span> - } -<span class="fc" id="L358"> } else {</span> -<span class="fc" id="L359"> this.config = WSSConfig.getNewInstance();</span> - } - - // To handle scenarios where password type is not set by default. -<span class="fc" id="L363"> this.config.setHandleCustomPasswordTypes(true);</span> -<span class="pc bpc" id="L365" title="1 of 2 branches missed."> if (axisService != null) { </span> -<span class="fc" id="L366"> this.customClassLoader = axisService.getClassLoader(); </span> + // Check whether RampartConfig is present +<span class="pc bpc" id="L354" title="1 of 4 branches missed."> if (this.policyData != null && this.policyData.getRampartConfig() != null) {</span> + +<span class="fc" id="L356"> boolean timestampPrecisionInMilliseconds = this.policyData</span> + .getRampartConfig().isDefaultTimestampPrecisionInMs(); +<span class="fc" id="L358"> boolean timestampStrict = this.policyData.getRampartConfig().isTimeStampStrict();</span> + + + // We do not need earlier logic as now WSS4J returns a new instance of WSSConfig, rather + // than a singleton instance. Therefore modifying logic as follows, +<span class="fc" id="L363"> this.config.setTimeStampStrict(timestampStrict);</span> +<span class="fc" id="L364"> this.config.setPrecisionInMilliSeconds(timestampPrecisionInMilliseconds);</span> + + } + + // To handle scenarios where password type is not set by default. +<span class="fc" id="L369"> this.config.setHandleCustomPasswordTypes(true);</span> + +<span class="pc bpc" id="L371" title="1 of 2 branches missed."> if (axisService != null) { </span> +<span class="fc" id="L372"> this.customClassLoader = axisService.getClassLoader(); </span> } -<span class="fc bfc" id="L369" title="All 4 branches covered."> if(this.sender && this.policyData != null) {</span> -<span class="fc" id="L370"> this.secHeader = new WSSecHeader();</span> -<span class="fc" id="L371"> secHeader.insertSecurityHeader(this.document);</span> +<span class="pc bpc" id="L375" title="1 of 4 branches missed."> if(this.sender && this.policyData != null) {</span> +<span class="fc" id="L376"> this.secHeader = new WSSecHeader();</span> +<span class="fc" id="L377"> secHeader.insertSecurityHeader(this.document);</span> } -<span class="nc" id="L374"> } catch (AxisFault e) {</span> -<span class="nc" id="L375"> throw new RampartException("errorInExtractingMsgProps", e);</span> -<span class="nc" id="L376"> } catch (WSSPolicyException e) {</span> -<span class="nc" id="L377"> throw new RampartException("errorInExtractingMsgProps", e);</span> -<span class="nc" id="L378"> } catch (WSSecurityException e) {</span> -<span class="nc" id="L379"> throw new RampartException("errorInExtractingMsgProps", e);</span> -<span class="fc" id="L380"> }</span> +<span class="nc" id="L380"> } catch (AxisFault e) {</span> +<span class="nc" id="L381"> throw new RampartException("errorInExtractingMsgProps", e);</span> +<span class="nc" id="L382"> } catch (WSSPolicyException e) {</span> +<span class="nc" id="L383"> throw new RampartException("errorInExtractingMsgProps", e);</span> +<span class="nc" id="L384"> } catch (WSSecurityException e) {</span> +<span class="nc" id="L385"> throw new RampartException("errorInExtractingMsgProps", e);</span> +<span class="fc" id="L386"> }</span> -<span class="fc" id="L382"> }</span> +<span class="fc" id="L388"> }</span> private void setWSSecurityVersions(String namespace) throws RampartException { -<span class="pc bpc" id="L386" title="2 of 4 branches missed."> if (namespace == null || namespace.equals("")) {</span> -<span class="nc" id="L387"> throw new RampartException("Security policy namespace cannot be null.");</span> +<span class="pc bpc" id="L392" title="2 of 4 branches missed."> if (namespace == null || namespace.equals("")) {</span> +<span class="nc" id="L393"> throw new RampartException("Security policy namespace cannot be null.");</span> } -<span class="fc bfc" id="L390" title="All 2 branches covered."> if (SP11Constants.SP_NS.equals(namespace)) {</span> -<span class="fc" id="L391"> this.wstVersion = RahasConstants.VERSION_05_02;</span> -<span class="fc" id="L392"> this.secConvVersion = ConversationConstants.VERSION_05_02;</span> -<span class="pc bpc" id="L393" title="1 of 2 branches missed."> } else if (SP12Constants.SP_NS.equals(namespace)) {</span> -<span class="fc" id="L394"> this.wstVersion = RahasConstants.VERSION_05_12;</span> -<span class="fc" id="L395"> this.secConvVersion = ConversationConstants.VERSION_05_12;</span> +<span class="fc bfc" id="L396" title="All 2 branches covered."> if (SP11Constants.SP_NS.equals(namespace)) {</span> +<span class="fc" id="L397"> this.wstVersion = RahasConstants.VERSION_05_02;</span> +<span class="fc" id="L398"> this.secConvVersion = ConversationConstants.VERSION_05_02;</span> +<span class="pc bpc" id="L399" title="1 of 2 branches missed."> } else if (SP12Constants.SP_NS.equals(namespace)) {</span> +<span class="fc" id="L400"> this.wstVersion = RahasConstants.VERSION_05_12;</span> +<span class="fc" id="L401"> this.secConvVersion = ConversationConstants.VERSION_05_12;</span> } else { -<span class="nc" id="L397"> throw new RampartException("Invalid namespace received, " + namespace);</span> +<span class="nc" id="L403"> throw new RampartException("Invalid namespace received, " + namespace);</span> } -<span class="fc" id="L400"> }</span> +<span class="fc" id="L406"> }</span> private void setTrustParameters() throws RampartException { -<span class="fc bfc" id="L404" title="All 2 branches covered."> if (this.policyData.getIssuerPolicy() == null) {</span> -<span class="fc" id="L405"> return;</span> +<span class="fc bfc" id="L410" title="All 2 branches covered."> if (this.policyData.getIssuerPolicy() == null) {</span> +<span class="fc" id="L411"> return;</span> } -<span class="fc" id="L408"> this.servicePolicy = this.policyData.getIssuerPolicy();</span> +<span class="fc" id="L414"> this.servicePolicy = this.policyData.getIssuerPolicy();</span> -<span class="fc" id="L410"> RampartConfig rampartConfig = policyData.getRampartConfig();</span> -<span class="pc bpc" id="L411" title="1 of 2 branches missed."> if (rampartConfig != null) {</span> +<span class="fc" id="L416"> RampartConfig rampartConfig = policyData.getRampartConfig();</span> +<span class="pc bpc" id="L417" title="1 of 2 branches missed."> if (rampartConfig != null) {</span> /* * Copy crypto info into the new issuer policy */ -<span class="fc" id="L415"> RampartConfig rc = new RampartConfig();</span> -<span class="fc" id="L416"> rc.setEncrCryptoConfig(rampartConfig.getEncrCryptoConfig());</span> -<span class="fc" id="L417"> rc.setSigCryptoConfig(rampartConfig.getSigCryptoConfig());</span> -<span class="fc" id="L418"> rc.setDecCryptoConfig(rampartConfig.getDecCryptoConfig());</span> -<span class="fc" id="L419"> rc.setUser(rampartConfig.getUser());</span> -<span class="fc" id="L420"> rc.setUserCertAlias(rc.getUserCertAlias());</span> -<span class="fc" id="L421"> rc.setEncryptionUser(rampartConfig.getEncryptionUser());</span> -<span class="fc" id="L422"> rc.setPwCbClass(rampartConfig.getPwCbClass());</span> -<span class="fc" id="L423"> rc.setSSLConfig(rampartConfig.getSSLConfig());</span> +<span class="fc" id="L421"> RampartConfig rc = new RampartConfig();</span> +<span class="fc" id="L422"> rc.setEncrCryptoConfig(rampartConfig.getEncrCryptoConfig());</span> +<span class="fc" id="L423"> rc.setSigCryptoConfig(rampartConfig.getSigCryptoConfig());</span> +<span class="fc" id="L424"> rc.setDecCryptoConfig(rampartConfig.getDecCryptoConfig());</span> +<span class="fc" id="L425"> rc.setUser(rampartConfig.getUser());</span> +<span class="fc" id="L426"> rc.setUserCertAlias(rc.getUserCertAlias());</span> +<span class="fc" id="L427"> rc.setEncryptionUser(rampartConfig.getEncryptionUser());</span> +<span class="fc" id="L428"> rc.setPwCbClass(rampartConfig.getPwCbClass());</span> +<span class="fc" id="L429"> rc.setSSLConfig(rampartConfig.getSSLConfig());</span> -<span class="fc" id="L425"> this.servicePolicy.addAssertion(rc);</span> +<span class="fc" id="L431"> this.servicePolicy.addAssertion(rc);</span> } -<span class="fc" id="L428"> List it = (List) this.servicePolicy.getAlternatives().next();</span> +<span class="fc" id="L434"> List<Assertion> it = this.servicePolicy.getAlternatives().next();</span> //Process policy and build policy data try { -<span class="fc" id="L432"> this.policyData = RampartPolicyBuilder.build(it);</span> -<span class="nc" id="L433"> } catch (WSSPolicyException e) {</span> -<span class="nc" id="L434"> throw new RampartException("errorInExtractingMsgProps", e);</span> -<span class="fc" id="L435"> }</span> +<span class="fc" id="L438"> this.policyData = RampartPolicyBuilder.build(it);</span> +<span class="nc" id="L439"> } catch (WSSPolicyException e) {</span> +<span class="nc" id="L440"> throw new RampartException("errorInExtractingMsgProps", e);</span> +<span class="fc" id="L441"> }</span> -<span class="fc" id="L437"> }</span> +<span class="fc" id="L443"> }</span> /** * @return Returns the document. */ public Document getDocument() { -<span class="fc" id="L443"> return document;</span> +<span class="fc" id="L449"> return document;</span> } /** - * @param document The document to set. - * @deprecated document is derived from MessageContext passed in constructor - */ - public void setDocument(Document document) { -<span class="nc" id="L451"> this.document = document;</span> -<span class="nc" id="L452"> }</span> - - /** * @return Returns the timeToLive. */ public int getTimeToLive() { -<span class="nc" id="L458"> return timeToLive;</span> +<span class="nc" id="L456"> return timeToLive;</span> } /** * @param timeToLive The timeToLive to set. */ public void setTimeToLive(int timeToLive) { -<span class="fc" id="L465"> this.timeToLive = timeToLive;</span> -<span class="fc" id="L466"> }</span> +<span class="fc" id="L463"> this.timeToLive = timeToLive;</span> +<span class="fc" id="L464"> }</span> /** * @return Returns the timestampMaxSkew. */ public int getTimestampMaxSkew() { -<span class="nc" id="L472"> return timestampMaxSkew;</span> +<span class="nc" id="L470"> return timestampMaxSkew;</span> } /** * @param timestampMaxSkew The timestampMaxSkew to set. */ public void setTimestampMaxSkew(int timestampMaxSkew) { -<span class="fc" id="L479"> this.timestampMaxSkew = timestampMaxSkew;</span> -<span class="fc" id="L480"> }</span> +<span class="fc" id="L477"> this.timestampMaxSkew = timestampMaxSkew;</span> +<span class="fc" id="L478"> }</span> /** * @return Returns the config. */ public WSSConfig getConfig() { -<span class="fc" id="L486"> return config;</span> +<span class="fc" id="L484"> return config;</span> } /** @@ -491,58 +489,28 @@ public class RampartMessageData { * The config to set. */ public void setConfig(WSSConfig config) { -<span class="nc" id="L494"> this.config = config;</span> -<span class="nc" id="L495"> }</span> +<span class="nc" id="L492"> this.config = config;</span> +<span class="nc" id="L493"> }</span> /** * @return Returns the msgContext. */ public MessageContext getMsgContext() { -<span class="fc" id="L501"> return msgContext;</span> +<span class="fc" id="L499"> return msgContext;</span> } /** - * @param msgContext The msgContext to set. - * @deprecated MessageContext is set in constructor - */ - public void setMsgContext(MessageContext msgContext) { -<span class="nc" id="L509"> this.msgContext = msgContext;</span> -<span class="nc" id="L510"> }</span> - - /** * @return Returns the policyData. */ public RampartPolicyData getPolicyData() { -<span class="fc" id="L516"> return policyData;</span> +<span class="fc" id="L506"> return policyData;</span> } /** - * @param policyData The policyData to set. - * @deprecated Policy data determined within constructor - */ - public void setPolicyData(RampartPolicyData policyData) throws RampartException { -<span class="nc" id="L524"> this.policyData = policyData;</span> - - try { - //if client side then check whether sig conf enabled - //and get hold of the stored signature values -<span class="nc bnc" id="L529" title="All 6 branches missed."> if(this.isInitiator && !this.sender && policyData.isSignatureConfirmation()) {</span> -<span class="nc" id="L530"> OperationContext opCtx = msgContext.getOperationContext();</span> -<span class="nc" id="L531"> MessageContext outMsgCtx = opCtx</span> - .getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); -<span class="nc" id="L533"> msgContext.setProperty(WSHandlerConstants.SEND_SIGV, outMsgCtx</span> - .getProperty(WSHandlerConstants.SEND_SIGV)); - } -<span class="nc" id="L536"> } catch (AxisFault e) {</span> -<span class="nc" id="L537"> throw new RampartException("errorGettingSignatureValuesForSigconf", e);</span> -<span class="nc" id="L538"> }</span> -<span class="nc" id="L539"> }</span> - - /** * @return Returns the secHeader. */ public WSSecHeader getSecHeader() { -<span class="fc" id="L545"> return secHeader;</span> +<span class="fc" id="L513"> return secHeader;</span> } /** @@ -550,53 +518,53 @@ public class RampartMessageData { * The secHeader to set. */ public void setSecHeader(WSSecHeader secHeader) { -<span class="nc" id="L553"> this.secHeader = secHeader;</span> -<span class="nc" id="L554"> }</span> +<span class="nc" id="L521"> this.secHeader = secHeader;</span> +<span class="nc" id="L522"> }</span> /** * @return Returns the issuedEncryptionTokenId. */ public String getIssuedEncryptionTokenId() { -<span class="fc" id="L560"> return issuedEncryptionTokenId;</span> +<span class="fc" id="L528"> return issuedEncryptionTokenId;</span> } /** * @param issuedEncryptionTokenId The issuedEncryptionTokenId to set. */ public void setIssuedEncryptionTokenId(String issuedEncryptionTokenId) { -<span class="nc" id="L567"> this.issuedEncryptionTokenId = issuedEncryptionTokenId;</span> -<span class="nc" id="L568"> }</span> +<span class="nc" id="L535"> this.issuedEncryptionTokenId = issuedEncryptionTokenId;</span> +<span class="nc" id="L536"> }</span> /** * @return Returns the issuedSignatureTokenId. */ public String getIssuedSignatureTokenId() { -<span class="nc bnc" id="L574" title="All 2 branches missed."> if(this.isInitiator) {</span> -<span class="nc" id="L575"> return issuedSignatureTokenId;</span> +<span class="nc bnc" id="L542" title="All 2 branches missed."> if(this.isInitiator) {</span> +<span class="nc" id="L543"> return issuedSignatureTokenId;</span> } else { //Pick the first SAML token //TODO : This is a hack , MUST FIX //get the sec context id from the req msg ctx -<span class="nc" id="L580"> List<WSHandlerResult> results</span> +<span class="nc" id="L548"> List<WSHandlerResult> results</span> = (List<WSHandlerResult>)this.msgContext.getProperty(WSHandlerConstants.RECV_RESULTS); -<span class="nc bnc" id="L582" title="All 2 branches missed."> for (WSHandlerResult result : results) {</span> -<span class="nc" id="L583"> List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();</span> +<span class="nc bnc" id="L550" title="All 2 branches missed."> for (WSHandlerResult result : results) {</span> +<span class="nc" id="L551"> List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();</span> -<span class="nc bnc" id="L585" title="All 2 branches missed."> for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {</span> -<span class="nc" id="L586"> final Integer actInt =</span> +<span class="nc bnc" id="L553" title="All 2 branches missed."> for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {</span> +<span class="nc" id="L554"> final Integer actInt =</span> (Integer) wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION); -<span class="nc bnc" id="L588" title="All 2 branches missed."> if (WSConstants.ST_UNSIGNED == actInt) {</span> -<span class="nc" id="L589"> final Object assertion =</span> +<span class="nc bnc" id="L556" title="All 2 branches missed."> if (WSConstants.ST_UNSIGNED == actInt) {</span> +<span class="nc" id="L557"> final Object assertion =</span> wsSecEngineResult.get(WSSecurityEngineResult.TAG_SAML_ASSERTION); -<span class="nc" id="L591"> SAMLAssertionHandler samlAssertionHandler</span> +<span class="nc" id="L559"> SAMLAssertionHandler samlAssertionHandler</span> = SAMLAssertionHandlerFactory.createAssertionHandler(assertion); -<span class="nc" id="L594"> return samlAssertionHandler.getAssertionId();</span> +<span class="nc" id="L562"> return samlAssertionHandler.getAssertionId();</span> } -<span class="nc" id="L597"> }</span> -<span class="nc" id="L598"> }</span> -<span class="nc" id="L599"> return null;</span> +<span class="nc" id="L565"> }</span> +<span class="nc" id="L566"> }</span> +<span class="nc" id="L567"> return null;</span> } } @@ -604,56 +572,56 @@ public class RampartMessageData { * @param issuedSignatureTokenId The issuedSignatureTokenId to set. */ public void setIssuedSignatureTokenId(String issuedSignatureTokenId) { -<span class="nc" id="L607"> this.issuedSignatureTokenId = issuedSignatureTokenId;</span> -<span class="nc" id="L608"> }</span> +<span class="nc" id="L575"> this.issuedSignatureTokenId = issuedSignatureTokenId;</span> +<span class="nc" id="L576"> }</span> /** * @return Returns the secConvTokenId. */ public String getSecConvTokenId() { -<span class="fc" id="L614"> String id = null;</span> +<span class="fc" id="L582"> String id = null;</span> -<span class="fc bfc" id="L616" title="All 2 branches covered."> if(this.isInitiator) {</span> -<span class="fc" id="L617"> String contextIdentifierKey = RampartUtil.getContextIdentifierKey(this.msgContext);</span> -<span class="fc" id="L618"> id = (String) RampartUtil.getContextMap(this.msgContext).get(contextIdentifierKey);</span> -<span class="fc" id="L619"> } else {</span> +<span class="fc bfc" id="L584" title="All 2 branches covered."> if(this.isInitiator) {</span> +<span class="fc" id="L585"> String contextIdentifierKey = RampartUtil.getContextIdentifierKey(this.msgContext);</span> +<span class="fc" id="L586"> id = (String) RampartUtil.getContextMap(this.msgContext).get(contextIdentifierKey);</span> +<span class="fc" id="L587"> } else {</span> //get the sec context id from the req msg ctx -<span class="fc" id="L621"> List<WSHandlerResult> results = (List<WSHandlerResult>)this.msgContext.getProperty(WSHandlerConstants.RECV_RESULTS);</span> -<span class="fc bfc" id="L622" title="All 2 branches covered."> for (WSHandlerResult result : results) {</span> -<span class="fc" id="L623"> List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();</span> +<span class="fc" id="L589"> List<WSHandlerResult> results = (List<WSHandlerResult>)this.msgContext.getProperty(WSHandlerConstants.RECV_RESULTS);</span> +<span class="fc bfc" id="L590" title="All 2 branches covered."> for (WSHandlerResult result : results) {</span> +<span class="fc" id="L591"> List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();</span> -<span class="fc bfc" id="L625" title="All 2 branches covered."> for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {</span> -<span class="fc" id="L626"> final Integer actInt =</span> +<span class="fc bfc" id="L593" title="All 2 branches covered."> for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {</span> +<span class="fc" id="L594"> final Integer actInt =</span> (Integer) wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION); -<span class="fc bfc" id="L628" title="All 2 branches covered."> if (WSConstants.SCT == actInt) {</span> -<span class="fc" id="L629"> final SecurityContextToken sct =</span> +<span class="fc bfc" id="L596" title="All 2 branches covered."> if (WSConstants.SCT == actInt) {</span> +<span class="fc" id="L597"> final SecurityContextToken sct =</span> ((SecurityContextToken) wsSecEngineResult .get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN)); -<span class="fc" id="L632"> id = sct.getID();</span> +<span class="fc" id="L600"> id = sct.getID();</span> } -<span class="fc" id="L635"> }</span> -<span class="fc" id="L636"> }</span> +<span class="fc" id="L603"> }</span> +<span class="fc" id="L604"> }</span> } -<span class="pc bpc" id="L639" title="1 of 4 branches missed."> if(id == null || id.length() == 0) {</span> +<span class="pc bpc" id="L607" title="1 of 4 branches missed."> if(id == null || id.length() == 0) {</span> //If we can't find the sec conv token id up to this point then //check if someone has specified which one to use -<span class="fc" id="L642"> id = (String)this.msgContext.getProperty(SCT_ID);</span> +<span class="fc" id="L610"> id = (String)this.msgContext.getProperty(SCT_ID);</span> } -<span class="fc" id="L645"> return id;</span> +<span class="fc" id="L613"> return id;</span> } /** * @param secConvTokenId The secConvTokenId to set. */ public void setSecConvTokenId(String secConvTokenId) { -<span class="fc" id="L652"> String contextIdentifierKey = RampartUtil.getContextIdentifierKey(this.msgContext);</span> -<span class="fc" id="L653"> RampartUtil.getContextMap(this.msgContext).put(</span> +<span class="fc" id="L620"> String contextIdentifierKey = RampartUtil.getContextIdentifierKey(this.msgContext);</span> +<span class="fc" id="L621"> RampartUtil.getContextMap(this.msgContext).put(</span> contextIdentifierKey, secConvTokenId); -<span class="fc" id="L656"> }</span> +<span class="fc" id="L624"> }</span> @@ -662,112 +630,97 @@ public class RampartMessageData { */ public TokenStorage getTokenStorage() throws RampartException { -<span class="fc bfc" id="L665" title="All 2 branches covered."> if(this.tokenStorage != null) {</span> -<span class="fc" id="L666"> return this.tokenStorage;</span> +<span class="fc bfc" id="L633" title="All 2 branches covered."> if(this.tokenStorage != null) {</span> +<span class="fc" id="L634"> return this.tokenStorage;</span> } -<span class="fc" id="L669"> TokenStorage storage = (TokenStorage) this.msgContext.getConfigurationContext().getProperty(</span> +<span class="fc" id="L637"> TokenStorage storage = (TokenStorage) this.msgContext.getConfigurationContext().getProperty(</span> TokenStorage.TOKEN_STORAGE_KEY); -<span class="fc bfc" id="L672" title="All 2 branches covered."> if (storage != null) {</span> -<span class="fc" id="L673"> this.tokenStorage = storage;</span> +<span class="fc bfc" id="L640" title="All 2 branches covered."> if (storage != null) {</span> +<span class="fc" id="L641"> this.tokenStorage = storage;</span> } else { -<span class="pc bpc" id="L675" title="2 of 4 branches missed."> if (this.policyData.getRampartConfig() != null &&</span> +<span class="pc bpc" id="L643" title="1 of 4 branches missed."> if (this.policyData.getRampartConfig() != null &&</span> this.policyData.getRampartConfig().getTokenStoreClass() != null) { -<span class="nc" id="L677"> Class stClass = null;</span> -<span class="nc" id="L678"> String storageClass = this.policyData.getRampartConfig()</span> +<span class="nc" id="L645"> Class stClass = null;</span> +<span class="nc" id="L646"> String storageClass = this.policyData.getRampartConfig()</span> .getTokenStoreClass(); try { -<span class="nc" id="L681"> stClass = Loader.loadClass(this.customClassLoader, storageClass);</span> -<span class="nc" id="L682"> } catch (ClassNotFoundException e) {</span> -<span class="nc" id="L683"> throw new RampartException(</span> +<span class="nc" id="L649"> stClass = Loader.loadClass(this.customClassLoader, storageClass);</span> +<span class="nc" id="L650"> } catch (ClassNotFoundException e) {</span> +<span class="nc" id="L651"> throw new RampartException(</span> "WSHandler: cannot load token storage class: " + storageClass, e); -<span class="nc" id="L686"> }</span> +<span class="nc" id="L654"> }</span> try { -<span class="nc" id="L688"> this.tokenStorage = (TokenStorage) stClass.newInstance();</span> -<span class="nc" id="L689"> } catch (java.lang.Exception e) {</span> -<span class="nc" id="L690"> throw new RampartException(</span> +<span class="nc" id="L656"> this.tokenStorage = (TokenStorage) stClass.newInstance();</span> +<span class="nc" id="L657"> } catch (java.lang.Exception e) {</span> +<span class="nc" id="L658"> throw new RampartException(</span> "Cannot create instance of token storage: " + storageClass, e); -<span class="nc" id="L693"> }</span> -<span class="nc" id="L694"> } else {</span> -<span class="fc" id="L695"> this.tokenStorage = new SimpleTokenStore();</span> +<span class="nc" id="L661"> }</span> +<span class="nc" id="L662"> } else {</span> +<span class="fc" id="L663"> this.tokenStorage = new SimpleTokenStore();</span> } //Set the storage instance -<span class="fc" id="L700"> this.msgContext.getConfigurationContext().setProperty(</span> +<span class="fc" id="L668"> this.msgContext.getConfigurationContext().setProperty(</span> TokenStorage.TOKEN_STORAGE_KEY, this.tokenStorage); } -<span class="fc" id="L705"> return tokenStorage;</span> +<span class="fc" id="L673"> return tokenStorage;</span> } /** * @param tokenStorage The tokenStorage to set. */ public void setTokenStorage(TokenStorage tokenStorage) { -<span class="nc" id="L712"> this.tokenStorage = tokenStorage;</span> -<span class="nc" id="L713"> }</span> +<span class="nc" id="L680"> this.tokenStorage = tokenStorage;</span> +<span class="nc" id="L681"> }</span> /** * @return Returns the wstVersion. */ public int getWstVersion() { -<span class="fc" id="L719"> return wstVersion;</span> +<span class="fc" id="L687"> return wstVersion;</span> } /** - * @param wstVersion The wstVersion to set. - * @deprecated This is defined by the class. - */ - public void setWstVersion(int wstVersion) { -<span class="nc" id="L727"> this.wstVersion = wstVersion;</span> -<span class="nc" id="L728"> }</span> - - /** * @return Returns the secConvVersion. */ public int getSecConvVersion() { -<span class="fc" id="L734"> return secConvVersion;</span> +<span class="fc" id="L694"> return secConvVersion;</span> } /** * @return Returns the servicePolicy. */ public Policy getServicePolicy() { -<span class="fc" id="L741"> return servicePolicy;</span> +<span class="fc" id="L701"> return servicePolicy;</span> } - /** - * @param servicePolicy The servicePolicy to set. - * @deprecated servicePolicy determined in constructor - */ - public void setServicePolicy(Policy servicePolicy) { -<span class="nc" id="L749"> this.servicePolicy = servicePolicy;</span> -<span class="nc" id="L750"> }</span> /** * @return Returns the timestampId. */ public String getTimestampId() { -<span class="fc" id="L756"> return timestampId;</span> +<span class="fc" id="L709"> return timestampId;</span> } /** * @param timestampId The timestampId to set. */ public void setTimestampId(String timestampId) { -<span class="fc" id="L763"> this.timestampId = timestampId;</span> -<span class="fc" id="L764"> }</span> +<span class="fc" id="L716"> this.timestampId = timestampId;</span> +<span class="fc" id="L717"> }</span> /** * @return Returns the Initiator value */ public boolean isInitiator() { -<span class="fc" id="L770"> return isInitiator;</span> +<span class="fc" id="L723"> return isInitiator;</span> } /** @@ -775,7 +728,7 @@ public class RampartMessageData { * @return Returns the custom class loader if we are using one */ public ClassLoader getCustomClassLoader() { -<span class="fc" id="L778"> return customClassLoader;</span> +<span class="fc" id="L731"> return customClassLoader;</span> } /** @@ -784,7 +737,7 @@ public class RampartMessageData { * @return Returns soap version information of this request */ public SOAPConstants getSoapConstants() { -<span class="fc" id="L787"> return soapConstants;</span> +<span class="fc" id="L740"> return soapConstants;</span> } } </pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.6.1.201212231917</span></div></body></html> \ No newline at end of file
Modified: axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.html URL: http://svn.apache.org/viewvc/axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.html?rev=1725383&r1=1725382&r2=1725383&view=diff ============================================================================== --- axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.html (original) +++ axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.html Mon Jan 18 23:07:55 2016 @@ -1 +1 @@ -<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>ServiceNonceCache</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="right"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Coverage Report</a> > <a href="index.html" class="el_package">org.apache.rampart</a> > <span class="el_class">ServiceNonceCache</span></div><h1>ServiceNonceCache</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sorta ble" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">46 of 55</td><td class="ctr2">16%</td><td class="bar">4 of 4</td><td class="ctr2">0%</td><td class="ctr1">4</td><td class="ctr2">5</td><td class="ctr1">10</td><td class="ctr2">12</td><td class="ctr1">2</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a0"><a href="ServiceNonceCache.java.html#L39" class="el_method">addNonceForService(String, String, String, int)</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="120" height="10" title="28" alt="28"/></td><td class="ctr2" id="c1">0%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="120" height="10" title="2" alt="2"/></td><td class="ctr2" id="e0">0%</td><td class="ctr1" id="f0">2</td><td class="ctr2" id="g0">2</td><td class="ctr1" id="h0">6</td><td class="ctr2" id="i0">6</td><td class="ctr1" id="j0">1</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a1"><a href="ServiceNonceCache.java.html#L58" class="el_method">isNonceRepeatingForService(String, String, String)</a></td><td class="bar" id="b1"><img src="../.resources/redbar.gif" width="77" height="10" title="18" alt="18"/></td><td class="ctr2" id="c2">0%</td><td class="bar" id="d1"><img s rc="../.resources/redbar.gif" width="120" height="10" title="2" alt="2"/></td><td class="ctr2" id="e1">0%</td><td class="ctr1" id="f1">2</td><td class="ctr2" id="g1">2</td><td class="ctr1" id="h1">4</td><td class="ctr2" id="i1">4</td><td class="ctr1" id="j1">1</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a2"><a href="ServiceNonceCache.java.html#L25" class="el_method">ServiceNonceCache()</a></td><td class="bar" id="b2"><img src="../.resources/greenbar.gif" width="38" height="10" title="9" alt="9"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.6.1.201212231917</span></div></body></html> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>ServiceNonceCache</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="right"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Coverage Report</a> > <a href="index.html" class="el_package">org.apache.rampart</a> > <span class="el_class">ServiceNonceCache</span></div><h1>ServiceNonceCache</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sorta ble" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">18 of 55</td><td class="ctr2">67%</td><td class="bar">2 of 4</td><td class="ctr2">50%</td><td class="ctr1">2</td><td class="ctr2">5</td><td class="ctr1">3</td><td class="ctr2">12</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a1"><a href="ServiceNonceCache.java.html#L58" class="el_method">isNonceRepeatingForService(String, String, String)</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="47" height="10" title="11" alt="11"/><img src="../.resources/greenbar.gif" width="30" height="10" title="7" alt="7"/></td><td class="ctr2" id="c2">39%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="60" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="60" height="10" title="1" alt="1"/></td><td class="ctr2" id="e0">50%</td><td class="ctr1" id="f0">1</td><td class="ctr2" id="g0">2</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i1">4</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a0"><a href="ServiceNonceCache.java.html#L39" class="el_method">addNonceForService(String, String, String, int)</a></td><td class=" bar" id="b1"><img src="../.resources/redbar.gif" width="30" height="10" title="7" alt="7"/><img src="../.resources/greenbar.gif" width="90" height="10" title="21" alt="21"/></td><td class="ctr2" id="c1">75%</td><td class="bar" id="d1"><img src="../.resources/redbar.gif" width="60" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="60" height="10" title="1" alt="1"/></td><td class="ctr2" id="e1">50%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g1">2</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i0">6</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a2"><a href="ServiceNonceCache.java.html#L25" class="el_method">ServiceNonceCache()</a></td><td class="bar" id="b2"><img src="../.resources/greenbar.gif" width="38" height="10" title="9" alt="9"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td clas s="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.6.1.201212231917</span></div></body></html> \ No newline at end of file Modified: axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.java.html URL: http://svn.apache.org/viewvc/axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.java.html?rev=1725383&r1=1725382&r2=1725383&view=diff ============================================================================== --- axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.java.html (original) +++ axis/site/axis2/java/rampart-staging/code-coverage/org.apache.rampart/ServiceNonceCache.java.html Mon Jan 18 23:07:55 2016 @@ -36,15 +36,15 @@ import java.util.Map; public void addNonceForService(String service, String userName, String nonceValue, int nonceLifeTime) { UniqueMessageAttributeCache nonceCache; -<span class="nc bnc" id="L39" title="All 2 branches missed."> if (this.mapServiceNonceCache.containsKey(service)) {</span> +<span class="pc bpc" id="L39" title="1 of 2 branches missed."> if (this.mapServiceNonceCache.containsKey(service)) {</span> <span class="nc" id="L40"> nonceCache = this.mapServiceNonceCache.get(service);</span> } else { -<span class="nc" id="L42"> nonceCache = new NonceCache(nonceLifeTime);</span> -<span class="nc" id="L43"> this.mapServiceNonceCache.put(service, nonceCache);</span> +<span class="fc" id="L42"> nonceCache = new NonceCache(nonceLifeTime);</span> +<span class="fc" id="L43"> this.mapServiceNonceCache.put(service, nonceCache);</span> } -<span class="nc" id="L46"> nonceCache.addToCache(nonceValue, userName);</span> -<span class="nc" id="L47"> }</span> +<span class="fc" id="L46"> nonceCache.addToCache(nonceValue, userName);</span> +<span class="fc" id="L47"> }</span> /** * This method will check whether the nonce value is repeating for the given service. @@ -55,14 +55,14 @@ import java.util.Map; */ public boolean isNonceRepeatingForService(String service, String userName, String nonceValue){ -<span class="nc bnc" id="L58" title="All 2 branches missed."> if (this.mapServiceNonceCache.containsKey(service)) {</span> +<span class="pc bpc" id="L58" title="1 of 2 branches missed."> if (this.mapServiceNonceCache.containsKey(service)) {</span> <span class="nc" id="L60"> UniqueMessageAttributeCache nonceCache = this.mapServiceNonceCache.get(service);</span> <span class="nc" id="L61"> return nonceCache.valueExistsInCache(nonceValue, userName); </span> } -<span class="nc" id="L65"> return false;</span> +<span class="fc" id="L65"> return false;</span> }
