Merge remote branch 'origin/master' into momo

* origin/master: (91 commits)
  Parsing can happen in the forked Maven process. Support remoting.
  Fixed the test failures.
  Strip whitespace on maven installation.
  updated ja.
  Use relative path to validate new view name (in order to allow ViewGroups like NestedView to override)
  Added i18n.
  moved to the model package to colocate with the Result class, since I don't think this class is tied by itself to the notification.
  doc improvements
  enum to describe a result trend - i.e. change from the previous to the current result
  Recording the previous change.
  Do not include trailing periods in console links.
  doc improvements
  Added a hook to customize the XML parser behaviour.
  - Renamed from 'linked' to 'base' - Fixed the bug where multi-level base setting wasn't working properly - Improved docs
  Updated style
  Added convenience method for getting configuration run
  Initial commit
  the trunk is toward 1.416-SNAPSHOT
  creating an RC branch
  updated changelog as a part of the release
  ...

Conflicts:
	core/src/main/java/hudson/slaves/NodeProvisioner.java
	maven-plugin/src/main/java/hudson/maven/MavenModule.java
	maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
This commit is contained in:
Nigel Magnay committed 2011-06-07 09:04:40 +01:00
commit 2adef6719a
70 files changed
+1088 -338

No files matched your search

@@ -27,6 +27,7 @@ import jenkins.model.Jenkins;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;
import hudson.util.Scrambler;
import hudson.util.Secret;
import hudson.util.XStream2;
import java.io.File;
@@ -59,10 +60,20 @@ public final class ProxyConfiguration implements Saveable {
public final int port;
/**
* Possibly null proxy user name and password.
* Password is base64 scrambled since this is persisted to disk.
* Possibly null proxy user name.
*/
private final String userName,password;
private final String userName;
/**
* null
*/
@Deprecated
private String password;
/**
* encrypted password
*/
private Secret secretPassword;
public ProxyConfiguration(String name, int port) {
this(name,port,null,null);
@@ -72,15 +83,24 @@ public final class ProxyConfiguration implements Saveable {
this.name = name;
this.port = port;
this.userName = userName;
this.password = Scrambler.scramble(password);
this.secretPassword = Secret.fromString(password);
}
public String getUserName() {
return userName;
}
// This method is public, if it was public only for jelly, then should make it private (or inline contents)
// Have left public, as can't tell if anyone else is using from plugins
/**
* @return the password in plain text
*/
public String getPassword() {
return Scrambler.descramble(password);
return Secret.toString(secretPassword);
}
public String getEncryptedPassword() {
return (secretPassword == null) ? null : secretPassword.getEncryptedValue();
}
public Proxy createProxy() {
@@ -94,6 +114,14 @@ public final class ProxyConfiguration implements Saveable {
SaveableListener.fireOnChange(this, config);
}
public Object readResolve() {
if (secretPassword == null)
// backward compatibility : get crambled password and store it encrypted
secretPassword = Secret.fromString(Scrambler.descramble(password));
password = null;
return this;
}
public static XmlFile getXmlFile() {
return new XmlFile(XSTREAM, new File(Jenkins.getInstance().getRootDir(), "proxy.xml"));
}