import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.argeo.security.OsAuthenticationToken;
-import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.DefaultNameVersion;
import org.argeo.slc.NameVersion;
import org.argeo.slc.SlcException;
import org.argeo.slc.execution.ExecutionFlowDescriptor;
import org.argeo.slc.execution.ExecutionSpecAttribute;
import org.argeo.slc.execution.SlcAgent;
import org.argeo.slc.execution.SlcAgentCli;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.core.context.SecurityContextHolder;
/**
* Authenticates thread and executes synchronously a command line execution.
private final static String UTF8 = "UTF-8";
private SlcAgent agent;
- private AuthenticationManager authenticationManager;
+// private AuthenticationManager authenticationManager;
private Long timeout = 24 * 60 * 60 * 1000l;
public String process(String[] args) {
- if (SecurityContextHolder.getContext().getAuthentication() == null) {
- OsAuthenticationToken oat = new OsAuthenticationToken();
- Authentication authentication = authenticationManager
- .authenticate(oat);
- SecurityContextHolder.getContext()
- .setAuthentication(authentication);
- }
+// if (SecurityContextHolder.getContext().getAuthentication() == null) {
+// OsAuthenticationToken oat = new OsAuthenticationToken();
+// Authentication authentication = authenticationManager
+// .authenticate(oat);
+// SecurityContextHolder.getContext()
+// .setAuthentication(authentication);
+// }
if (args.length > 0 && args[0].equals("help")) {
StringBuilder buf = new StringBuilder();
appendModule(emd, buf);
}
} else if (args.length == 1 && !args[0].contains("/")) {// single module
- NameVersion nameVersion = new BasicNameVersion(args[0]);
+ NameVersion nameVersion = new DefaultNameVersion(args[0]);
ExecutionModuleDescriptor emd = agent.getExecutionModuleDescriptor(
nameVersion.getName(), nameVersion.getVersion());
appendModule(emd, buf);
protected void appendUriHelp(URI uri, StringBuilder buf) {
String[] path = uri.getPath().split("/");
- NameVersion nameVersion = new BasicNameVersion(path[1]);
+ NameVersion nameVersion = new DefaultNameVersion(path[1]);
ExecutionModuleDescriptor emd = agent.getExecutionModuleDescriptor(
nameVersion.getName(), nameVersion.getVersion());
this.agent = agent;
}
- public void setAuthenticationManager(
- AuthenticationManager authenticationManager) {
- this.authenticationManager = authenticationManager;
- }
+// public void setAuthenticationManager(
+// AuthenticationManager authenticationManager) {
+// this.authenticationManager = authenticationManager;
+// }
public void setTimeout(Long timeout) {
this.timeout = timeout;