Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'spring-projects:main' into main
- Loading branch information
Showing
38 changed files
with
3,181 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
name: Merge Dependabot PR | ||
|
||
on: | ||
pull_request: | ||
on: pull_request_target | ||
|
||
run-name: Merge Dependabot PR ${{ github.ref_name }} | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
merge-dependabot-pr: | ||
permissions: write-all | ||
uses: spring-io/spring-github-workflows/.github/workflows/spring-merge-dependabot-pr.yml@1e8b0587a1f4f01697f9753fa3339c3e0d30f396 | ||
with: | ||
mergeArguments: '--auto --rebase' | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Set Milestone to Dependabot Pull Request | ||
id: set-milestone | ||
run: | | ||
if test -f pom.xml | ||
then | ||
CURRENT_VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) | ||
else | ||
CURRENT_VERSION=$(cat gradle.properties | sed -n '/^version=/ { s/^version=//;p }') | ||
fi | ||
export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT} | ||
MILESTONE=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.due_on != null and (.title | startswith(env.CANDIDATE_VERSION)))) | .[0] | .title') | ||
if [ -z $MILESTONE ] | ||
then | ||
gh run cancel ${{ github.run_id }} | ||
echo "::warning title=Cannot merge::No scheduled milestone for $CURRENT_VERSION version" | ||
else | ||
gh pr edit ${{ github.event.pull_request.number }} --milestone $MILESTONE | ||
echo mergeEnabled=true >> $GITHUB_OUTPUT | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Merge Dependabot pull request | ||
if: steps.set-milestone.outputs.mergeEnabled | ||
run: gh pr merge ${{ github.event.pull_request.number }} --auto --rebase | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...work/security/config/annotation/method/configuration/AuthorizationProxyConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2002-2024 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 org.springframework.security.config.annotation.method.configuration; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.springframework.aop.framework.AopInfrastructureBean; | ||
import org.springframework.beans.factory.ObjectProvider; | ||
import org.springframework.beans.factory.config.BeanDefinition; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Role; | ||
import org.springframework.security.authorization.AuthorizationAdvisorProxyFactory; | ||
import org.springframework.security.authorization.method.AuthorizationAdvisor; | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
final class AuthorizationProxyConfiguration implements AopInfrastructureBean { | ||
|
||
@Bean | ||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE) | ||
static AuthorizationAdvisorProxyFactory authorizationProxyFactory(ObjectProvider<AuthorizationAdvisor> provider) { | ||
List<AuthorizationAdvisor> advisors = new ArrayList<>(); | ||
provider.forEach(advisors::add); | ||
AuthorizationAdvisorProxyFactory factory = new AuthorizationAdvisorProxyFactory(); | ||
factory.setAdvisors(advisors); | ||
return factory; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...urity/config/annotation/method/configuration/ReactiveAuthorizationProxyConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2002-2024 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 org.springframework.security.config.annotation.method.configuration; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.springframework.aop.framework.AopInfrastructureBean; | ||
import org.springframework.beans.factory.ObjectProvider; | ||
import org.springframework.beans.factory.config.BeanDefinition; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Role; | ||
import org.springframework.security.authorization.ReactiveAuthorizationAdvisorProxyFactory; | ||
import org.springframework.security.authorization.method.AuthorizationAdvisor; | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
final class ReactiveAuthorizationProxyConfiguration implements AopInfrastructureBean { | ||
|
||
@Bean | ||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE) | ||
static ReactiveAuthorizationAdvisorProxyFactory authorizationProxyFactory( | ||
ObjectProvider<AuthorizationAdvisor> provider) { | ||
List<AuthorizationAdvisor> advisors = new ArrayList<>(); | ||
provider.forEach(advisors::add); | ||
ReactiveAuthorizationAdvisorProxyFactory factory = new ReactiveAuthorizationAdvisorProxyFactory(); | ||
factory.setAdvisors(advisors); | ||
return factory; | ||
} | ||
|
||
} |
Oops, something went wrong.