Skip to content

Commit 1d5ef12

Browse files
authored
Merge branch 'spring-projects:main' into gh-17112
2 parents 465e13a + 0c42b61 commit 1d5ef12

File tree

948 files changed

+13052
-36429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

948 files changed

+13052
-36429
lines changed

.github/workflows/codeql.yml

Lines changed: 8 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,17 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL Advanced"
132

143
on:
15-
push: # run if we update the workflow
4+
push:
5+
pull_request:
166
workflow_dispatch:
177
schedule:
18-
- cron: '39 13 * * 4'
19-
8+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
9+
- cron: '0 5 * * *'
10+
permissions: read-all
2011
jobs:
21-
analyze:
22-
name: Analyze (${{ matrix.language }})
23-
# Runner size impacts CodeQL analysis time. To learn more, please see:
24-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
25-
# - https://gh.io/supported-runners-and-hardware-resources
26-
# - https://gh.io/using-larger-runners (GitHub.com only)
27-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
28-
runs-on: ubuntu-latest
12+
codeql-analysis-call:
2913
permissions:
30-
# required for all workflows
31-
security-events: write
32-
33-
# required to fetch internal or private CodeQL packs
34-
packages: read
35-
36-
# only required for workflows in private repositories
3714
actions: read
3815
contents: read
39-
40-
strategy:
41-
fail-fast: false
42-
matrix:
43-
include:
44-
- language: actions
45-
build-mode: none
46-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
47-
# Use `c-cpp` to analyze code written in C, C++ or both
48-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
49-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
50-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
51-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
52-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
53-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
54-
steps:
55-
- name: Checkout repository
56-
uses: actions/checkout@v4
57-
58-
# Add any setup steps before running the `github/codeql-action/init` action.
59-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
60-
# or others). This is typically only required for manual builds.
61-
# - name: Setup runtime (example)
62-
# uses: actions/setup-example@v1
63-
64-
# Initializes the CodeQL tools for scanning.
65-
- name: Initialize CodeQL
66-
uses: github/codeql-action/init@v3
67-
with:
68-
languages: ${{ matrix.language }}
69-
build-mode: ${{ matrix.build-mode }}
70-
# If you wish to specify custom queries, you can do so here or in a config file.
71-
# By default, queries listed here will override any specified in a config file.
72-
# Prefix the list here with "+" to use these queries and those in the config file.
73-
74-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
75-
queries: security-extended,security-and-quality
76-
77-
- name: Perform CodeQL Analysis
78-
uses: github/codeql-action/analyze@v3
79-
with:
80-
category: "/language:${{matrix.language}}"
16+
security-events: write
17+
uses: spring-io/github-actions/.github/workflows/codeql-analysis.yml@1

.github/workflows/continuous-integration-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
toolchain: 17
4040
with:
4141
java-version: ${{ matrix.java-version }}
42-
test-args: --refresh-dependencies -PforceMavenRepositories=snapshot -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion=7.+ -PreactorVersion=2025.+ -PspringDataVersion=2025.+ --stacktrace
42+
test-args: --refresh-dependencies -PforceMavenRepositories=snapshot,https://oss.sonatype.org/content/repositories/snapshots -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion=7.+ -PreactorVersion=2025.+ -PspringDataVersion=2025.+ --stacktrace
4343
secrets: inherit
4444
deploy-artifacts:
4545
name: Deploy Artifacts

CONTRIBUTING.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ See https://github.com/spring-projects/spring-security/tree/main#building-from-s
7979

8080
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.
8181

82+
Additionally, since Streams are https://github.com/spring-projects/spring-security/issues/7154[much slower] than `for` loops, please use them judiciously.
83+
The team may ask you to change to a `for` loop if the given code is along a hot path.
84+
8285
To format the code as well as check the style, run `./gradlew format && ./gradlew check`.
8386

8487
[[submit-a-pull-request]]

