浏览代码

Remove deprecation warnings with Context.putAll

Closes gh-11476
Steve Riesenberg 3 年之前
父节点
当前提交
206c6ffb54

+ 1 - 1
dependencies/spring-security-dependencies.gradle

@@ -8,7 +8,7 @@ javaPlatform {
 
 dependencies {
 	api platform("org.springframework:spring-framework-bom:$springFrameworkVersion")
-	api platform("io.projectreactor:reactor-bom:2020.0.19")
+	api platform("io.projectreactor:reactor-bom:2022.0.0-M2")
 	api platform("io.rsocket:rsocket-bom:1.1.2")
 	api platform("org.junit:junit-bom:5.9.0-M1")
 	api platform("org.springframework.data:spring-data-bom:2022.0.0-M4")

+ 1 - 1
test/src/main/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListener.java

@@ -107,7 +107,7 @@ public class ReactorContextTestExecutionListener extends DelegatingTestExecution
 					return context;
 				}
 				Context toMerge = ReactiveSecurityContextHolder.withSecurityContext(Mono.just(this.securityContext));
-				return toMerge.putAll(context);
+				return toMerge.putAll(context.readOnly());
 			}
 
 			@Override

+ 2 - 2
web/src/main/java/org/springframework/security/web/server/context/ReactorContextWebFilter.java

@@ -49,8 +49,8 @@ public class ReactorContextWebFilter implements WebFilter {
 	}
 
 	private Context withSecurityContext(Context mainContext, ServerWebExchange exchange) {
-		return mainContext
-				.putAll(this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext));
+		return mainContext.putAll(
+				this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext).readOnly());
 	}
 
 }