Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-15757] Add tests
A new test for the existing 'Remember me' functionality that verifies that the cookie is set, and a new test showing that, even if requested by the user, no cookie will be set, if 'Remember me' is disabled in the security configuration. Originally-Committed-As: 9ed2ed5fd90de8930802090cb7d0ffd0f996620c
- Loading branch information
1 parent
27ee887
commit 5b0d293
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
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. |
29 changes: 29 additions & 0 deletions
29
test/src/main/preset-data/secured-acegi/users/alice/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?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> |