-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.0.x' into renovate/gradle-7.x
- Loading branch information
Showing
69 changed files
with
938 additions
and
259 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ on: | |
- '[3-9]+.[3-9]+.x' | ||
workflow_dispatch: | ||
env: | ||
GIT_USER_NAME: puneetbehl | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_USER_NAME: grails-build | ||
GIT_USER_EMAIL: [email protected] | ||
|
||
jobs: | ||
core-tests: | ||
|
@@ -21,26 +21,27 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: gradle/wrapper-validation-action@v2 | ||
- uses: actions/setup-java@v4 | ||
with: { java-version: 11, distribution: temurin } | ||
with: { java-version: 17, distribution: temurin } | ||
- name: Run Tests | ||
uses: gradle/actions/setup-gradle@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: | | ||
check | ||
--refresh-dependencies | ||
-Dgeb.env=chromeHeadless | ||
functional-test: | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test-config: [ 'static', 'annotation', 'requestmap', 'basic', 'misc', 'putWithParams', 'bcrypt', 'issue503' ] | ||
test-config: [ 'static', 'annotation', 'requestmap', 'basic', 'basicCacheUsers', 'misc', 'putWithParams', 'bcrypt', 'issue503' ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: { java-version: 11, distribution: temurin } | ||
with: { java-version: 17, distribution: temurin } | ||
- name: Run Tests | ||
uses: gradle/actions/setup-gradle@v3 | ||
env: | ||
|
@@ -58,7 +59,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: gradle/wrapper-validation-action@v2 | ||
- uses: actions/setup-java@v4 | ||
with: { java-version: 11, distribution: temurin } | ||
with: { java-version: 17, distribution: temurin } | ||
- name: Run Build | ||
id: build | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
@@ -67,7 +68,9 @@ jobs: | |
with: | ||
arguments: | | ||
spring-security-core:build | ||
--refresh-dependencies | ||
-Dgeb.env=chromeHeadless | ||
-x javadoc | ||
- name: Publish Snapshot artifacts to Artifactory (repo.grails.org) | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
@@ -80,6 +83,7 @@ jobs: | |
arguments: | | ||
-Dorg.gradle.internal.publish.checksums.insecure=true | ||
spring-security-core:publish | ||
-x javadoc | ||
- name: Generate Snapshot Documentation | ||
if: success() | ||
|
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 @@ | ||
java=17.0.12-librca |
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
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
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
151 changes: 151 additions & 0 deletions
151
...ctional-test-app/src/integration-test/groovy/specs/BasicAuthCacheUsersSecuritySpec.groovy
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,151 @@ | ||
package specs | ||
|
||
import org.springframework.security.core.userdetails.UserCache | ||
import pages.LoginPage | ||
import pages.role.CreateRolePage | ||
import pages.role.ListRolePage | ||
import pages.role.ShowRolePage | ||
import pages.user.CreateUserPage | ||
import pages.user.ListUserPage | ||
import pages.user.ShowUserPage | ||
import spock.lang.IgnoreIf | ||
|
||
@IgnoreIf({ System.getProperty('TESTCONFIG') != 'basicCacheUsers' }) | ||
class BasicAuthCacheUsersSecuritySpec extends AbstractSecuritySpec { | ||
|
||
private HttpURLConnection connection | ||
UserCache userCache | ||
|
||
void 'create roles'() { | ||
when: | ||
to ListRolePage | ||
|
||
then: | ||
roleRows.size() == 0 | ||
|
||
when: | ||
newRoleButton.click() | ||
|
||
then: | ||
at CreateRolePage | ||
|
||
when: | ||
authority = 'ROLE_ADMIN' | ||
createButton.click() | ||
|
||
then: | ||
at ShowRolePage | ||
|
||
when: | ||
to ListRolePage | ||
|
||
then: | ||
roleRows.size() == 1 | ||
|
||
when: | ||
newRoleButton.click() | ||
|
||
then: | ||
at CreateRolePage | ||
|
||
when: | ||
authority = 'ROLE_ADMIN2' | ||
createButton.click() | ||
|
||
then: | ||
at ShowRolePage | ||
|
||
when: | ||
to ListRolePage | ||
|
||
then: | ||
roleRows.size() == 2 | ||
} | ||
|
||
void 'create users'() { | ||
when: | ||
to ListUserPage | ||
|
||
then: | ||
userRows.size() == 0 | ||
|
||
when: | ||
newUserButton.click() | ||
|
||
then: | ||
at CreateUserPage | ||
|
||
when: | ||
username = 'admin1' | ||
password = 'password1' | ||
$('#enabled').click() | ||
$('#ROLE_ADMIN').click() | ||
createButton.click() | ||
|
||
then: | ||
at ShowUserPage | ||
|
||
when: | ||
to ListUserPage | ||
|
||
then: | ||
userRows.size() == 1 | ||
|
||
when: | ||
newUserButton.click() | ||
|
||
then: | ||
at CreateUserPage | ||
|
||
when: | ||
username = 'admin2' | ||
password = 'password2' | ||
$('#enabled').click() | ||
$('#ROLE_ADMIN').click() | ||
$('#ROLE_ADMIN2').click() | ||
createButton.click() | ||
|
||
then: | ||
at ShowUserPage | ||
|
||
when: | ||
to ListUserPage | ||
|
||
then: | ||
userRows.size() == 2 | ||
} | ||
|
||
@IgnoreIf({ !System.getProperty('geb.env') }) | ||
void 'check userDetails caching'() { | ||
|
||
when: | ||
go 'secureAnnotated' | ||
|
||
then: | ||
at LoginPage | ||
|
||
when: | ||
login 'admin1', 'password1' | ||
|
||
then: | ||
assertContentContains 'you have ROLE_ADMIN' | ||
|
||
and: | ||
userCache.getUserFromCache('admin1') | ||
|
||
cleanup: | ||
logout() | ||
} | ||
|
||
protected void logout() { | ||
super.logout() | ||
// cheesy, but the 'Authentication' header from basic auth | ||
// isn't cleared, so this forces an invalid header | ||
getWithAuth '', 'not_a_valid_username', '' | ||
} | ||
|
||
private void getWithAuth(String path, String username, String password) { | ||
String uri = new URI(baseUrlRequired).resolve(new URI(path)) | ||
go uri.replace('http://', 'http://' + username + ':' + password + '@') | ||
} | ||
} |
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
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
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
Oops, something went wrong.