Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02b8d4cb32 | |||
| e0655bee7c | |||
| 1a90041271 | |||
| 2ee188ee36 |
@@ -15,4 +15,3 @@
|
|||||||
*.otg binary
|
*.otg binary
|
||||||
*.png binary
|
*.png binary
|
||||||
*.hsx binary
|
*.hsx binary
|
||||||
*.serialized binary
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
require:
|
|
||||||
members: false
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
version: 2
|
|
||||||
registries:
|
|
||||||
spring-milestones:
|
|
||||||
type: maven-repository
|
|
||||||
url: https://repo.spring.io/milestone
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: gradle
|
|
||||||
target-branch: 6.4.x
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
time: '03:00'
|
|
||||||
timezone: Etc/UTC
|
|
||||||
labels:
|
|
||||||
- 'type: dependency-upgrade'
|
|
||||||
registries:
|
|
||||||
- spring-milestones
|
|
||||||
ignore:
|
|
||||||
- dependency-name: com.nimbusds:nimbus-jose-jwt
|
|
||||||
- dependency-name: org.python:jython
|
|
||||||
- dependency-name: org.apache.directory.server:*
|
|
||||||
- dependency-name: org.apache.directory.shared:*
|
|
||||||
- dependency-name: org.junit:junit-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: org.mockito:mockito-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: '*'
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- version-update:semver-minor
|
|
||||||
- package-ecosystem: gradle
|
|
||||||
target-branch: 6.3.x
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
time: '03:00'
|
|
||||||
timezone: Etc/UTC
|
|
||||||
labels:
|
|
||||||
- 'type: dependency-upgrade'
|
|
||||||
registries:
|
|
||||||
- spring-milestones
|
|
||||||
ignore:
|
|
||||||
- dependency-name: com.nimbusds:nimbus-jose-jwt
|
|
||||||
- dependency-name: org.python:jython
|
|
||||||
- dependency-name: org.apache.directory.server:*
|
|
||||||
- dependency-name: org.apache.directory.shared:*
|
|
||||||
- dependency-name: org.junit:junit-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: org.mockito:mockito-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: '*'
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- version-update:semver-minor
|
|
||||||
- package-ecosystem: gradle
|
|
||||||
target-branch: main
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
time: '03:00'
|
|
||||||
timezone: Etc/UTC
|
|
||||||
labels:
|
|
||||||
- 'type: dependency-upgrade'
|
|
||||||
registries:
|
|
||||||
- spring-milestones
|
|
||||||
ignore:
|
|
||||||
- dependency-name: com.nimbusds:nimbus-jose-jwt
|
|
||||||
- dependency-name: org.python:jython
|
|
||||||
- dependency-name: org.apache.directory.server:*
|
|
||||||
- dependency-name: org.apache.directory.shared:*
|
|
||||||
- dependency-name: org.junit:junit-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: org.mockito:mockito-bom
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- dependency-name: com.gradle.enterprise
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- version-update:semver-minor
|
|
||||||
- dependency-name: '*'
|
|
||||||
update-types:
|
|
||||||
- version-update:semver-major
|
|
||||||
- version-update:semver-minor
|
|
||||||
|
|
||||||
- package-ecosystem: github-actions
|
|
||||||
target-branch: 6.3.x
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
labels:
|
|
||||||
- 'type: task'
|
|
||||||
- 'in: build'
|
|
||||||
ignore:
|
|
||||||
- dependency-name: sjohnr/*
|
|
||||||
- package-ecosystem: github-actions
|
|
||||||
target-branch: docs-build
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
labels:
|
|
||||||
- 'type: task'
|
|
||||||
- 'in: build'
|
|
||||||
|
|
||||||
- package-ecosystem: npm
|
|
||||||
target-branch: docs-build
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
labels:
|
|
||||||
- 'type: task'
|
|
||||||
- 'in: build'
|
|
||||||
|
|
||||||
- package-ecosystem: npm
|
|
||||||
target-branch: main
|
|
||||||
directory: /docs
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
labels:
|
|
||||||
- 'type: task'
|
|
||||||
- 'in: build'
|
|
||||||
- package-ecosystem: npm
|
|
||||||
target-branch: 6.3.x
|
|
||||||
directory: /docs
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
labels:
|
|
||||||
- 'type: task'
|
|
||||||
- 'in: build'
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
name: Clean build artifacts
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 10 * * *' # Once per day at 10am UTC
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
main:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.repository == 'spring-projects/spring-security' }}
|
|
||||||
permissions:
|
|
||||||
contents: none
|
|
||||||
steps:
|
|
||||||
- name: Delete artifacts in cron job
|
|
||||||
env:
|
|
||||||
GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
|
|
||||||
run: |
|
|
||||||
echo "Running clean build artifacts logic"
|
|
||||||
output=$(curl -X GET -H "Authorization: token $GH_ACTIONS_REPO_TOKEN" https://api.github.com/repos/spring-projects/spring-security/actions/artifacts | grep '"id"' | cut -d : -f2 | sed 's/,*$//g')
|
|
||||||
echo Output is $output
|
|
||||||
for id in $output; do curl -X DELETE -H "Authorization: token $GH_ACTIONS_REPO_TOKEN" https://api.github.com/repos/spring-projects/spring-security/actions/artifacts/$id; done;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
name: "CodeQL Advanced"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
permissions: read-all
|
|
||||||
jobs:
|
|
||||||
codeql-analysis-call:
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
uses: spring-io/github-actions/.github/workflows/codeql-analysis.yml@e415dadd0910c901e7a7fabd67bbb355b2324500 # 1
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- "dependabot/**"
|
|
||||||
schedule:
|
|
||||||
- cron: '0 10 * * *' # Once per day at 10am UTC
|
|
||||||
workflow_dispatch: # Manual trigger
|
|
||||||
|
|
||||||
env:
|
|
||||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/build.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-latest, windows-latest ]
|
|
||||||
jdk: [ 17 ]
|
|
||||||
with:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
java-version: ${{ matrix.jdk }}
|
|
||||||
distribution: temurin
|
|
||||||
secrets: inherit
|
|
||||||
test:
|
|
||||||
name: Test Against Snapshots
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- java-version: 21-ea
|
|
||||||
toolchain: 21
|
|
||||||
- java-version: 17
|
|
||||||
toolchain: 17
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.java-version }}
|
|
||||||
test-args: --refresh-dependencies -PforceMavenRepositories=snapshot -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion=6.2.+ -PreactorVersion=2023.0.+ -PspringDataVersion=2024.0.+ -PmicrometerVersion=1.15.+ --stacktrace
|
|
||||||
secrets: inherit
|
|
||||||
check-samples:
|
|
||||||
name: Check Samples
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.repository_owner == 'spring-projects' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Set up gradle
|
|
||||||
uses: spring-io/spring-gradle-build-action@c8668747d7c264864c8c7f7026d0d277d14a78dc # v2.0.6
|
|
||||||
with:
|
|
||||||
java-version: 17
|
|
||||||
distribution: temurin
|
|
||||||
- name: Check samples project
|
|
||||||
env:
|
|
||||||
LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
|
|
||||||
SAMPLES_DIR: ../spring-security-samples
|
|
||||||
run: |
|
|
||||||
# Extract version from gradle.properties
|
|
||||||
version=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}')
|
|
||||||
# Extract samplesBranch from gradle.properties
|
|
||||||
samples_branch=$(cat gradle.properties | grep "samplesBranch=" | awk -F'=' '{print $2}')
|
|
||||||
./gradlew publishMavenJavaPublicationToLocalRepository
|
|
||||||
./gradlew cloneRepository -PrepositoryName="spring-projects/spring-security-samples" -Pref="$samples_branch" -PcloneOutputDirectory="$SAMPLES_DIR"
|
|
||||||
./gradlew --refresh-dependencies --project-dir "$SAMPLES_DIR" --init-script spring-security-ci.gradle -PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" -PspringSecurityVersion="$version" test integrationTest
|
|
||||||
deploy-artifacts:
|
|
||||||
name: Deploy Artifacts
|
|
||||||
needs: [ build, test, check-samples ]
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-artifacts.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
should-deploy-artifacts: ${{ needs.build.outputs.should-deploy-artifacts }}
|
|
||||||
secrets: inherit
|
|
||||||
deploy-schema:
|
|
||||||
name: Deploy Schema
|
|
||||||
needs: [ build, test, check-samples ]
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-schema.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
should-deploy-schema: ${{ needs.build.outputs.should-deploy-artifacts }}
|
|
||||||
secrets: inherit
|
|
||||||
perform-release:
|
|
||||||
name: Perform Release
|
|
||||||
needs: [ deploy-artifacts, deploy-schema ]
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
should-perform-release: ${{ needs.deploy-artifacts.outputs.artifacts-deployed }}
|
|
||||||
project-version: ${{ needs.deploy-artifacts.outputs.project-version }}
|
|
||||||
milestone-repo-url: https://repo.spring.io/artifactory/milestone
|
|
||||||
release-repo-url: https://repo1.maven.org/maven2
|
|
||||||
artifact-path: org/springframework/security/spring-security-core
|
|
||||||
slack-announcing-id: spring-security-announcing
|
|
||||||
secrets: inherit
|
|
||||||
send-notification:
|
|
||||||
name: Send Notification
|
|
||||||
needs: [ perform-release ]
|
|
||||||
if: ${{ !success() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Send Notification
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
name: Defer Issues
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
defer-issues:
|
|
||||||
name: Defer Issues
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'spring-projects'
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Compute Version
|
|
||||||
id: compute-version
|
|
||||||
uses: spring-io/spring-release-actions/compute-version@a1f321783a0769dd2aea4fad6c2ae2f95a52b885 # 0.0.5
|
|
||||||
- name: Get Today's Release Version
|
|
||||||
id: todays-release
|
|
||||||
uses: spring-io/spring-release-actions/get-todays-release-version@a1f321783a0769dd2aea4fad6c2ae2f95a52b885 # 0.0.5
|
|
||||||
with:
|
|
||||||
snapshot-version: ${{ steps.compute-version.outputs.version }}
|
|
||||||
milestone-repository: ${{ github.repository }}
|
|
||||||
milestone-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Compute Next Version
|
|
||||||
id: next-version
|
|
||||||
uses: spring-io/spring-release-actions/compute-next-version@a1f321783a0769dd2aea4fad6c2ae2f95a52b885 # 0.0.5
|
|
||||||
with:
|
|
||||||
version: ${{ steps.todays-release.outputs.release-version }}
|
|
||||||
- name: Schedule Next Milestone
|
|
||||||
uses: spring-io/spring-release-actions/schedule-milestone@a1f321783a0769dd2aea4fad6c2ae2f95a52b885 # 0.0.5
|
|
||||||
with:
|
|
||||||
version: ${{ steps.next-version.outputs.version }}
|
|
||||||
version-date: ${{ steps.next-version.outputs.version-date }}
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Move Open Issues to Next Milestone
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CURRENT_MILESTONE: ${{ steps.todays-release.outputs.release-version }}
|
|
||||||
NEXT_MILESTONE: ${{ steps.next-version.outputs.version }}
|
|
||||||
run: |
|
|
||||||
current_milestone_number=$(gh api repos/${{ github.repository }}/milestones \
|
|
||||||
--jq ".[] | select(.title == \"$CURRENT_MILESTONE\") | .number")
|
|
||||||
if [ -z "$current_milestone_number" ]; then
|
|
||||||
echo "No milestone found for $CURRENT_MILESTONE"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
next_milestone_number=$(gh api repos/${{ github.repository }}/milestones \
|
|
||||||
--jq ".[] | select(.title == \"$NEXT_MILESTONE\") | .number")
|
|
||||||
if [ -z "$next_milestone_number" ]; then
|
|
||||||
echo "No milestone found for $NEXT_MILESTONE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Moving open issues from milestone '$CURRENT_MILESTONE' (#$current_milestone_number) to '$NEXT_MILESTONE' (#$next_milestone_number)"
|
|
||||||
page=1
|
|
||||||
while true; do
|
|
||||||
issues=$(gh api "repos/${{ github.repository }}/issues?milestone=$current_milestone_number&state=open&per_page=100&page=$page" \
|
|
||||||
--jq '.[].number')
|
|
||||||
if [ -z "$issues" ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
for issue in $issues; do
|
|
||||||
echo "Moving issue/PR #$issue to milestone $NEXT_MILESTONE"
|
|
||||||
gh api repos/${{ github.repository }}/issues/$issue \
|
|
||||||
--method PATCH \
|
|
||||||
--field milestone=$next_milestone_number \
|
|
||||||
--silent
|
|
||||||
done
|
|
||||||
page=$((page + 1))
|
|
||||||
done
|
|
||||||
echo "Done."
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
name: Deploy Docs
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- "gh-pages"
|
|
||||||
- "dependabot/**"
|
|
||||||
tags: '**'
|
|
||||||
repository_dispatch:
|
|
||||||
types: request-build-reference # legacy
|
|
||||||
#schedule:
|
|
||||||
#- cron: '0 10 * * *' # Once per day at 10am UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
permissions: read-all
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'spring-projects'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
with:
|
|
||||||
ref: docs-build
|
|
||||||
fetch-depth: 1
|
|
||||||
- name: Dispatch (partial build)
|
|
||||||
if: github.ref_type == 'branch'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
|
|
||||||
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
|
|
||||||
- name: Dispatch (full build)
|
|
||||||
if: github.ref_type == 'tag'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
|
|
||||||
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
name: Execute Gradle Wrapper Upgrade
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * *' # 2am UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
jobs:
|
|
||||||
upgrade_wrapper:
|
|
||||||
name: Execution
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set up Git configuration
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
git config --global url."https://unused-username:${TOKEN}@github.com/".insteadOf "https://github.com/"
|
|
||||||
git config --global user.name 'github-actions[bot]'
|
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Set up JDK 17
|
|
||||||
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'temurin'
|
|
||||||
- name: Set up Gradle
|
|
||||||
uses: gradle/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
|
|
||||||
- name: Upgrade Wrappers
|
|
||||||
run: ./gradlew clean upgradeGradleWrapperAll --continue -Porg.gradle.java.installations.auto-download=false
|
|
||||||
env:
|
|
||||||
WRAPPER_UPGRADE_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: Check Milestone
|
|
||||||
on:
|
|
||||||
milestone:
|
|
||||||
types: [created, opened, edited]
|
|
||||||
env:
|
|
||||||
DUE_ON: ${{ github.event.milestone.due_on }}
|
|
||||||
TITLE: ${{ github.event.milestone.title }}
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
jobs:
|
|
||||||
spring-releasetrain-checks:
|
|
||||||
name: Check DueOn is on a Release Date
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.repository == 'spring-projects/spring-security' }}
|
|
||||||
permissions:
|
|
||||||
contents: none
|
|
||||||
steps:
|
|
||||||
- name: Print Milestone Being Checked
|
|
||||||
run: echo "Validating DueOn '$DUE_ON' for milestone '$TITLE'"
|
|
||||||
- name: Validate DueOn
|
|
||||||
if: env.DUE_ON != ''
|
|
||||||
run: |
|
|
||||||
export TOOL_VERSION=0.1.1
|
|
||||||
wget "https://repo.maven.apache.org/maven2/io/spring/releasetrain/spring-release-train-tools/$TOOL_VERSION/spring-release-train-tools-$TOOL_VERSION.jar"
|
|
||||||
java -cp "spring-release-train-tools-$TOOL_VERSION.jar" io.spring.releasetrain.CheckMilestoneDueOnMain --dueOn "$DUE_ON" --expectedDayOfWeek MONDAY --expectedMondayCount 3
|
|
||||||
send-notification:
|
|
||||||
name: Send Notification
|
|
||||||
needs: [ spring-releasetrain-checks ]
|
|
||||||
if: ${{ failure() || cancelled() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Send Notification
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
name: PR Build
|
|
||||||
|
|
||||||
on: pull_request
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.repository == 'spring-projects/spring-security' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Set up gradle
|
|
||||||
uses: spring-io/spring-gradle-build-action@c8668747d7c264864c8c7f7026d0d277d14a78dc # v2.0.6
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'temurin'
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew clean build -PskipCheckExpectedBranchVersion --continue --scan
|
|
||||||
generate-docs:
|
|
||||||
name: Generate Docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.repository == 'spring-projects/spring-security' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Set up gradle
|
|
||||||
uses: spring-io/spring-gradle-build-action@c8668747d7c264864c8c7f7026d0d277d14a78dc # v2.0.6
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'temurin'
|
|
||||||
- name: Run Antora
|
|
||||||
run: ./gradlew -PbuildSrc.skipTests=true :spring-security-docs:antora
|
|
||||||
- name: Upload Docs
|
|
||||||
id: upload
|
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
||||||
with:
|
|
||||||
name: docs
|
|
||||||
path: docs/build/site
|
|
||||||
overwrite: true
|
|
||||||
send-notification:
|
|
||||||
name: Send Notification
|
|
||||||
needs: [ build, generate-docs ]
|
|
||||||
if: ${{ failure() && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'spring-projects/spring-security' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Send Notification
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: Release Scheduler
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '15 15 * * MON' # Every Monday at 3:15pm UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
permissions: read-all
|
|
||||||
jobs:
|
|
||||||
dispatch_scheduled_releases:
|
|
||||||
name: Dispatch scheduled releases
|
|
||||||
if: github.repository_owner == 'spring-projects'
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
# List of active maintenance branches.
|
|
||||||
branch: [ main, 6.4.x, 6.3.x ]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
- name: Dispatch
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
|
|
||||||
run: gh workflow run update-scheduled-release-version.yml -r ${{ matrix.branch }}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: Update Antora UI Spring
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 10 * * *' # Once per day at 10am UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
issues: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-antora-ui-spring:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Update on Supported Branches
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
branch: [ '5.8.x', '6.2.x', '6.3.x', 'main' ]
|
|
||||||
steps:
|
|
||||||
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@415e2b11a766ba64799fffb5c97a4f7e17f677cf # v0.0.22
|
|
||||||
name: Update
|
|
||||||
with:
|
|
||||||
docs-branch: ${{ matrix.branch }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
antora-file-path: 'docs/antora-playbook.yml'
|
|
||||||
update-antora-ui-spring-docs-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Update on docs-build
|
|
||||||
steps:
|
|
||||||
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@415e2b11a766ba64799fffb5c97a4f7e17f677cf # v0.0.22
|
|
||||||
name: Update
|
|
||||||
with:
|
|
||||||
docs-branch: 'docs-build'
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
name: Update Scheduled Release Version
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # Manual trigger only. Triggered by release-scheduler.yml on main.
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-scheduled-release-version:
|
|
||||||
name: Update Scheduled Release Version
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/workflows/update-scheduled-release-version.yml@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
secrets: inherit
|
|
||||||
send-notification:
|
|
||||||
name: Send Notification
|
|
||||||
needs: [ update-scheduled-release-version ]
|
|
||||||
if: ${{ failure() || cancelled() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Send Notification
|
|
||||||
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@b92832ecbc7cbe969201e6beafbde0ee400cf095 # v1.0.15
|
|
||||||
with:
|
|
||||||
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
|
|
||||||
+25
-14
@@ -79,7 +79,7 @@ See https://github.com/spring-projects/spring-security/tree/main#building-from-s
|
|||||||
|
|
||||||
The wiki pages https://github.com/spring-projects/spring-framework/wiki/Code-Style[Code Style] and https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings[IntelliJ IDEA Editor Settings] define the source file coding standards we use along with some IDEA editor settings we customize.
|
The wiki pages https://github.com/spring-projects/spring-framework/wiki/Code-Style[Code Style] and https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings[IntelliJ IDEA Editor Settings] define the source file coding standards we use along with some IDEA editor settings we customize.
|
||||||
|
|
||||||
To format the code as well as check the style, run `./gradlew format && ./gradlew check`.
|
To format the code as well as check the style, run `./gradlew format check`.
|
||||||
|
|
||||||
[[submit-a-pull-request]]
|
[[submit-a-pull-request]]
|
||||||
=== Submit a Pull Request
|
=== Submit a Pull Request
|
||||||
@@ -89,30 +89,41 @@ We are excited for your pull request! :heart:
|
|||||||
Please do your best to follow these steps.
|
Please do your best to follow these steps.
|
||||||
Don't worry if you don't get them all correct the first time, we will help you.
|
Don't worry if you don't get them all correct the first time, we will help you.
|
||||||
|
|
||||||
1. [[sign-cla]] All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
|
[[sign-cla]]
|
||||||
For additional details, please refer to the blog post https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring].
|
1. If you have not previously done so, please sign the https://cla.spring.io/sign/spring[Contributor License Agreement].
|
||||||
2. [[create-an-issue-list]] Must you https://github.com/spring-projects/spring-security/issues/new/choose[create an issue] first? No, but it is recommended for features and larger bug fixes. It's easier discuss with the team first to determine the right fix or enhancement.
|
You will be reminded automatically when you submit the PR.
|
||||||
|
[[create-an-issue]]
|
||||||
|
1. Must you https://github.com/spring-projects/spring-security/issues/new/choose[create an issue] first? No, but it is recommended for features and larger bug fixes. It's easier discuss with the team first to determine the right fix or enhancement.
|
||||||
For typos and straightforward bug fixes, starting with a pull request is encouraged.
|
For typos and straightforward bug fixes, starting with a pull request is encouraged.
|
||||||
Please include a description for context and motivation.
|
Please include a description for context and motivation.
|
||||||
Note that the team may close your pull request if it's not a fit for the project.
|
Note that the team may close your pull request if it's not a fit for the project.
|
||||||
3. [[choose-a-branch]] Always check out the branch indicated in the milestone and submit pull requests against it (for example, for milestone `5.8.3` use the `5.8.x` branch).
|
[[choose-a-branch]]
|
||||||
|
1. Always check out the branch indicated in the milestone and submit pull requests against it (for example, for milestone `5.8.3` use the `5.8.x` branch).
|
||||||
If there is no milestone, choose `main`.
|
If there is no milestone, choose `main`.
|
||||||
Once merged, the fix will be forwarded-ported to applicable branches including `main`.
|
Once merged, the fix will be forwarded-ported to applicable branches including `main`.
|
||||||
4. [[create-a-local-branch]] Create a local branch
|
[[create-a-local-branch]]
|
||||||
|
1. Create a local branch
|
||||||
If this is for an issue, consider a branch name with the issue number, like `gh-22276`.
|
If this is for an issue, consider a branch name with the issue number, like `gh-22276`.
|
||||||
5. [[write-tests]] Add documentation and JUnit Tests for your changes.
|
[[write-tests]]
|
||||||
6. [[update-copyright]] In all files you edited, if the copyright header is of the form 2002-20xx, update the final copyright year to the current year.
|
1. Add JUnit Tests for your changes
|
||||||
7. [[add-since]] If on `main`, add `@since` JavaDoc attributes to new public APIs that your PR adds
|
[[update-copyright]]
|
||||||
8. [[change-rnc]] If you are updating the XSD, please instead update the RNC file and then run `./gradlew :spring-security-config:rncToXsd`.
|
1. In all files you edited, if the copyright header is of the form 2002-20xx, update the final copyright year to the current year.
|
||||||
9. [[format-code]] For each commit, build the code using `./gradlew format && ./gradlew check`.
|
[[add-since]]
|
||||||
|
1. If on `main`, add `@since` JavaDoc attributes to new public APIs that your PR adds
|
||||||
|
[[change-rnc]]
|
||||||
|
1. If you are updating the XSD, please instead update the RNC file and then run `./gradlew :spring-security-config:rncToXsd`.
|
||||||
|
[[format-code]]
|
||||||
|
1. For each commit, build the code using `./gradlew format check`.
|
||||||
This command ensures the code meets most of <<code-style,the style guide>>; a notable exception is import order.
|
This command ensures the code meets most of <<code-style,the style guide>>; a notable exception is import order.
|
||||||
10. [[commit-atomically]] Choose the granularity of your commits consciously and squash commits that represent
|
[[commit-atomically]]
|
||||||
|
1. Choose the granularity of your commits consciously and squash commits that represent
|
||||||
multiple edits or corrections of the same logical change.
|
multiple edits or corrections of the same logical change.
|
||||||
See https://git-scm.com/book/en/Git-Tools-Rewriting-History[Rewriting History section of Pro Git] for an overview of streamlining the commit history.
|
See https://git-scm.com/book/en/Git-Tools-Rewriting-History[Rewriting History section of Pro Git] for an overview of streamlining the commit history.
|
||||||
11. [[format-commit-messages]] Format commit messages using 55 characters for the subject line, 72 characters per line
|
[[format-commit-messages]]
|
||||||
|
1. Format commit messages using 55 characters for the subject line, 72 characters per line
|
||||||
for the description, followed by the issue fixed, for example, `Closes gh-22276`.
|
for the description, followed by the issue fixed, for example, `Closes gh-22276`.
|
||||||
See the https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines[Commit Guidelines section of Pro Git] for best practices around commit messages, and use `git log` to see some examples.
|
See the https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines[Commit Guidelines section of Pro Git] for best practices around commit messages, and use `git log` to see some examples.
|
||||||
Favor imperative tense over present tense (use "Fix" instead of "Fixes"); avoid past tense (use "Fix" instead of "Fixed").
|
Present tense is preferred.
|
||||||
+
|
+
|
||||||
[indent=0]
|
[indent=0]
|
||||||
----
|
----
|
||||||
|
|||||||
+5
-28
@@ -1,8 +1,8 @@
|
|||||||
image::https://badges.gitter.im/Join%20Chat.svg[Gitter,link=https://gitter.im/spring-projects/spring-security?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
|
image::https://badges.gitter.im/Join%20Chat.svg[Gitter,link=https://gitter.im/spring-projects/spring-security?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
|
||||||
|
|
||||||
image:https://github.com/spring-projects/spring-security/actions/workflows/continuous-integration-workflow.yml/badge.svg?branch=main["Build Status", link="https://github.com/spring-projects/spring-security/actions/workflows/continuous-integration-workflow.yml"]
|
image:https://github.com/spring-projects/spring-security/workflows/CI/badge.svg?branch=main["Build Status", link="https://github.com/spring-projects/spring-security/actions?query=workflow%3ACI"]
|
||||||
|
|
||||||
image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=spring-security"]
|
image:https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Gradle Enterprise", link="https://ge.spring.io/scans?search.rootProjectNames=spring-security"]
|
||||||
|
|
||||||
= Spring Security
|
= Spring Security
|
||||||
|
|
||||||
@@ -15,16 +15,14 @@ For a detailed list of features and access to the latest release, please visit h
|
|||||||
Please see our https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md[code of conduct]
|
Please see our https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md[code of conduct]
|
||||||
|
|
||||||
== Downloading Artifacts
|
== Downloading Artifacts
|
||||||
See https://docs.spring.io/spring-security/reference/getting-spring-security.html[Getting Spring Security] for how to obtain Spring Security.
|
See https://docs.spring.io/spring-security/site/docs/current/reference/html5/#getting[Getting Spring Security] for how to obtain Spring Security.
|
||||||
|
|
||||||
== Documentation
|
== Documentation
|
||||||
Be sure to read the https://docs.spring.io/spring-security/reference/[Spring Security Reference].
|
Be sure to read the https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/[Spring Security Reference].
|
||||||
Extensive JavaDoc for the Spring Security code is also available in the https://docs.spring.io/spring-security/site/docs/current/api/[Spring Security API Documentation].
|
Extensive JavaDoc for the Spring Security code is also available in the https://docs.spring.io/spring-security/site/docs/current/api/[Spring Security API Documentation].
|
||||||
|
|
||||||
You may also want to check out https://docs.spring.io/spring-security/reference/whats-new.html[what's new in the latest release].
|
|
||||||
|
|
||||||
== Quick Start
|
== Quick Start
|
||||||
See https://docs.spring.io/spring-security/reference/servlet/getting-started.html[Hello Spring Security] to get started with a "Hello, World" application.
|
See https://docs.spring.io/spring-security/site/docs/current/reference/html5/#servlet-hello[Hello Spring Security] to get started with a "Hello, World" application.
|
||||||
|
|
||||||
== Building from Source
|
== Building from Source
|
||||||
Spring Security uses a https://gradle.org[Gradle]-based build system.
|
Spring Security uses a https://gradle.org[Gradle]-based build system.
|
||||||
@@ -68,27 +66,6 @@ The https://github.com/spring-projects/spring-security/tree/docs-build[playbook
|
|||||||
|
|
||||||
Discover more commands with `./gradlew tasks`.
|
Discover more commands with `./gradlew tasks`.
|
||||||
|
|
||||||
=== IDE setup (IntelliJ)
|
|
||||||
|
|
||||||
No special steps are needed to open Spring Security in IntelliJ.
|
|
||||||
|
|
||||||
=== IDE setup (Eclipse and VS Code)
|
|
||||||
|
|
||||||
To work in Eclipse or VS Code, first generate Eclipse metadata so you can import the project into Eclipse or VS Code:
|
|
||||||
|
|
||||||
[indent=0]
|
|
||||||
----
|
|
||||||
./gradlew cleanEclipse eclipse
|
|
||||||
----
|
|
||||||
|
|
||||||
If you have not built the project yet, run `./gradlew publishToMavenLocal` first so dependencies are resolved.
|
|
||||||
|
|
||||||
*VS Code:* Open the repository root as a folder. The repository includes `.vscode/settings.json` which disables automatic Gradle import so that the generated Eclipse metadata (`.classpath`, `.project`) is used. Do not use the Gradle for Java extension to import the project.
|
|
||||||
|
|
||||||
*Eclipse:* File → Import → General → Existing Projects into Workspace, then select the repository root.
|
|
||||||
|
|
||||||
The build uses a custom Eclipse plugin to work around Gradle dependency cycles that confuse IDE metadata generation. You may see Eclipse warnings about `xml-apis` from some test dependencies; those are excluded in the build and can be ignored.
|
|
||||||
|
|
||||||
== Getting Support
|
== Getting Support
|
||||||
Check out the https://stackoverflow.com/questions/tagged/spring-security[Spring Security tags on Stack Overflow].
|
Check out the https://stackoverflow.com/questions/tagged/spring-security[Spring Security tags on Stack Overflow].
|
||||||
https://spring.io/support[Commercial support] is available too.
|
https://spring.io/support[Commercial support] is available too.
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ dependencies {
|
|||||||
testImplementation "org.springframework:spring-test"
|
testImplementation "org.springframework:spring-test"
|
||||||
|
|
||||||
testRuntimeOnly 'org.hsqldb:hsqldb'
|
testRuntimeOnly 'org.hsqldb:hsqldb'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,11 +96,7 @@ import org.springframework.util.StringUtils;
|
|||||||
* All comparisons and prefixes are case sensitive.
|
* All comparisons and prefixes are case sensitive.
|
||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @deprecated please use {@link AclPermissionEvaluator} instead. Spring Method Security
|
|
||||||
* annotations may also prove useful, for example
|
|
||||||
* {@code @PreAuthorize("hasPermission(#id, ObjectsReturnType.class, read)")}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public class AclEntryVoter extends AbstractAclVoter {
|
public class AclEntryVoter extends AbstractAclVoter {
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(AclEntryVoter.class);
|
private static final Log logger = LogFactory.getLog(AclEntryVoter.class);
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -118,7 +118,8 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
|
|||||||
if (permission instanceof Permission[]) {
|
if (permission instanceof Permission[]) {
|
||||||
return Arrays.asList((Permission[]) permission);
|
return Arrays.asList((Permission[]) permission);
|
||||||
}
|
}
|
||||||
if (permission instanceof String permString) {
|
if (permission instanceof String) {
|
||||||
|
String permString = (String) permission;
|
||||||
Permission p = buildPermission(permString);
|
Permission p = buildPermission(permString);
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
return Arrays.asList(p);
|
return Arrays.asList(p);
|
||||||
|
|||||||
-5
@@ -20,7 +20,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.security.access.AfterInvocationProvider;
|
import org.springframework.security.access.AfterInvocationProvider;
|
||||||
import org.springframework.security.access.ConfigAttribute;
|
import org.springframework.security.access.ConfigAttribute;
|
||||||
import org.springframework.security.acls.AclPermissionEvaluator;
|
|
||||||
import org.springframework.security.acls.domain.ObjectIdentityRetrievalStrategyImpl;
|
import org.springframework.security.acls.domain.ObjectIdentityRetrievalStrategyImpl;
|
||||||
import org.springframework.security.acls.domain.SidRetrievalStrategyImpl;
|
import org.springframework.security.acls.domain.SidRetrievalStrategyImpl;
|
||||||
import org.springframework.security.acls.model.Acl;
|
import org.springframework.security.acls.model.Acl;
|
||||||
@@ -40,11 +39,7 @@ import org.springframework.util.ObjectUtils;
|
|||||||
* services.
|
* services.
|
||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @deprecated please use {@link AclPermissionEvaluator} instead. Spring Method Security
|
|
||||||
* annotations may also prove useful, for example
|
|
||||||
* {@code @PostAuthorize("hasPermission(filterObject, read)")}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public abstract class AbstractAclProvider implements AfterInvocationProvider {
|
public abstract class AbstractAclProvider implements AfterInvocationProvider {
|
||||||
|
|
||||||
protected final AclService aclService;
|
protected final AclService aclService;
|
||||||
|
|||||||
-5
@@ -26,7 +26,6 @@ import org.springframework.core.log.LogMessage;
|
|||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.springframework.security.access.AuthorizationServiceException;
|
import org.springframework.security.access.AuthorizationServiceException;
|
||||||
import org.springframework.security.access.ConfigAttribute;
|
import org.springframework.security.access.ConfigAttribute;
|
||||||
import org.springframework.security.acls.AclPermissionEvaluator;
|
|
||||||
import org.springframework.security.acls.model.AclService;
|
import org.springframework.security.acls.model.AclService;
|
||||||
import org.springframework.security.acls.model.Permission;
|
import org.springframework.security.acls.model.Permission;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
@@ -63,11 +62,7 @@ import org.springframework.security.core.Authentication;
|
|||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @author Paulo Neves
|
* @author Paulo Neves
|
||||||
* @deprecated please use {@link AclPermissionEvaluator} instead. Spring Method Security
|
|
||||||
* annotations may also prove useful, for example
|
|
||||||
* {@code @PostFilter("hasPermission(filterObject, read)")}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public class AclEntryAfterInvocationCollectionFilteringProvider extends AbstractAclProvider {
|
public class AclEntryAfterInvocationCollectionFilteringProvider extends AbstractAclProvider {
|
||||||
|
|
||||||
protected static final Log logger = LogFactory.getLog(AclEntryAfterInvocationCollectionFilteringProvider.class);
|
protected static final Log logger = LogFactory.getLog(AclEntryAfterInvocationCollectionFilteringProvider.class);
|
||||||
|
|||||||
-6
@@ -27,7 +27,6 @@ import org.springframework.context.MessageSourceAware;
|
|||||||
import org.springframework.context.support.MessageSourceAccessor;
|
import org.springframework.context.support.MessageSourceAccessor;
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.springframework.security.access.ConfigAttribute;
|
import org.springframework.security.access.ConfigAttribute;
|
||||||
import org.springframework.security.acls.AclPermissionEvaluator;
|
|
||||||
import org.springframework.security.acls.model.AclService;
|
import org.springframework.security.acls.model.AclService;
|
||||||
import org.springframework.security.acls.model.Permission;
|
import org.springframework.security.acls.model.Permission;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
@@ -60,12 +59,7 @@ import org.springframework.security.core.SpringSecurityMessageSource;
|
|||||||
* granted and <code>null</code> will be returned.
|
* granted and <code>null</code> will be returned.
|
||||||
* <p>
|
* <p>
|
||||||
* All comparisons and prefixes are case sensitive.
|
* All comparisons and prefixes are case sensitive.
|
||||||
*
|
|
||||||
* @deprecated please use {@link AclPermissionEvaluator} instead. Spring Method Security
|
|
||||||
* annotations may also prove useful, for example
|
|
||||||
* {@code @PostAuthorize("hasPermission(filterObject, read)")}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public class AclEntryAfterInvocationProvider extends AbstractAclProvider implements MessageSourceAware {
|
public class AclEntryAfterInvocationProvider extends AbstractAclProvider implements MessageSourceAware {
|
||||||
|
|
||||||
protected static final Log logger = LogFactory.getLog(AclEntryAfterInvocationProvider.class);
|
protected static final Log logger = LogFactory.getLog(AclEntryAfterInvocationProvider.class);
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ import org.springframework.core.log.LogMessage;
|
|||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @author Paulo Neves
|
* @author Paulo Neves
|
||||||
* @deprecated please see {@code PostFilter}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
class ArrayFilterer<T> implements Filterer<T> {
|
class ArrayFilterer<T> implements Filterer<T> {
|
||||||
|
|
||||||
protected static final Log logger = LogFactory.getLog(ArrayFilterer.class);
|
protected static final Log logger = LogFactory.getLog(ArrayFilterer.class);
|
||||||
|
|||||||
-2
@@ -31,9 +31,7 @@ import org.springframework.core.log.LogMessage;
|
|||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @author Paulo Neves
|
* @author Paulo Neves
|
||||||
* @deprecated please see {@code PostFilter}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
class CollectionFilterer<T> implements Filterer<T> {
|
class CollectionFilterer<T> implements Filterer<T> {
|
||||||
|
|
||||||
protected static final Log logger = LogFactory.getLog(CollectionFilterer.class);
|
protected static final Log logger = LogFactory.getLog(CollectionFilterer.class);
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ import java.util.Iterator;
|
|||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @author Paulo Neves
|
* @author Paulo Neves
|
||||||
* @deprecated please use {@code PreFilter} and {@code @PostFilter} instead
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
interface Filterer<T> extends Iterable<T> {
|
interface Filterer<T> extends Iterable<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -56,9 +56,10 @@ public abstract class AbstractPermission implements Permission {
|
|||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof Permission other)) {
|
if (!(obj instanceof Permission)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Permission other = (Permission) obj;
|
||||||
return (this.mask == other.getMask());
|
return (this.mask == other.getMask());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-18
@@ -17,13 +17,10 @@
|
|||||||
package org.springframework.security.acls.domain;
|
package org.springframework.security.acls.domain;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.springframework.security.access.hierarchicalroles.NullRoleHierarchy;
|
|
||||||
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
|
|
||||||
import org.springframework.security.acls.model.Acl;
|
import org.springframework.security.acls.model.Acl;
|
||||||
import org.springframework.security.acls.model.Sid;
|
import org.springframework.security.acls.model.Sid;
|
||||||
import org.springframework.security.acls.model.SidRetrievalStrategy;
|
import org.springframework.security.acls.model.SidRetrievalStrategy;
|
||||||
@@ -62,8 +59,6 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
|
|||||||
|
|
||||||
private SidRetrievalStrategy sidRetrievalStrategy = new SidRetrievalStrategyImpl();
|
private SidRetrievalStrategy sidRetrievalStrategy = new SidRetrievalStrategyImpl();
|
||||||
|
|
||||||
private RoleHierarchy roleHierarchy = new NullRoleHierarchy();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. The only mandatory parameter relates to the system-wide
|
* Constructor. The only mandatory parameter relates to the system-wide
|
||||||
* {@link GrantedAuthority} instances that can be held to always permit ACL changes.
|
* {@link GrantedAuthority} instances that can be held to always permit ACL changes.
|
||||||
@@ -105,9 +100,7 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Iterate this principal's authorities to determine right
|
// Iterate this principal's authorities to determine right
|
||||||
Collection<? extends GrantedAuthority> reachableGrantedAuthorities = this.roleHierarchy
|
Set<String> authorities = AuthorityUtils.authorityListToSet(authentication.getAuthorities());
|
||||||
.getReachableGrantedAuthorities(authentication.getAuthorities());
|
|
||||||
Set<String> authorities = AuthorityUtils.authorityListToSet(reachableGrantedAuthorities);
|
|
||||||
if (acl.getOwner() instanceof GrantedAuthoritySid
|
if (acl.getOwner() instanceof GrantedAuthoritySid
|
||||||
&& authorities.contains(((GrantedAuthoritySid) acl.getOwner()).getGrantedAuthority())) {
|
&& authorities.contains(((GrantedAuthoritySid) acl.getOwner()).getGrantedAuthority())) {
|
||||||
return;
|
return;
|
||||||
@@ -169,14 +162,4 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
|
|||||||
this.securityContextHolderStrategy = securityContextHolderStrategy;
|
this.securityContextHolderStrategy = securityContextHolderStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the {@link RoleHierarchy} to use. The default is to use a
|
|
||||||
* {@link NullRoleHierarchy}
|
|
||||||
* @since 6.4
|
|
||||||
*/
|
|
||||||
public void setRoleHierarchy(RoleHierarchy roleHierarchy) {
|
|
||||||
Assert.notNull(roleHierarchy, "roleHierarchy cannot be null");
|
|
||||||
this.roleHierarchy = roleHierarchy;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
|
|||||||
public boolean isSidLoaded(List<Sid> sids) {
|
public boolean isSidLoaded(List<Sid> sids) {
|
||||||
// If loadedSides is null, this indicates all SIDs were loaded
|
// If loadedSides is null, this indicates all SIDs were loaded
|
||||||
// Also return true if the caller didn't specify a SID to find
|
// Also return true if the caller didn't specify a SID to find
|
||||||
if ((this.loadedSids == null) || (sids == null) || sids.isEmpty()) {
|
if ((this.loadedSids == null) || (sids == null) || (sids.size() == 0)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -140,7 +140,7 @@ public class DefaultPermissionFactory implements PermissionFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Permission> buildFromNames(List<String> names) {
|
public List<Permission> buildFromNames(List<String> names) {
|
||||||
if ((names == null) || names.isEmpty()) {
|
if ((names == null) || (names.size() == 0)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<Permission> permissions = new ArrayList<>(names.size());
|
List<Permission> permissions = new ArrayList<>(names.size());
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2013 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ public class JdbcAclService implements AclService {
|
|||||||
@Override
|
@Override
|
||||||
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
|
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
|
||||||
Object[] args = { parentIdentity.getIdentifier().toString(), parentIdentity.getType() };
|
Object[] args = { parentIdentity.getIdentifier().toString(), parentIdentity.getType() };
|
||||||
List<ObjectIdentity> objects = this.jdbcOperations.query(this.findChildrenSql,
|
List<ObjectIdentity> objects = this.jdbcOperations.query(this.findChildrenSql, args,
|
||||||
(rs, rowNum) -> mapObjectIdentityRow(rs), args);
|
(rs, rowNum) -> mapObjectIdentityRow(rs));
|
||||||
return (!objects.isEmpty()) ? objects : null;
|
return (!objects.isEmpty()) ? objects : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||||||
* @return the primary key or null if not found
|
* @return the primary key or null if not found
|
||||||
*/
|
*/
|
||||||
protected Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
|
protected Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
|
||||||
List<Long> classIds = this.jdbcOperations.queryForList(this.selectClassPrimaryKey, Long.class, type);
|
List<Long> classIds = this.jdbcOperations.queryForList(this.selectClassPrimaryKey, new Object[] { type },
|
||||||
|
Long.class);
|
||||||
|
|
||||||
if (!classIds.isEmpty()) {
|
if (!classIds.isEmpty()) {
|
||||||
return classIds.get(0);
|
return classIds.get(0);
|
||||||
@@ -241,8 +242,8 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||||||
* @return the primary key or null if not found
|
* @return the primary key or null if not found
|
||||||
*/
|
*/
|
||||||
protected Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal, boolean allowCreate) {
|
protected Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal, boolean allowCreate) {
|
||||||
List<Long> sidIds = this.jdbcOperations.queryForList(this.selectSidPrimaryKey, Long.class, sidIsPrincipal,
|
List<Long> sidIds = this.jdbcOperations.queryForList(this.selectSidPrimaryKey,
|
||||||
sidName);
|
new Object[] { sidIsPrincipal, sidName }, Long.class);
|
||||||
if (!sidIds.isEmpty()) {
|
if (!sidIds.isEmpty()) {
|
||||||
return sidIds.get(0);
|
return sidIds.get(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -25,7 +25,6 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.junit.jupiter.MockitoExtension;
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
|
|
||||||
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
|
|
||||||
import org.springframework.security.acls.model.Acl;
|
import org.springframework.security.acls.model.Acl;
|
||||||
import org.springframework.security.authentication.TestingAuthenticationToken;
|
import org.springframework.security.authentication.TestingAuthenticationToken;
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
@@ -35,7 +34,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import org.springframework.security.core.context.SecurityContextHolderStrategy;
|
import org.springframework.security.core.context.SecurityContextHolderStrategy;
|
||||||
import org.springframework.security.core.context.SecurityContextImpl;
|
import org.springframework.security.core.context.SecurityContextImpl;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThatNoException;
|
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
@@ -88,15 +86,6 @@ public class AclAuthorizationStrategyImplTests {
|
|||||||
this.strategy.securityCheck(this.acl, AclAuthorizationStrategy.CHANGE_GENERAL);
|
this.strategy.securityCheck(this.acl, AclAuthorizationStrategy.CHANGE_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void securityCheckWhenRoleReachableByHierarchyThenAuthorized() {
|
|
||||||
given(this.acl.getOwner()).willReturn(new GrantedAuthoritySid("ROLE_AUTH_B"));
|
|
||||||
this.strategy = new AclAuthorizationStrategyImpl(new SimpleGrantedAuthority("ROLE_SYSTEM_ADMIN"));
|
|
||||||
this.strategy.setRoleHierarchy(RoleHierarchyImpl.fromHierarchy("ROLE_AUTH > ROLE_AUTH_B"));
|
|
||||||
assertThatNoException()
|
|
||||||
.isThrownBy(() -> this.strategy.securityCheck(this.acl, AclAuthorizationStrategy.CHANGE_GENERAL));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void securityCheckWhenCustomSecurityContextHolderStrategyThenUses() {
|
public void securityCheckWhenCustomSecurityContextHolderStrategyThenUses() {
|
||||||
given(this.securityContextHolderStrategy.getContext()).willReturn(this.context);
|
given(this.securityContextHolderStrategy.getContext()).willReturn(this.context);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -109,10 +109,10 @@ public class JdbcAclServiceTests {
|
|||||||
List<ObjectIdentity> result = new ArrayList<>();
|
List<ObjectIdentity> result = new ArrayList<>();
|
||||||
result.add(new ObjectIdentityImpl(Object.class, "5577"));
|
result.add(new ObjectIdentityImpl(Object.class, "5577"));
|
||||||
Object[] args = { "1", "org.springframework.security.acls.jdbc.JdbcAclServiceTests$MockLongIdDomainObject" };
|
Object[] args = { "1", "org.springframework.security.acls.jdbc.JdbcAclServiceTests$MockLongIdDomainObject" };
|
||||||
given(this.jdbcOperations.query(anyString(), any(RowMapper.class), eq(args))).willReturn(result);
|
given(this.jdbcOperations.query(anyString(), eq(args), any(RowMapper.class))).willReturn(result);
|
||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockLongIdDomainObject.class, 1L);
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockLongIdDomainObject.class, 1L);
|
||||||
List<ObjectIdentity> objectIdentities = this.aclService.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclService.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(1);
|
assertThat(objectIdentities.size()).isEqualTo(1);
|
||||||
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("5577");
|
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("5577");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ public class JdbcAclServiceTests {
|
|||||||
public void findChildrenWithoutIdType() {
|
public void findChildrenWithoutIdType() {
|
||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockLongIdDomainObject.class, 4711L);
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockLongIdDomainObject.class, 4711L);
|
||||||
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(1);
|
assertThat(objectIdentities.size()).isEqualTo(1);
|
||||||
assertThat(objectIdentities.get(0).getType()).isEqualTo(MockUntypedIdDomainObject.class.getName());
|
assertThat(objectIdentities.get(0).getType()).isEqualTo(MockUntypedIdDomainObject.class.getName());
|
||||||
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo(5000L);
|
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo(5000L);
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ public class JdbcAclServiceTests {
|
|||||||
public void findChildrenOfIdTypeLong() {
|
public void findChildrenOfIdTypeLong() {
|
||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US-PAL");
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US-PAL");
|
||||||
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(2);
|
assertThat(objectIdentities.size()).isEqualTo(2);
|
||||||
assertThat(objectIdentities.get(0).getType()).isEqualTo(MockLongIdDomainObject.class.getName());
|
assertThat(objectIdentities.get(0).getType()).isEqualTo(MockLongIdDomainObject.class.getName());
|
||||||
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo(4711L);
|
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo(4711L);
|
||||||
assertThat(objectIdentities.get(1).getType()).isEqualTo(MockLongIdDomainObject.class.getName());
|
assertThat(objectIdentities.get(1).getType()).isEqualTo(MockLongIdDomainObject.class.getName());
|
||||||
@@ -155,7 +155,7 @@ public class JdbcAclServiceTests {
|
|||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US");
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US");
|
||||||
this.aclServiceIntegration.setAclClassIdSupported(true);
|
this.aclServiceIntegration.setAclClassIdSupported(true);
|
||||||
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(1);
|
assertThat(objectIdentities.size()).isEqualTo(1);
|
||||||
assertThat(objectIdentities.get(0).getType()).isEqualTo("location");
|
assertThat(objectIdentities.get(0).getType()).isEqualTo("location");
|
||||||
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("US-PAL");
|
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("US-PAL");
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ public class JdbcAclServiceTests {
|
|||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockUntypedIdDomainObject.class, 5000L);
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockUntypedIdDomainObject.class, 5000L);
|
||||||
this.aclServiceIntegration.setAclClassIdSupported(true);
|
this.aclServiceIntegration.setAclClassIdSupported(true);
|
||||||
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(1);
|
assertThat(objectIdentities.size()).isEqualTo(1);
|
||||||
assertThat(objectIdentities.get(0).getType()).isEqualTo("costcenter");
|
assertThat(objectIdentities.get(0).getType()).isEqualTo("costcenter");
|
||||||
assertThat(objectIdentities.get(0).getIdentifier())
|
assertThat(objectIdentities.get(0).getIdentifier())
|
||||||
.isEqualTo(UUID.fromString("25d93b3f-c3aa-4814-9d5e-c7c96ced7762"));
|
.isEqualTo(UUID.fromString("25d93b3f-c3aa-4814-9d5e-c7c96ced7762"));
|
||||||
@@ -186,7 +186,7 @@ public class JdbcAclServiceTests {
|
|||||||
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US");
|
ObjectIdentity objectIdentity = new ObjectIdentityImpl("location", "US");
|
||||||
this.aclServiceIntegration.setAclClassIdSupported(true);
|
this.aclServiceIntegration.setAclClassIdSupported(true);
|
||||||
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
List<ObjectIdentity> objectIdentities = this.aclServiceIntegration.findChildren(objectIdentity);
|
||||||
assertThat(objectIdentities).hasSize(1);
|
assertThat(objectIdentities.size()).isEqualTo(1);
|
||||||
assertThat(objectIdentities.get(0).getType()).isEqualTo("location");
|
assertThat(objectIdentities.get(0).getType()).isEqualTo("location");
|
||||||
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("prefix:US-PAL");
|
assertThat(objectIdentities.get(0).getIdentifier()).isEqualTo("prefix:US-PAL");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -454,7 +454,7 @@ public class JdbcMutableAclServiceTests {
|
|||||||
CustomSid customSid = new CustomSid("Custom sid");
|
CustomSid customSid = new CustomSid("Custom sid");
|
||||||
given(customJdbcMutableAclService.createOrRetrieveSidPrimaryKey("Custom sid", false, false)).willReturn(1L);
|
given(customJdbcMutableAclService.createOrRetrieveSidPrimaryKey("Custom sid", false, false)).willReturn(1L);
|
||||||
Long result = customJdbcMutableAclService.createOrRetrieveSidPrimaryKey(customSid, false);
|
Long result = customJdbcMutableAclService.createOrRetrieveSidPrimaryKey(customSid, false);
|
||||||
assertThat(Long.valueOf(1L)).isEqualTo(result);
|
assertThat(new Long(1L)).isEqualTo(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Authentication getAuth() {
|
protected Authentication getAuth() {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -120,9 +120,9 @@ public class SidTests {
|
|||||||
PrincipalSid principalSid = new PrincipalSid(authentication);
|
PrincipalSid principalSid = new PrincipalSid(authentication);
|
||||||
GrantedAuthority ga = new SimpleGrantedAuthority("ROLE_TEST");
|
GrantedAuthority ga = new SimpleGrantedAuthority("ROLE_TEST");
|
||||||
GrantedAuthoritySid gaSid = new GrantedAuthoritySid(ga);
|
GrantedAuthoritySid gaSid = new GrantedAuthoritySid(ga);
|
||||||
assertThat("johndoe").isEqualTo(principalSid.getPrincipal());
|
assertThat("johndoe".equals(principalSid.getPrincipal())).isTrue();
|
||||||
assertThat("scott".equals(principalSid.getPrincipal())).isFalse();
|
assertThat("scott".equals(principalSid.getPrincipal())).isFalse();
|
||||||
assertThat("ROLE_TEST").isEqualTo(gaSid.getGrantedAuthority());
|
assertThat("ROLE_TEST".equals(gaSid.getGrantedAuthority())).isTrue();
|
||||||
assertThat("ROLE_TEST2".equals(gaSid.getGrantedAuthority())).isFalse();
|
assertThat("ROLE_TEST2".equals(gaSid.getGrantedAuthority())).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,12 @@ dependencies {
|
|||||||
testImplementation "org.mockito:mockito-junit-jupiter"
|
testImplementation "org.mockito:mockito-junit-jupiter"
|
||||||
testImplementation "org.springframework:spring-test"
|
testImplementation "org.springframework:spring-test"
|
||||||
testAspect sourceSets.main.output
|
testAspect sourceSets.main.output
|
||||||
|
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets.main.aspectj.srcDir "src/main/java"
|
||||||
|
sourceSets.main.java.srcDirs = files()
|
||||||
|
|
||||||
|
sourceSets.test.aspectj.srcDir "src/test/java"
|
||||||
|
sourceSets.test.java.srcDirs = files()
|
||||||
|
|
||||||
compileAspectj.ajcOptions.outxmlfile = "META-INF/aop.xml"
|
compileAspectj.ajcOptions.outxmlfile = "META-INF/aop.xml"
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -143,8 +143,8 @@ public class AnnotationSecurityAspectTests {
|
|||||||
SecurityContextHolder.getContext().setAuthentication(this.anne);
|
SecurityContextHolder.getContext().setAuthentication(this.anne);
|
||||||
List<String> objects = this.prePostSecured.postFilterMethod();
|
List<String> objects = this.prePostSecured.postFilterMethod();
|
||||||
assertThat(objects).hasSize(2);
|
assertThat(objects).hasSize(2);
|
||||||
assertThat(objects).contains("apple");
|
assertThat(objects.contains("apple")).isTrue();
|
||||||
assertThat(objects).contains("aubergine");
|
assertThat(objects.contains("aubergine")).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureForElAnnotations() {
|
private void configureForElAnnotations() {
|
||||||
|
|||||||
+1
-21
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -103,13 +103,6 @@ public class PostAuthorizeAspectTests {
|
|||||||
assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.prePostSecured::denyAllMethod);
|
assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.prePostSecured::denyAllMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void nestedDenyAllPostAuthorizeDeniesAccess() {
|
|
||||||
SecurityContextHolder.getContext().setAuthentication(this.anne);
|
|
||||||
assertThatExceptionOfType(AccessDeniedException.class)
|
|
||||||
.isThrownBy(() -> this.secured.myObject().denyAllMethod());
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SecuredInterface {
|
interface SecuredInterface {
|
||||||
|
|
||||||
@PostAuthorize("hasRole('X')")
|
@PostAuthorize("hasRole('X')")
|
||||||
@@ -141,10 +134,6 @@ public class PostAuthorizeAspectTests {
|
|||||||
privateMethod();
|
privateMethod();
|
||||||
}
|
}
|
||||||
|
|
||||||
NestedObject myObject() {
|
|
||||||
return new NestedObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class SecuredImplSubclass extends SecuredImpl {
|
static class SecuredImplSubclass extends SecuredImpl {
|
||||||
@@ -168,13 +157,4 @@ public class PostAuthorizeAspectTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class NestedObject {
|
|
||||||
|
|
||||||
@PostAuthorize("denyAll")
|
|
||||||
void denyAllMethod() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-19
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -54,11 +54,6 @@ public class PostFilterAspectTests {
|
|||||||
assertThat(this.prePostSecured.postFilterMethod(objects)).containsExactly("apple", "aubergine");
|
assertThat(this.prePostSecured.postFilterMethod(objects)).containsExactly("apple", "aubergine");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void nestedDenyAllPostFilterDeniesAccess() {
|
|
||||||
assertThat(this.prePostSecured.myObject().denyAllMethod()).isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class PrePostSecured {
|
static class PrePostSecured {
|
||||||
|
|
||||||
@PostFilter("filterObject.startsWith('a')")
|
@PostFilter("filterObject.startsWith('a')")
|
||||||
@@ -66,19 +61,6 @@ public class PostFilterAspectTests {
|
|||||||
return objects;
|
return objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
NestedObject myObject() {
|
|
||||||
return new NestedObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static class NestedObject {
|
|
||||||
|
|
||||||
@PostFilter("filterObject == null")
|
|
||||||
List<String> denyAllMethod() {
|
|
||||||
return new ArrayList<>(List.of("deny"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-45
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -47,8 +47,6 @@ public class PreAuthorizeAspectTests {
|
|||||||
|
|
||||||
private PrePostSecured prePostSecured = new PrePostSecured();
|
private PrePostSecured prePostSecured = new PrePostSecured();
|
||||||
|
|
||||||
private MultipleInterfaces multiple = new MultipleInterfaces();
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public final void setUp() {
|
public final void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
@@ -105,19 +103,6 @@ public class PreAuthorizeAspectTests {
|
|||||||
assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.prePostSecured::denyAllMethod);
|
assertThatExceptionOfType(AccessDeniedException.class).isThrownBy(this.prePostSecured::denyAllMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void nestedDenyAllPreAuthorizeDeniesAccess() {
|
|
||||||
SecurityContextHolder.getContext().setAuthentication(this.anne);
|
|
||||||
assertThatExceptionOfType(AccessDeniedException.class)
|
|
||||||
.isThrownBy(() -> this.secured.myObject().denyAllMethod());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void multipleInterfacesPreAuthorizeAllows() {
|
|
||||||
// aspectj doesn't inherit annotations
|
|
||||||
this.multiple.securedMethod();
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SecuredInterface {
|
interface SecuredInterface {
|
||||||
|
|
||||||
@PreAuthorize("hasRole('X')")
|
@PreAuthorize("hasRole('X')")
|
||||||
@@ -144,15 +129,11 @@ public class PreAuthorizeAspectTests {
|
|||||||
protected void protectedMethod() {
|
protected void protectedMethod() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasRole('A')")
|
@PreAuthorize("hasRole('X')")
|
||||||
void publicCallsPrivate() {
|
void publicCallsPrivate() {
|
||||||
privateMethod();
|
privateMethod();
|
||||||
}
|
}
|
||||||
|
|
||||||
NestedObject myObject() {
|
|
||||||
return new NestedObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class SecuredImplSubclass extends SecuredImpl {
|
static class SecuredImplSubclass extends SecuredImpl {
|
||||||
@@ -176,28 +157,4 @@ public class PreAuthorizeAspectTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class NestedObject {
|
|
||||||
|
|
||||||
@PreAuthorize("denyAll")
|
|
||||||
void denyAllMethod() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AnotherSecuredInterface {
|
|
||||||
|
|
||||||
@PreAuthorize("hasRole('Y')")
|
|
||||||
void securedMethod();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static class MultipleInterfaces implements SecuredInterface, AnotherSecuredInterface {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void securedMethod() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-19
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -54,11 +54,6 @@ public class PreFilterAspectTests {
|
|||||||
assertThat(this.prePostSecured.preFilterMethod(objects)).containsExactly("apple", "aubergine");
|
assertThat(this.prePostSecured.preFilterMethod(objects)).containsExactly("apple", "aubergine");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void nestedDenyAllPreFilterDeniesAccess() {
|
|
||||||
assertThat(this.prePostSecured.myObject().denyAllMethod(new ArrayList<>(List.of("deny")))).isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class PrePostSecured {
|
static class PrePostSecured {
|
||||||
|
|
||||||
@PreFilter("filterObject.startsWith('a')")
|
@PreFilter("filterObject.startsWith('a')")
|
||||||
@@ -66,19 +61,6 @@ public class PreFilterAspectTests {
|
|||||||
return objects;
|
return objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
NestedObject myObject() {
|
|
||||||
return new NestedObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static class NestedObject {
|
|
||||||
|
|
||||||
@PreFilter("filterObject == null")
|
|
||||||
List<String> denyAllMethod(List<String> list) {
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+16
-35
@@ -14,16 +14,12 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
|
||||||
alias(libs.plugins.org.gradle.wrapper.upgrade)
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'io.spring.nohttp'
|
apply plugin: 'io.spring.nohttp'
|
||||||
apply plugin: 'locks'
|
apply plugin: 'locks'
|
||||||
|
apply plugin: 's101'
|
||||||
apply plugin: 'io.spring.convention.root'
|
apply plugin: 'io.spring.convention.root'
|
||||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||||
apply plugin: 'org.springframework.security.versions.verify-dependencies-versions'
|
apply plugin: 'org.springframework.security.versions.verify-dependencies-versions'
|
||||||
apply plugin: 'org.springframework.security.check-expected-branch-version'
|
|
||||||
apply plugin: 'io.spring.security.release'
|
apply plugin: 'io.spring.security.release'
|
||||||
|
|
||||||
group = 'org.springframework.security'
|
group = 'org.springframework.security'
|
||||||
@@ -35,42 +31,29 @@ ext.milestoneBuild = !(snapshotBuild || releaseBuild)
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://repo.spring.io/milestone" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
springRelease {
|
springRelease {
|
||||||
weekOfMonth = 3
|
weekOfMonth = 3
|
||||||
dayOfWeek = 1
|
dayOfWeek = 1
|
||||||
referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
|
referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
|
||||||
apiDocUrl = "https://docs.spring.io/spring-security/reference/{version}/api/java/index.html"
|
apiDocUrl = "https://docs.spring.io/spring-security/site/docs/{version}/api/"
|
||||||
replaceSnapshotVersionInReferenceDocUrl = true
|
replaceSnapshotVersionInReferenceDocUrl = true
|
||||||
}
|
}
|
||||||
|
|
||||||
def toolchainVersion() {
|
|
||||||
if (project.hasProperty('testToolchain')) {
|
|
||||||
return project.property('testToolchain').toString().toInteger()
|
|
||||||
}
|
|
||||||
return 17
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
plugins.withType(JavaPlugin) {
|
||||||
java {
|
java {
|
||||||
toolchain {
|
sourceCompatibility=JavaVersion.VERSION_17
|
||||||
languageVersion = JavaLanguageVersion.of(toolchainVersion())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kotlin {
|
tasks.withType(JavaCompile) {
|
||||||
jvmToolchain {
|
|
||||||
languageVersion = JavaLanguageVersion.of(17)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
options.compilerArgs.add("-parameters")
|
options.compilerArgs.add("-parameters")
|
||||||
options.release.set(17)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
|
if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
|
||||||
apply plugin: 'io.spring.javaformat'
|
apply plugin: 'io.spring.javaformat'
|
||||||
@@ -95,6 +78,12 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
|
languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
develocity {
|
develocity {
|
||||||
@@ -105,14 +94,10 @@ develocity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nohttp {
|
nohttp {
|
||||||
source.exclude "buildSrc/build/**", "javascript/.gradle/**", "javascript/package-lock.json", "javascript/node_modules/**", "javascript/build/**", "javascript/dist/**"
|
source.exclude "buildSrc/build/**"
|
||||||
source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd))
|
source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('checkstyleNohttp') {
|
|
||||||
maxHeapSize = '1g'
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register('cloneRepository', IncludeRepoTask) {
|
tasks.register('cloneRepository', IncludeRepoTask) {
|
||||||
repository = project.getProperties().get("repositoryName")
|
repository = project.getProperties().get("repositoryName")
|
||||||
ref = project.getProperties().get("ref")
|
ref = project.getProperties().get("ref")
|
||||||
@@ -120,11 +105,7 @@ tasks.register('cloneRepository', IncludeRepoTask) {
|
|||||||
outputDirectory = project.hasProperty("cloneOutputDirectory") ? project.file("$cloneOutputDirectory") : defaultDirectory
|
outputDirectory = project.hasProperty("cloneOutputDirectory") ? project.file("$cloneOutputDirectory") : defaultDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapperUpgrade {
|
s101 {
|
||||||
gradle {
|
repository = 'https://structure101.com/binaries/latest'
|
||||||
'spring-security' {
|
configurationDirectory = project.file("etc/s101")
|
||||||
repo = 'spring-projects/spring-security'
|
|
||||||
baseBranch = '6.3.x' // runs only on 6.3.x and the update is merged forward to main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ java {
|
|||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://repo.spring.io/milestone' }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -47,10 +46,6 @@ gradlePlugin {
|
|||||||
id = "org.springframework.security.versions.verify-dependencies-versions"
|
id = "org.springframework.security.versions.verify-dependencies-versions"
|
||||||
implementationClass = "org.springframework.security.convention.versions.VerifyDependenciesVersionsPlugin"
|
implementationClass = "org.springframework.security.convention.versions.VerifyDependenciesVersionsPlugin"
|
||||||
}
|
}
|
||||||
checkExpectedBranchVersion {
|
|
||||||
id = "org.springframework.security.check-expected-branch-version"
|
|
||||||
implementationClass = "org.springframework.security.CheckExpectedBranchVersionPlugin"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +90,6 @@ dependencies {
|
|||||||
testImplementation 'org.mockito:mockito-core'
|
testImplementation 'org.mockito:mockito-core'
|
||||||
testImplementation 'org.mockito:mockito-junit-jupiter'
|
testImplementation 'org.mockito:mockito-junit-jupiter'
|
||||||
testImplementation libs.com.squareup.okhttp3.mockwebserver
|
testImplementation libs.com.squareup.okhttp3.mockwebserver
|
||||||
|
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
+240
@@ -0,0 +1,240 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+91
@@ -0,0 +1,91 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2002-2017 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2016-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2002-2017 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations under
|
||||||
|
* the License.
|
||||||
|
*/
|
||||||
|
package io.spring.gradle.convention
|
||||||
|
|
||||||
|
import org.gradle.api.plugins.JavaPlugin
|
||||||
|
import org.gradle.api.tasks.bundling.Zip
|
||||||
|
import org.gradle.api.Plugin
|
||||||
|
import org.gradle.api.Project
|
||||||
|
|
||||||
|
public class DeployDocsPlugin implements Plugin<Project> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(Project project) {
|
||||||
|
project.getPluginManager().apply('org.hidetake.ssh')
|
||||||
|
|
||||||
|
project.ssh.settings {
|
||||||
|
knownHosts = allowAnyHosts
|
||||||
|
}
|
||||||
|
project.remotes {
|
||||||
|
docs {
|
||||||
|
role 'docs'
|
||||||
|
if (project.hasProperty('deployDocsHost')) {
|
||||||
|
host = project.findProperty('deployDocsHost')
|
||||||
|
} else {
|
||||||
|
host = 'docs.af.pivotal.io'
|
||||||
|
}
|
||||||
|
retryCount = 5 // retry 5 times (default is 0)
|
||||||
|
retryWaitSec = 10 // wait 10 seconds between retries (default is 0)
|
||||||
|
user = project.findProperty('deployDocsSshUsername')
|
||||||
|
if (project.hasProperty('deployDocsSshKeyPath')) {
|
||||||
|
identity = project.file(project.findProperty('deployDocsSshKeyPath'))
|
||||||
|
} else if (project.hasProperty('deployDocsSshKey')) {
|
||||||
|
identity = project.findProperty('deployDocsSshKey')
|
||||||
|
}
|
||||||
|
if(project.hasProperty('deployDocsSshPassphrase')) {
|
||||||
|
passphrase = project.findProperty('deployDocsSshPassphrase')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project.task('deployDocs') {
|
||||||
|
dependsOn 'docsZip'
|
||||||
|
doFirst {
|
||||||
|
project.ssh.run {
|
||||||
|
session(project.remotes.docs) {
|
||||||
|
def now = System.currentTimeMillis()
|
||||||
|
def name = project.rootProject.name
|
||||||
|
def version = project.rootProject.version
|
||||||
|
def tempPath = "/tmp/${name}-${now}-docs/".replaceAll(' ', '_')
|
||||||
|
execute "mkdir -p $tempPath"
|
||||||
|
|
||||||
|
project.tasks.docsZip.outputs.each { o ->
|
||||||
|
put from: o.files, into: tempPath
|
||||||
|
}
|
||||||
|
|
||||||
|
execute "unzip $tempPath*.zip -d $tempPath"
|
||||||
|
|
||||||
|
def extractPath = "/var/www/domains/spring.io/docs/htdocs/autorepo/docs/${name}/${version}/"
|
||||||
|
|
||||||
|
execute "rm -rf $extractPath"
|
||||||
|
execute "mkdir -p $extractPath"
|
||||||
|
execute "mv $tempPath/docs/* $extractPath"
|
||||||
|
execute "chmod -R g+w $extractPath"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ public class DocsPlugin implements Plugin<Project> {
|
|||||||
|
|
||||||
PluginManager pluginManager = project.getPluginManager();
|
PluginManager pluginManager = project.getPluginManager();
|
||||||
pluginManager.apply(BasePlugin);
|
pluginManager.apply(BasePlugin);
|
||||||
|
pluginManager.apply(DeployDocsPlugin);
|
||||||
pluginManager.apply(JavadocApiPlugin);
|
pluginManager.apply(JavadocApiPlugin);
|
||||||
|
|
||||||
Task docsZip = project.tasks.create('docsZip', Zip) {
|
Task docsZip = project.tasks.create('docsZip', Zip) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
@@ -63,7 +63,6 @@ class EclipsePlugin implements Plugin<Project> {
|
|||||||
// test sources. Relax those from error to warning
|
// test sources. Relax those from error to warning
|
||||||
properties['org.eclipse.jdt.core.circularClasspath'] = 'warning'
|
properties['org.eclipse.jdt.core.circularClasspath'] = 'warning'
|
||||||
properties['org.eclipse.jdt.core.incompleteClasspath'] = 'warning'
|
properties['org.eclipse.jdt.core.incompleteClasspath'] = 'warning'
|
||||||
properties['org.eclipse.jdt.core.compiler.codegen.methodParameters'] = 'generate'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-present the original author or authors.
|
* Copyright 2016-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user