servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r663626 - /servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
Date Thu, 05 Jun 2008 14:27:38 GMT
Author: ffang
Date: Thu Jun  5 07:27:37 2008
New Revision: 663626

URL: http://svn.apache.org/viewvc?rev=663626&view=rev
Log:
[SM-1367]Provide logging statements when doing authorization in SMX

Modified:
    servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java?rev=663626&r1=663625&r2=663626&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/security/SecuredBroker.java
Thu Jun  5 07:27:37 2008
@@ -25,6 +25,8 @@
 import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.security.auth.Subject;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
 import org.apache.servicemix.jbi.nmr.DefaultBroker;
 import org.apache.servicemix.jbi.security.acl.AuthorizationMap;
@@ -36,6 +38,7 @@
  */
 public class SecuredBroker extends DefaultBroker {
 
+    private static final Log LOG = LogFactory.getLog(SecuredBroker.class);
     private AuthorizationMap authorizationMap;
     
     public SecuredBroker() {
@@ -60,17 +63,21 @@
     }
 
     public void sendExchangePacket(MessageExchange me) throws JBIException {
+        LOG.debug("send exchange with secure broker");
         MessageExchangeImpl exchange = (MessageExchangeImpl) me;
         if (exchange.getRole() == Role.PROVIDER && exchange.getDestinationId() ==
null) {
             resolveAddress(exchange);
             ServiceEndpoint se = exchange.getEndpoint();
             if (se != null) {
+                LOG.debug("service name :" + se.getServiceName());
+                LOG.debug("operation name :" + me.getOperation());
                 Set<Principal> acls = authorizationMap.getAcls(se, me.getOperation());
                 if (!acls.contains(GroupPrincipal.ANY)) { 
                     Subject subject = exchange.getMessage("in").getSecuritySubject();
                     if (subject == null) {
                         throw new SecurityException("User not authenticated");
                     }
+                    LOG.debug("authorization for " + subject);
                     acls.retainAll(subject.getPrincipals());
                     if (acls.size() == 0) {
                         throw new SecurityException("Endpoint is not authorized for this
user");



Mime
View raw message