cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/3] git commit: More minor stuff
Date Tue, 15 Apr 2014 13:07:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 210d24b39 -> 5204b1ec6


More minor stuff


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5204b1ec
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5204b1ec
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5204b1ec

Branch: refs/heads/master
Commit: 5204b1ec6ae0424b77b38e16f4e17f39f7c9f86d
Parents: 19ba5d0
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 15 14:04:56 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 15 14:05:27 2014 +0100

----------------------------------------------------------------------
 .../wss4j/PolicyStaxActionInInterceptor.java         | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5204b1ec/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyStaxActionInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyStaxActionInInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyStaxActionInInterceptor.java
index 593f21f..59a13b1 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyStaxActionInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyStaxActionInInterceptor.java
@@ -72,7 +72,7 @@ public class PolicyStaxActionInInterceptor extends AbstractPhaseInterceptor<Soap
         // First check for a SOAP Fault with no security header if we are the client
         // In this case don't blanket assert security policies
         if (MessageUtils.isRequestor(soapMessage)
-            && isEventInResults(WSSecurityEventConstants.NoSecurity, incomingSecurityEventList))
{
+            && incomingSecurityEventList.contains(WSSecurityEventConstants.NoSecurity))
{
             OperationSecurityEvent securityEvent = 
                 (OperationSecurityEvent)findEvent(
                     WSSecurityEventConstants.Operation, incomingSecurityEventList
@@ -89,15 +89,6 @@ public class PolicyStaxActionInInterceptor extends AbstractPhaseInterceptor<Soap
         assertAllAlgorithmSuites(SP12Constants.SP_NS, aim);
     }
     
-    private boolean isEventInResults(Event event, List<SecurityEvent> incomingSecurityEventList)
{
-        for (SecurityEvent incomingEvent : incomingSecurityEventList) {
-            if (event == incomingEvent.getSecurityEventType()) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
     private SecurityEvent findEvent(Event event, List<SecurityEvent> incomingSecurityEventList)
{
         for (SecurityEvent incomingEvent : incomingSecurityEventList) {
             if (event == incomingEvent.getSecurityEventType()) {
@@ -126,7 +117,7 @@ public class PolicyStaxActionInInterceptor extends AbstractPhaseInterceptor<Soap
     private void assertAllAlgorithmSuites(String spNamespace, AssertionInfoMap aim) {
         Collection<AssertionInfo> sp11Ais = 
             aim.get(new QName(spNamespace, SPConstants.ALGORITHM_SUITE));
-        if (sp11Ais != null) {
+        if (sp11Ais != null && !sp11Ais.isEmpty()) {
             for (AssertionInfo ai : sp11Ais) {
                 ai.setAsserted(true);
                 AlgorithmSuite algorithmSuite = (AlgorithmSuite)ai.getAssertion();
@@ -137,7 +128,7 @@ public class PolicyStaxActionInInterceptor extends AbstractPhaseInterceptor<Soap
                 }
                 Collection<AssertionInfo> algAis = 
                     aim.get(new QName(namespace, algorithmSuiteType.getName()));
-                if (algAis != null) {
+                if (algAis != null && !algAis.isEmpty()) {
                     for (AssertionInfo algAi : algAis) {
                         algAi.setAsserted(true);
                     }


Mime
View raw message