cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/8] cxf git commit: Fixing merge
Date Mon, 02 Nov 2015 18:34:35 GMT
Fixing merge


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

Branch: refs/heads/3.0.x-fixes
Commit: 0d8398ddc0096c961ae48932855ac89bb4dda62d
Parents: dc41b81
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Nov 2 17:58:45 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Nov 2 17:58:45 2015 +0000

----------------------------------------------------------------------
 .../cxf/ws/security/wss4j/WSS4JUtils.java       | 26 +++++++++++---
 .../policyhandlers/AbstractBindingBuilder.java  | 37 +-------------------
 2 files changed, 22 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0d8398dd/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
index 5f81cf0..5a52b0e 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
@@ -300,7 +300,6 @@ public final class WSS4JUtils {
         return properties;
     }
     
-<<<<<<< HEAD
     public static URL getPropertiesFileURL(
         Object o, ResourceManager manager, Class<?> callingClass
     ) {
@@ -331,7 +330,7 @@ public final class WSS4JUtils {
         } else if (o instanceof URL) {
             return (URL)o;        
         }
-=======
+
     public static PasswordEncryptor getPasswordEncryptor(Message message) {
         if (message == null) {
             return null;
@@ -344,9 +343,8 @@ public final class WSS4JUtils {
             return passwordEncryptor;
         }
         
-        Object o = SecurityUtils.getSecurityPropertyValue(SecurityConstants.CALLBACK_HANDLER,
message);
         try {
-            CallbackHandler callbackHandler = SecurityUtils.getCallbackHandler(o);
+            CallbackHandler callbackHandler = getCallbackHandler(message);
             if (callbackHandler != null) {
                 return new JasyptPasswordEncryptor(callbackHandler);
             }
@@ -354,10 +352,28 @@ public final class WSS4JUtils {
             return null;
         }
         
->>>>>>> fcd965e... Make it possible to use a PasswordEncryptor with
the SamlTokenInterceptor
         return null;
     }
     
+    public static CallbackHandler getCallbackHandler(Message message) {
+        Object o = message.getContextualProperty(SecurityConstants.CALLBACK_HANDLER);
+        
+        CallbackHandler handler = null;
+        if (o instanceof CallbackHandler) {
+            handler = (CallbackHandler)o;
+        } else if (o instanceof String) {
+            try {
+                handler = (CallbackHandler)ClassLoaderUtils
+                    .loadClass((String)o, WSS4JUtils.class).newInstance();
+                message.put(SecurityConstants.CALLBACK_HANDLER, handler);
+            } catch (Exception e) {
+                handler = null;
+            }
+        }
+        
+        return handler;
+    }
+    
     public static Crypto loadCryptoFromPropertiesFile(
         Message message,
         String propFilename, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d8398dd/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index 5837174..4f10165 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -967,22 +967,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
     }
     
     protected CallbackHandler getCallbackHandler() {
-        Object o = message.getContextualProperty(SecurityConstants.CALLBACK_HANDLER);
-        
-        CallbackHandler handler = null;
-        if (o instanceof CallbackHandler) {
-            handler = (CallbackHandler)o;
-        } else if (o instanceof String) {
-            try {
-                handler = (CallbackHandler)ClassLoaderUtils
-                    .loadClass((String)o, this.getClass()).newInstance();
-                message.put(SecurityConstants.CALLBACK_HANDLER, handler);
-            } catch (Exception e) {
-                handler = null;
-            }
-        }
-        
-        return handler;
+        return WSS4JUtils.getCallbackHandler(message);
     }
 
     /**
@@ -1526,26 +1511,6 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
         return crypto;
     }
     
-<<<<<<< HEAD
-    protected PasswordEncryptor getPasswordEncryptor() {
-        PasswordEncryptor passwordEncryptor = 
-            (PasswordEncryptor)message.getContextualProperty(
-                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
-            );
-        if (passwordEncryptor != null) {
-            return passwordEncryptor;
-        }
-        
-        CallbackHandler callbackHandler = getCallbackHandler();
-        if (callbackHandler != null) {
-            return new JasyptPasswordEncryptor(callbackHandler);
-        }
-        
-        return null;
-    }
-    
-=======
->>>>>>> fcd965e... Make it possible to use a PasswordEncryptor with
the SamlTokenInterceptor
     public void setKeyIdentifierType(WSSecBase secBase, AbstractToken token) {
         boolean tokenTypeSet = false;
         


Mime
View raw message