cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r932002 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/security/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/ rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/
Date Thu, 08 Apr 2010 16:56:00 GMT
Author: sergeyb
Date: Thu Apr  8 16:55:59 2010
New Revision: 932002

URL: http://svn.apache.org/viewvc?rev=932002&view=rev
Log:
Merged revisions 931228 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r931228 | sergeyb | 2010-04-06 18:07:15 +0100 (Tue, 06 Apr 2010) | 1 line
  
  CXF-2754,CXF-2755 : extending WSS4JInInterceptor, adding utility Authorizing interceptors
........

Added:
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/
      - copied from r931228, cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
      - copied unchanged from r931228, cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AccessDeniedException.java
      - copied unchanged from r931228, cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AccessDeniedException.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
      - copied unchanged from r931228, cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JSecurityContextProvidingInterceptor.java
      - copied unchanged from r931228, cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JSecurityContextProvidingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SimpleSubjectCreatingInterceptor.java
      - copied unchanged from r931228, cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SimpleSubjectCreatingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java
      - copied unchanged from r931228, cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/UserNameTokenAuthorizationTest.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr  8 16:55:59 2010
@@ -1 +1 @@
-/cxf/trunk:931644,931758,931765
+/cxf/trunk:931228,931644,931758,931765

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=932002&r1=932001&r2=932002&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Thu Apr  8 16:55:59 2010
@@ -396,21 +396,25 @@ public class WSS4JInInterceptor extends 
                 msg.put(PRINCIPAL_RESULT, p);                   
                 SecurityContext sc = msg.get(SecurityContext.class);
                 if (sc == null || sc.getUserPrincipal() == null) {
-                    SecurityContext c = new SecurityContext() {
-                        public Principal getUserPrincipal() {
-                            return p;
-                        }
-                        public boolean isUserInRole(String role) {
-                            return false;
-                        }
-                    };
-                    msg.put(SecurityContext.class, c);
+                    msg.put(SecurityContext.class, createSecurityContext(p));
                     break;
                 }
             }            
         }
     }
 
+    
+    protected SecurityContext createSecurityContext(final Principal p) {
+        return new SecurityContext() {
+            public Principal getUserPrincipal() {
+                return p;
+            }
+            public boolean isUserInRole(String role) {
+                return false;
+            }
+        };
+    }
+    
     private String getAction(SoapMessage msg, SoapVersion version) {
         String action = (String)getOption(WSHandlerConstants.ACTION);
         if (action == null) {
@@ -461,7 +465,7 @@ public class WSS4JInInterceptor extends 
         
     }
 
-    private CallbackHandler getCallback(RequestData reqData, int doAction) throws WSSecurityException
{
+    protected CallbackHandler getCallback(RequestData reqData, int doAction) throws WSSecurityException
{
         /*
          * To check a UsernameToken or to decrypt an encrypted message we need a
          * password.
@@ -519,7 +523,7 @@ public class WSS4JInInterceptor extends 
      * TODO the WSHandler base class defines secEngine to be static, which
      * is really bad, because the engine has mutable state on it.
      */
-    private WSSecurityEngine
+    protected WSSecurityEngine
     getSecurityEngine() {
         if (secEngineOverride != null) {
             return secEngineOverride;
@@ -535,7 +539,7 @@ public class WSS4JInInterceptor extends 
      * TODO The WSS4J APIs leave something to be desired here, but hopefully
      * we'll clean all this up in WSS4J-2.0
      */
-    private static WSSecurityEngine
+    protected static WSSecurityEngine
     createSecurityEngine(
         final Map<QName, Object> map
     ) {



Mime
View raw message