Browse Source

Remove deprecation warnings with Context.putAll

Closes gh-11476
pull/11478/head
Steve Riesenberg 3 years ago
parent
commit
206c6ffb54
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
  1. 2
      dependencies/spring-security-dependencies.gradle
  2. 2
      test/src/main/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListener.java
  3. 4
      web/src/main/java/org/springframework/security/web/server/context/ReactorContextWebFilter.java

2
dependencies/spring-security-dependencies.gradle vendored

@ -8,7 +8,7 @@ javaPlatform {
dependencies { dependencies {
api platform("org.springframework:spring-framework-bom:$springFrameworkVersion") 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("io.rsocket:rsocket-bom:1.1.2")
api platform("org.junit:junit-bom:5.9.0-M1") api platform("org.junit:junit-bom:5.9.0-M1")
api platform("org.springframework.data:spring-data-bom:2022.0.0-M4") api platform("org.springframework.data:spring-data-bom:2022.0.0-M4")

2
test/src/main/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListener.java

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

4
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) { private Context withSecurityContext(Context mainContext, ServerWebExchange exchange) {
return mainContext return mainContext.putAll(
.putAll(this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext)); this.repository.load(exchange).as(ReactiveSecurityContextHolder::withSecurityContext).readOnly());
} }
} }

Loading…
Cancel
Save