提交 4f6fc658 编写于 作者: K Kohsuke Kawaguchi

Merge remote-tracking branch 'origin/master'

......@@ -55,6 +55,15 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
hudson appears in a the webpage title.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14380">issue 14380</a>)
<li class=bug>
Linkage error in <code>InitializerFinder.discoverTasks</code> blocks startup.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20442">issue 20442</a>)
<li class=rfe>
Add Test button to check proxy connection
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20191">issue 20191</a>)
<li class=rfe>
Show different “up” link for jobs in folders.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20106">issue 20106</a>)
......
......@@ -194,7 +194,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
<version>1.5</version>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
......@@ -202,9 +202,9 @@ THE SOFTWARE.
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<groupId>org.jenkins-ci</groupId>
<artifactId>task-reactor</artifactId>
<version>1.2</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jvnet.localizer</groupId>
......@@ -787,7 +787,7 @@ THE SOFTWARE.
<plugin><!-- generate Jelly tag lib documentation -->
<groupId>org.kohsuke.stapler</groupId>
<artifactId>maven-stapler-plugin</artifactId>
<version>1.16</version>
<!-- version specified in grandparent pom -->
<configuration>
<patterns>
<pattern>/lib/.*</pattern>
......
......@@ -55,6 +55,11 @@ public final class HudsonHomeDiskUsageMonitor extends AdministrativeMonitor {
public boolean isActivated() {
return activated;
}
@Override
public String getDisplayName() {
return Messages.HudsonHomeDiskUsageMonitor_DisplayName();
}
/**
* Depending on whether the user said "yes" or "no", send him to the right place.
......
......@@ -1544,7 +1544,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
*
* This has to wait until after all plugins load, to let custom UpdateCenterConfiguration take effect first.
*/
@Initializer(after=PLUGINS_STARTED)
@Initializer(after=PLUGINS_STARTED, fatal=false)
public static void init(Jenkins h) throws IOException {
h.getUpdateCenter().load();
}
......
......@@ -30,6 +30,8 @@ import hudson.ExtensionList;
import hudson.XmlFile;
import jenkins.model.Jenkins;
import hudson.model.Saveable;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Receives notifications about save actions on {@link Saveable} objects in Hudson.
......@@ -75,7 +77,13 @@ public abstract class SaveableListener implements ExtensionPoint {
*/
public static void fireOnChange(Saveable o, XmlFile file) {
for (SaveableListener l : all()) {
l.onChange(o,file);
try {
l.onChange(o,file);
} catch (ThreadDeath t) {
throw t;
} catch (Throwable t) {
Logger.getLogger(SaveableListener.class.getName()).log(Level.WARNING, null, t);
}
}
}
......
......@@ -357,7 +357,7 @@ public class HudsonPrivateSecurityRealm extends AbstractPasswordBasedSecurityRea
* This is used primarily when the object is listed in the breadcrumb, in the user management screen.
*/
public String getDisplayName() {
return "User Database";
return Messages.HudsonPrivateSecurityRealm_DisplayName();
}
public ACL getACL() {
......
......@@ -28,6 +28,7 @@ import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;
import jenkins.security.HMACConfidentialKey;
import org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices;
import org.acegisecurity.userdetails.UserDetails;
......@@ -71,6 +72,16 @@ public class TokenBasedRememberMeServices2 extends TokenBasedRememberMeServices
return;
}
Jenkins j = Jenkins.getInstance();
if (j != null && j.isDisableRememberMe()) {
if (logger.isDebugEnabled()) {
logger.debug("Did not send remember-me cookie because 'Remember Me' is disabled in " +
"security configuration (principal did set parameter '" + getParameter() + "')");
}
// XXX log warning when receiving remember-me request despite the feature being disabled?
return;
}
Assert.notNull(successfulAuthentication.getPrincipal());
Assert.notNull(successfulAuthentication.getCredentials());
Assert.isInstanceOf(UserDetails.class, successfulAuthentication.getPrincipal());
......
JENKINS_HOME\ is\ almost\ full=Der Speicherplatz für JENKINS_HOME is fast erschöpft.
blurb=Der Speicherplatz für H<tt>JENKINS_HOME</tt> is fast erschöpft.
blurb=Der Speicherplatz für <tt>JENKINS_HOME</tt> is fast erschöpft.
description.1=Das Verzeichnis <tt>JENKINS_HOME</tt> ({0}) ist fast voll. Ist dieser Speicherplatz \
vollständig erschöpft, kann Jenkins keine weiteren Daten mehr speichern und wird abstürzen.
description.2=Um dieses Problem zu vermeiden, sollten Sie jetzt handeln.
......
......@@ -2,3 +2,4 @@ MemoryUsageMonitor.USED=Used
MemoryUsageMonitor.TOTAL=Total
OldDataMonitor.Description=Scrub configuration files to remove remnants from old plugins and earlier versions.
OldDataMonitor.DisplayName=Manage Old Data
HudsonHomeDiskUsageMonitor.DisplayName=Disk Usage Monitor
......@@ -24,3 +24,4 @@ MemoryUsageMonitor.USED=Verwendet
MemoryUsageMonitor.TOTAL=Total
OldDataMonitor.DisplayName=Veraltete Daten verwalten
OldDataMonitor.Description=Konfiguration bereinigen, um \u00DCberbleibsel alter Plugins und fr\u00FCherer Versionen zu entfernen.
HudsonHomeDiskUsageMonitor.DisplayName=Speicherplatz-Monitor
......@@ -25,7 +25,7 @@ GlobalSecurityConfiguration.Description=Secure Jenkins; define who is allowed to
HudsonPrivateSecurityRealm.WouldYouLikeToSignUp=This {0} {1} is new to Jenkins. Would you like to sign up?
LegacyAuthorizationStrategy.DisplayName=Legacy mode
HudsonPrivateSecurityRealm.DisplayName=Jenkins\u2019s own user database
HudsonPrivateSecurityRealm.DisplayName=Jenkins\u2019 own user database
HudsonPrivateSecurityRealm.Details.DisplayName=Password
HudsonPrivateSecurityRealm.Details.PasswordError=\
The confirmed password is not the same as the one entered. \
......
......@@ -24,7 +24,7 @@ GlobalSecurityConfiguration.Description=Jenkins absichern und festlegen, wer Zug
LegacyAuthorizationStrategy.DisplayName=Legacy-Autorisierung
HudsonPrivateSecurityRealm.DisplayName=Jenkins' eingebautes Benutzerverzeichnis
HudsonPrivateSecurityRealm.DisplayName=Jenkins\u2019 eingebautes Benutzerverzeichnis
HudsonPrivateSecurityRealm.Details.DisplayName=Passwort
HudsonPrivateSecurityRealm.Details.PasswordError=\
Das angegebene Passwort und seine Wiederholung stimmen nicht \u00fcberein. \
......
......@@ -68,7 +68,7 @@ complete {
// these are our own modules that have license in the trunk but not in these released versions
// as we upgrade them, we should just pick up the license info from POM
match(["org.jvnet.hudson:task-reactor","org.jvnet.hudson:annotation-indexer","*:jinterop-wmi","*:maven2.1-interceptor","*:lib-jenkins-maven-embedder"]) {
match(["*:jinterop-wmi","*:maven2.1-interceptor","*:lib-jenkins-maven-embedder"]) {
rewriteLicense([],jenkinsLicense)
}
......
......@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.32</version>
<version>1.33</version>
</parent>
<groupId>org.jenkins-ci.main</groupId>
......@@ -397,7 +397,7 @@ THE SOFTWARE.
-->
<groupId>org.kohsuke.stapler</groupId>
<artifactId>maven-stapler-plugin</artifactId>
<version>1.16</version>
<!-- version specified in grandparent pom -->
<extensions>true</extensions>
<dependencies>
<dependency>
......
......@@ -62,6 +62,8 @@ public @interface PresetData {
* and any logged in user has a full access.
*/
ANONYMOUS_READONLY,
SECURED_ACEGI,
}
class RunnerImpl extends Recipe.Runner<PresetData> {
......
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy"/>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
<jdks/>
<slaves/>
<quietPeriod>5</quietPeriod>
<slaveAgentPort>0</slaveAgentPort>
<secretKey>ed2e66995bec739c0ec71c260bd75be6918ff28b0f1b33d67e205297629a6264</secretKey>
</hudson>
Anonymous users have no permissions, logged in users can do anything.
Uses Jenkins user database, because 'Remember me' functionality requires non-legacy security realm to be enabled.
<?xml version='1.0' encoding='UTF-8'?>
<user>
<fullName>Alice</fullName>
<properties>
<jenkins.security.ApiTokenProperty>
<apiToken>0K7w+E0Bi/rJt1lombWFDYtw0/KLFHwBjJqN8tUd2QO4tzVXKCPuIq2uWlTUdeBd</apiToken>
</jenkins.security.ApiTokenProperty>
<hudson.model.MyViewsProperty>
<views>
<hudson.model.AllView>
<owner class="hudson.model.MyViewsProperty" reference="../../.."/>
<name>All</name>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
</hudson.model.AllView>
</views>
</hudson.model.MyViewsProperty>
<hudson.search.UserSearchProperty>
<insensitiveSearch>false</insensitiveSearch>
</hudson.search.UserSearchProperty>
<hudson.security.HudsonPrivateSecurityRealm_-Details>
<passwordHash>#jbcrypt:$2a$10$9m4niaJ3tOglIM22Yd.LdOwuU9RcD9FpuXlqlJhQHKt5Qx2mh.2/i</passwordHash>
</hudson.security.HudsonPrivateSecurityRealm_-Details>
<hudson.tasks.Mailer_-UserProperty plugin="mailer@1.5">
<emailAddress>alice@example.org</emailAddress>
</hudson.tasks.Mailer_-UserProperty>
</properties>
</user>
package hudson.security;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.recipes.PresetData;
import org.jvnet.hudson.test.recipes.PresetData.DataSet;
import org.xml.sax.SAXException;
import static org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY;
import java.io.IOException;
import java.net.URL;
......@@ -41,4 +46,50 @@ public class LoginTest extends HudsonTestCase {
// but not once the user logs in.
verifyNotError(wc.login("alice"));
}
private HtmlForm prepareLoginFormWithRememberMeChecked(WebClient wc) throws IOException, org.xml.sax.SAXException {
wc.getCookieManager().setCookiesEnabled(true);
HtmlPage page = wc.goTo("login");
HtmlForm form = page.getFormByName("login");
form.getInputByName("j_username").setValueAttribute("alice");
form.getInputByName("j_password").setValueAttribute("alice");
((HtmlCheckBoxInput)form.getInputByName("remember_me")).setChecked(true);
return form;
}
/**
* Returns the 'remember me' cookie if set, otherwise return null. We don't care about the type, only whether it's null
*/
private Object getRememberMeCookie(WebClient wc) {
return wc.getCookieManager().getCookie(ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY);
}
/**
* Test 'remember me' cookie
*/
@PresetData(DataSet.SECURED_ACEGI)
public void testLoginRememberMe() throws Exception {
WebClient wc = createWebClient();
prepareLoginFormWithRememberMeChecked(wc).submit(null);
assertNotNull(getRememberMeCookie(wc));
}
/**
* Test that 'remember me' cookie will not be set if disabled even if requested by user.
* This models the case when the feature is disabled between another user loading and submitting the login page.
*/
@PresetData(DataSet.SECURED_ACEGI)
public void testLoginDisabledRememberMe() throws Exception {
WebClient wc = createWebClient();
HtmlForm form = prepareLoginFormWithRememberMeChecked(wc);
jenkins.setDisableRememberMe(true);
form.submit(null);
assertNull(getRememberMeCookie(wc));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册