aspects/src/test/java/org/springframework/security/authorization/method/aspectj/PreAuthorizeAspectTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -144,7 +144,7 @@ private void privateMethod() {
144144
protected void protectedMethod() {
145145
}
146146

147-
@PreAuthorize("hasRole('X')")
147+
@PreAuthorize("hasRole('A')")
148148
void publicCallsPrivate() {
149149
privateMethod();
150150
}

buildSrc/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id "java-gradle-plugin"
3+
id "groovy-gradle-plugin"
34
id "java"
45
id "groovy"
56
}
@@ -76,6 +77,7 @@ dependencies {
7677
implementation libs.com.github.spullara.mustache.java.compiler
7778
implementation libs.io.spring.javaformat.spring.javaformat.gradle.plugin
7879
implementation libs.io.spring.nohttp.nohttp.gradle
80+
implementation libs.org.jetbrains.kotlin.kotlin.gradle.plugin
7981
implementation (libs.net.sourceforge.htmlunit) {
8082
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
8183
}

buildSrc/src/main/groovy/io/spring/gradle/convention/ManagementConfigurationPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void apply(Project project) {
6161
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
6262
publishing.getPublications().withType(MavenPublication.class, (mavenPublication -> {
6363
mavenPublication.versionMapping((versions) ->
64-
versions.allVariants(versionMapping -> versionMapping.fromResolutionResult())
64+
versions.allVariants((versionMapping) -> versionMapping.fromResolutionResult())
6565
);
6666
}));
6767
});
@@ -71,4 +71,4 @@ public void apply(Project project) {
7171
}));
7272
});
7373
}
74-
}
74+
}

buildSrc/src/main/groovy/io/spring/gradle/convention/RepositoryConventionPlugin.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ class RepositoryConventionPlugin implements Plugin<Project> {
8080
}
8181
url = 'https://repo.spring.io/release/'
8282
}
83+
forceMavenRepositories.findAll { it.startsWith('https://') || it.startsWith('file://') }.each { mavenUrl ->
84+
maven {
85+
url mavenUrl
86+
}
87+
}
8388
}
8489
}
8590

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
plugins {
4+
id 'kotlin'
5+
}
6+
7+
project.plugins.withId("org.jetbrains.kotlin.jvm", (kotlinProject) -> {
8+
project.tasks.withType(KotlinCompile).configureEach {
9+
kotlinOptions {
10+
languageVersion = '2.2'
11+
apiVersion = '2.2'
12+
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
13+
jvmTarget = '17'
14+
15+
}
16+
}
17+
})

buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void apply(Project project) {
4646
task.setDescription("Check if the project version matches the branch version");
4747
task.onlyIf("skipCheckExpectedBranchVersion property is false or not present", CheckExpectedBranchVersionPlugin::skipPropertyFalseOrNotPresent);
4848
task.getVersion().convention(project.provider(() -> project.getVersion().toString()));
49-
task.getBranchName().convention(project.getProviders().exec(execSpec -> execSpec.setCommandLine("git", "symbolic-ref", "--short", "HEAD")).getStandardOutput().getAsText());
49+
task.getBranchName().convention(project.getProviders().exec((execSpec) -> execSpec.setCommandLine("git", "symbolic-ref", "--short", "HEAD")).getStandardOutput().getAsText());
5050
task.getOutputFile().convention(project.getLayout().getBuildDirectory().file("check-expected-branch-version"));
5151
});
5252
project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME, checkTask -> checkTask.dependsOn(checkExpectedBranchVersionTask));

cas/spring-security-cas.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies {
1414

1515
provided 'jakarta.servlet:jakarta.servlet-api'
1616

17+
testImplementation project(path : ':spring-security-web', configuration : 'tests')
1718
testImplementation "org.assertj:assertj-core"
1819
testImplementation "org.junit.jupiter:junit-jupiter-api"
1920
testImplementation "org.junit.jupiter:junit-jupiter-params"

0 commit comments

Comments
 (0)