Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
4f6fc658
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f6fc658
编写于
11月 07, 2013
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
7b50b589
a78bdf09
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
149 addition
and
13 deletion
+149
-13
changelog.html
changelog.html
+9
-0
core/pom.xml
core/pom.xml
+4
-4
core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java
...ain/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java
+5
-0
core/src/main/java/hudson/model/UpdateCenter.java
core/src/main/java/hudson/model/UpdateCenter.java
+1
-1
core/src/main/java/hudson/model/listeners/SaveableListener.java
...rc/main/java/hudson/model/listeners/SaveableListener.java
+9
-1
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
...main/java/hudson/security/HudsonPrivateSecurityRealm.java
+1
-1
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
...n/java/hudson/security/TokenBasedRememberMeServices2.java
+11
-0
core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties
.../diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties
+1
-1
core/src/main/resources/hudson/diagnosis/Messages.properties
core/src/main/resources/hudson/diagnosis/Messages.properties
+1
-0
core/src/main/resources/hudson/diagnosis/Messages_de.properties
...rc/main/resources/hudson/diagnosis/Messages_de.properties
+1
-0
core/src/main/resources/hudson/security/Messages.properties
core/src/main/resources/hudson/security/Messages.properties
+1
-1
core/src/main/resources/hudson/security/Messages_de.properties
...src/main/resources/hudson/security/Messages_de.properties
+1
-1
licenseCompleter.groovy
licenseCompleter.groovy
+1
-1
pom.xml
pom.xml
+2
-2
test/src/main/java/org/jvnet/hudson/test/recipes/PresetData.java
...c/main/java/org/jvnet/hudson/test/recipes/PresetData.java
+2
-0
test/src/main/preset-data/secured-acegi/config.xml
test/src/main/preset-data/secured-acegi/config.xml
+16
-0
test/src/main/preset-data/secured-acegi/readme.txt
test/src/main/preset-data/secured-acegi/readme.txt
+3
-0
test/src/main/preset-data/secured-acegi/users/alice/config.xml
...src/main/preset-data/secured-acegi/users/alice/config.xml
+29
-0
test/src/test/java/hudson/security/LoginTest.java
test/src/test/java/hudson/security/LoginTest.java
+51
-0
未找到文件。
changelog.html
浏览文件 @
4f6fc658
...
...
@@ -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>
)
...
...
core/pom.xml
浏览文件 @
4f6fc658
...
...
@@ -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.j
vnet.hudson
</groupId>
<groupId>
org.j
enkins-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>
...
...
core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java
浏览文件 @
4f6fc658
...
...
@@ -56,6 +56,11 @@ public final class HudsonHomeDiskUsageMonitor extends AdministrativeMonitor {
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.
*/
...
...
core/src/main/java/hudson/model/UpdateCenter.java
浏览文件 @
4f6fc658
...
...
@@ -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
();
}
...
...
core/src/main/java/hudson/model/listeners/SaveableListener.java
浏览文件 @
4f6fc658
...
...
@@ -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
())
{
try
{
l
.
onChange
(
o
,
file
);
}
catch
(
ThreadDeath
t
)
{
throw
t
;
}
catch
(
Throwable
t
)
{
Logger
.
getLogger
(
SaveableListener
.
class
.
getName
()).
log
(
Level
.
WARNING
,
null
,
t
);
}
}
}
...
...
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
浏览文件 @
4f6fc658
...
...
@@ -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
()
{
...
...
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
浏览文件 @
4f6fc658
...
...
@@ -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
());
...
...
core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties
浏览文件 @
4f6fc658
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.
...
...
core/src/main/resources/hudson/diagnosis/Messages.properties
浏览文件 @
4f6fc658
...
...
@@ -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
core/src/main/resources/hudson/diagnosis/Messages_de.properties
浏览文件 @
4f6fc658
...
...
@@ -24,3 +24,4 @@ MemoryUsageMonitor.USED=Verwendet
MemoryUsageMonitor.TOTAL
=
Total
OldDataMonitor.DisplayName
=
Veraltete Daten verwalten
OldDataMonitor.Description
=
Konfiguration bereinigen, um
\u
00DCberbleibsel alter Plugins und fr
\u
00FCherer Versionen zu entfernen.
HudsonHomeDiskUsageMonitor.DisplayName
=
Speicherplatz-Monitor
core/src/main/resources/hudson/security/Messages.properties
浏览文件 @
4f6fc658
...
...
@@ -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
\u2019
s
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.
\
...
...
core/src/main/resources/hudson/security/Messages_de.properties
浏览文件 @
4f6fc658
...
...
@@ -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
\u
00fcberein.
\
...
...
licenseCompleter.groovy
浏览文件 @
4f6fc658
...
...
@@ -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
)
}
...
...
pom.xml
浏览文件 @
4f6fc658
...
...
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>
org.jenkins-ci
</groupId>
<artifactId>
jenkins
</artifactId>
<version>
1.3
2
</version>
<version>
1.3
3
</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>
...
...
test/src/main/java/org/jvnet/hudson/test/recipes/PresetData.java
浏览文件 @
4f6fc658
...
...
@@ -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
>
{
...
...
test/src/main/preset-data/secured-acegi/config.xml
0 → 100644
浏览文件 @
4f6fc658
<?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>
test/src/main/preset-data/secured-acegi/readme.txt
0 → 100644
浏览文件 @
4f6fc658
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.
test/src/main/preset-data/secured-acegi/users/alice/config.xml
0 → 100644
浏览文件 @
4f6fc658
<?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>
test/src/test/java/hudson/security/LoginTest.java
浏览文件 @
4f6fc658
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录