Update to Reactor 2025.0.0-SNAPSHOT
To prepare for the release we should update to Reactor 2025.0.0-SNAPSHOT to fix any issues that are present. Closes gh-18041
This commit is contained in:
+2
-2
@@ -55,10 +55,10 @@ public class AuthorizationPayloadInterceptor implements PayloadInterceptor, Orde
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1290
|
||||
public Mono<Void> intercept(PayloadExchange exchange, PayloadInterceptorChain chain) {
|
||||
return ReactiveSecurityContextHolder.getContext()
|
||||
.filter((c) -> c.getAuthentication() != null)
|
||||
.map(SecurityContext::getAuthentication)
|
||||
.mapNotNull(SecurityContext::getAuthentication)
|
||||
.switchIfEmpty(Mono.error(() -> new AuthenticationCredentialsNotFoundException(
|
||||
"An Authentication (possibly AnonymousAuthenticationToken) is required.")))
|
||||
.as((authentication) -> this.authorizationManager.verify(authentication, exchange))
|
||||
|
||||
+2
-1
@@ -52,12 +52,13 @@ public final class PayloadExchangeMatcherReactiveAuthorizationManager
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1290
|
||||
public Mono<AuthorizationResult> authorize(Mono<Authentication> authentication, PayloadExchange exchange) {
|
||||
return Flux.fromIterable(this.mappings)
|
||||
.concatMap((mapping) -> mapping.getMatcher()
|
||||
.matches(exchange)
|
||||
.filter(PayloadExchangeMatcher.MatchResult::isMatch)
|
||||
.map(MatchResult::getVariables)
|
||||
.mapNotNull(MatchResult::getVariables)
|
||||
.flatMap((variables) -> mapping.getEntry()
|
||||
.authorize(authentication, new PayloadExchangeAuthorizationContext(exchange, variables))))
|
||||
.next()
|
||||
|
||||
Reference in New Issue
Block a user