Revert explicit security context propagation
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Mar 2012 16:41:59 +0000 (16:41 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Mar 2012 16:41:59 +0000 (16:41 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5140 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionThread.java
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ProcessThread.java
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ProcessThreadGroup.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/BundlesManager.java

index 23bb947eee3ca5e240d179c13861b33fd7799ce3..075a851dc8af90e99f7fc63b07041f637b92d27f 100644 (file)
@@ -18,12 +18,9 @@ package org.argeo.slc.core.execution;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
 import org.argeo.slc.execution.ExecutionFlowDescriptor;
 import org.argeo.slc.execution.ExecutionStep;
 import org.argeo.slc.process.RealizedFlow;
-import org.springframework.security.Authentication;
-import org.springframework.security.context.SecurityContextHolder;
 
 /** Thread of a single execution */
 public class ExecutionThread extends Thread {
@@ -44,11 +41,11 @@ public class ExecutionThread extends Thread {
 
        public void run() {
                // authenticate thread
-               Authentication authentication = getProcessThreadGroup()
-                               .getAuthentication();
-               if (authentication == null)
-                       throw new SlcException("Can only execute authenticated threads");
-               SecurityContextHolder.getContext().setAuthentication(authentication);
+//             Authentication authentication = getProcessThreadGroup()
+//                             .getAuthentication();
+//             if (authentication == null)
+//                     throw new SlcException("Can only execute authenticated threads");
+//             SecurityContextHolder.getContext().setAuthentication(authentication);
 
                if (getContextClassLoader() != null) {
                        if (log.isTraceEnabled())
index 3117a3fd578b8229f7c4de65479916532b5e6464..98d715ece3962f5eb77669d912a44ffa28124e1c 100644 (file)
@@ -30,8 +30,6 @@ import org.argeo.slc.execution.ExecutionProcess;
 import org.argeo.slc.execution.ExecutionStep;
 import org.argeo.slc.process.RealizedFlow;
 import org.argeo.slc.process.SlcExecution;
-import org.springframework.security.Authentication;
-import org.springframework.security.context.SecurityContextHolder;
 
 /** Thread of the SLC Process, starting the sub executions. */
 @SuppressWarnings("deprecation")
@@ -60,14 +58,17 @@ public class ProcessThread extends Thread {
 
        public final void run() {
                // authenticate thread
-               Authentication authentication = getProcessThreadGroup()
-                               .getAuthentication();
-               if (authentication == null)
-                       throw new SlcException("Can only execute authenticated threads");
-               SecurityContextHolder.getContext().setAuthentication(authentication);
-
-               log.info("\n##\n## SLC Process #" + process.getUuid() + " STARTED by "
-                               + authentication.getName() + "\n##\n");
+               // Authentication authentication = getProcessThreadGroup()
+               // .getAuthentication();
+               // if (authentication == null)
+               // throw new SlcException("Can only execute authenticated threads");
+               // SecurityContextHolder.getContext().setAuthentication(authentication);
+
+               // log.info("\n##\n## SLC Process #" + process.getUuid() +
+               // " STARTED by "
+               // + authentication.getName() + "\n##\n");
+               log.info("\n##\n## SLC Process #" + process.getUuid()
+                               + " STARTED\n##\n");
 
                // Start logging
                new LoggingThread().start();
index d7fa4f959eb45361d444b21e1ee08442a3322a1a..03b72f6052adad7ae80b38ac58c23eb7acd842b0 100644 (file)
@@ -26,15 +26,13 @@ import org.argeo.slc.execution.ExecutionProcess;
 import org.argeo.slc.execution.ExecutionStep;
 import org.argeo.slc.process.SlcExecution;
 import org.argeo.slc.process.SlcExecutionStep;
-import org.springframework.security.Authentication;
-import org.springframework.security.context.SecurityContextHolder;
 
 /** The thread group attached to a given {@link SlcExecution}. */
 @SuppressWarnings("deprecation")
 public class ProcessThreadGroup extends ThreadGroup {
        private final ExecutionModulesManager executionModulesManager;
        private final ProcessThread processThread;
-       private final Authentication authentication;
+//     private final Authentication authentication;
        private final static Integer STEPS_BUFFER_CAPACITY = 5000;
 
        private BlockingQueue<ExecutionStep> steps = new ArrayBlockingQueue<ExecutionStep>(
@@ -46,13 +44,13 @@ public class ProcessThreadGroup extends ThreadGroup {
                                + " thread group");
                this.executionModulesManager = executionModulesManager;
                this.processThread = processThread;
-               this.authentication = SecurityContextHolder.getContext()
-                               .getAuthentication();
+//             this.authentication = SecurityContextHolder.getContext()
+//                             .getAuthentication();
        }
 
-       public Authentication getAuthentication() {
-               return authentication;
-       }
+//     public Authentication getAuthentication() {
+//             return authentication;
+//     }
 
        public void dispatchAddStep(ExecutionStep step) {
                // legacy
index c7c4cc1c138439a80d8853a4557390ecdf0c2297..2571efe9d0f70a64393441265069f2644dcf6ce9 100644 (file)
@@ -49,7 +49,7 @@ public class BundlesManager implements BundleContextAware, FrameworkListener,
 
        private BundleContext bundleContext;
 
-       private Long defaultTimeout = 120 * 1000l;
+       private Long defaultTimeout = 30 * 1000l;
        private Long pollingPeriod = 200l;
 
        // Refresh sync objects