cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Assert streaming SecureConversation policies properly
Date Fri, 04 Jul 2014 16:31:20 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a03443ea9 -> 805f87717


Assert streaming SecureConversation policies properly


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

Branch: refs/heads/master
Commit: 805f87717945c3c87677a4519bbd7f397f1e42a7
Parents: a03443e
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Jul 4 17:27:37 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Jul 4 17:31:15 2014 +0100

----------------------------------------------------------------------
 .../policy/interceptors/NegotiationUtils.java         | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/805f8771/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
index be7c05b..6d7c0cd 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
@@ -69,6 +69,8 @@ import org.apache.wss4j.policy.model.AbstractBinding;
 import org.apache.wss4j.policy.model.AlgorithmSuite;
 import org.apache.wss4j.policy.model.Trust10;
 import org.apache.wss4j.policy.model.Trust13;
+import org.apache.wss4j.stax.securityEvent.WSSecurityEventConstants;
+import org.apache.xml.security.stax.securityEvent.SecurityEvent;
 
 /**
  * This is a collection of utility methods for use in negotiation exchanges such as WS-SecureConversation

@@ -237,6 +239,18 @@ final class NegotiationUtils {
         List<WSHandlerResult> results = 
             CastUtils.cast((List<?>)message.get(WSHandlerConstants.RECV_RESULTS));
         if (results == null) {
+            // Try Streaming results
+            @SuppressWarnings("unchecked")
+            final List<SecurityEvent> incomingEventList = 
+                (List<SecurityEvent>) message.getExchange().get(SecurityEvent.class.getName()
+ ".in");
+            if (incomingEventList != null) {
+                for (SecurityEvent incomingEvent : incomingEventList) {
+                    if (WSSecurityEventConstants.SecurityContextToken 
+                        == incomingEvent.getSecurityEventType()) {
+                        return true;
+                    }
+                }
+            }
             return false;
         }
         


Mime
View raw message