mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
rolling back JNLPSecurityMode before a release. I would like to have more discussion
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3371 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
fe6ce07b2e
commit
3ca379df39
7 files changed
+6
-149
No files matched your search
@@ -189,10 +189,6 @@ public class Functions {
|
||||
return Node.Mode.values();
|
||||
}
|
||||
|
||||
public static Node.JNLPSecurityMode[] getJNLPSecurityModes() {
|
||||
return Node.JNLPSecurityMode.values();
|
||||
}
|
||||
|
||||
public static String getProjectListString(List<Project> projects) {
|
||||
return Items.toNameList(projects);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package hudson.model;
|
||||
|
||||
import hudson.EnvVars;
|
||||
import hudson.Functions;
|
||||
import hudson.Util;
|
||||
import hudson.remoting.Callable;
|
||||
import hudson.remoting.VirtualChannel;
|
||||
import hudson.util.DaemonThreadFactory;
|
||||
@@ -19,10 +18,10 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
/**
|
||||
* Represents a set of {@link Executor}s on the same computer.
|
||||
@@ -118,30 +117,6 @@ public abstract class Computer implements ModelObject {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this computer is needs to be launched via JNLP. That is if the Launch slave agent link should be
|
||||
* visible.
|
||||
* @return true if and only if the JNLP link should be shown.
|
||||
*/
|
||||
public boolean isJnlpAgentLaunchVisible() {
|
||||
return isJnlpAgent() && isOffline() && !isTemporarilyOffline();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the JNLP link should be restricted to authenticated in users.
|
||||
* @return true if and only if the JNLP link should be restricted to authenticated users.
|
||||
*/
|
||||
public boolean isJnlpAgentLaunchAdminOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the JNLP link should be visible from the main page.
|
||||
* @return true if and only if the JNLP link should be availible from the main page.
|
||||
*/
|
||||
public boolean isJnlpAgentLaunchPublic() {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns true if this node is marked temporarily offline by the user.
|
||||
*
|
||||
|
||||
@@ -96,52 +96,4 @@ public interface Node {
|
||||
ConvertUtils.register(new EnumConverter(),Mode.class);
|
||||
}
|
||||
}
|
||||
|
||||
enum JNLPSecurityMode {
|
||||
NORMAL("Launch only from Computer detail. Require Login if security enabled.", true, false, false),
|
||||
SECURE_PUBLIC("Launch from front page. Require Login if security enabled.", true, false, false),
|
||||
BYPASS("Launch only from Computer detail. Login never required. (!See WARNING in help --> !)", false, false, false)/*,
|
||||
// stephenconnolly: backing these next changes until a better model is available
|
||||
PUBLIC("Launch from front page. Login never required.", false, true, false),
|
||||
|
||||
// stephenconnolly: holding off on these next changes until they are closer to ready
|
||||
DYNAMIC("Dynamic secure slave (experimental)", true, true, true),
|
||||
DYNAMIC("Dynamic public slave (experimental)", false, true, true)*/;
|
||||
|
||||
private final String description;
|
||||
private final boolean enforceSecurity;
|
||||
private final boolean publicLaunch;
|
||||
private final boolean dynamicPool;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public boolean isEnforceSecurity() {
|
||||
return enforceSecurity;
|
||||
}
|
||||
|
||||
public boolean isPublicLaunch() {
|
||||
return publicLaunch;
|
||||
}
|
||||
|
||||
public boolean isDynamicPool() {
|
||||
return dynamicPool;
|
||||
}
|
||||
|
||||
JNLPSecurityMode(String description, boolean enforceSecurity, boolean publicLaunch, boolean dynammicPool) {
|
||||
this.description = description;
|
||||
this.enforceSecurity = enforceSecurity;
|
||||
this.publicLaunch = publicLaunch;
|
||||
this.dynamicPool = dynammicPool;
|
||||
}
|
||||
|
||||
static {
|
||||
ConvertUtils.register(new EnumConverter(), JNLPSecurityMode.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,11 +74,6 @@ public final class Slave implements Node, Serializable {
|
||||
*/
|
||||
private Mode mode;
|
||||
|
||||
/**
|
||||
* JNLP Security mode
|
||||
*/
|
||||
private JNLPSecurityMode jnlpSecurity;
|
||||
|
||||
/**
|
||||
* Command line to launch the agent, like
|
||||
* "ssh myslave java -jar /path/to/hudson-remoting.jar"
|
||||
@@ -102,14 +97,13 @@ public final class Slave implements Node, Serializable {
|
||||
* @stapler-constructor
|
||||
*/
|
||||
public Slave(String name, String description, String command, String remoteFS, int numExecutors, Mode mode,
|
||||
String label, JNLPSecurityMode jnlpSecurity) throws FormException {
|
||||
String label) throws FormException {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.numExecutors = numExecutors;
|
||||
this.mode = mode;
|
||||
this.agentCommand = command;
|
||||
this.remoteFS = remoteFS;
|
||||
this.jnlpSecurity = jnlpSecurity;
|
||||
this.label = Util.fixNull(label).trim();
|
||||
getAssignedLabels(); // compute labels now
|
||||
|
||||
@@ -156,10 +150,6 @@ public final class Slave implements Node, Serializable {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public JNLPSecurityMode getJnlpSecurity() {
|
||||
return jnlpSecurity;
|
||||
}
|
||||
|
||||
public String getLabelString() {
|
||||
return Util.fixNull(label).trim();
|
||||
}
|
||||
@@ -324,44 +314,6 @@ public final class Slave implements Node, Serializable {
|
||||
return getNode().getCommand().length()==0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if this computer is needs to be launched via JNLP. That is if the Launch slave agent link should be
|
||||
* visible.
|
||||
*
|
||||
* @return true if and only if the JNLP link should be shown.
|
||||
*/
|
||||
@Override
|
||||
public boolean isJnlpAgentLaunchVisible() {
|
||||
if (getNode().getJnlpSecurity().isDynamicPool()) {
|
||||
return isJnlpAgent();
|
||||
}
|
||||
return super.isJnlpAgentLaunchVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the JNLP link should be restricted to authenticated in users.
|
||||
*
|
||||
* @return true if and only if the JNLP link should be restricted to authenticated users.
|
||||
*/
|
||||
@Override
|
||||
public boolean isJnlpAgentLaunchAdminOnly() {
|
||||
return getNode().getJnlpSecurity().isEnforceSecurity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the JNLP link should be visible from the main page.
|
||||
*
|
||||
* @return true if and only if the JNLP link should be availible from the main page.
|
||||
*/
|
||||
@Override
|
||||
public boolean isJnlpAgentLaunchPublic() {
|
||||
if (getNode().getJnlpSecurity().isPublicLaunch()) {
|
||||
return isJnlpAgent();
|
||||
}
|
||||
return super.isJnlpAgentLaunchPublic(); //To change body of overridden methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
/**
|
||||
* Launches a remote agent.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user