|
@@ -28,6 +28,7 @@ import org.springframework.security.core.Authentication;
|
|
|
import org.springframework.security.rsocket.api.PayloadExchange;
|
|
|
import org.springframework.security.rsocket.util.matcher.PayloadExchangeAuthorizationContext;
|
|
|
import org.springframework.security.rsocket.util.matcher.PayloadExchangeMatcher;
|
|
|
+import org.springframework.security.rsocket.util.matcher.PayloadExchangeMatcher.MatchResult;
|
|
|
import org.springframework.security.rsocket.util.matcher.PayloadExchangeMatcherEntry;
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
@@ -53,7 +54,7 @@ public final class PayloadExchangeMatcherReactiveAuthorizationManager
|
|
|
public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, PayloadExchange exchange) {
|
|
|
return Flux.fromIterable(this.mappings)
|
|
|
.concatMap((mapping) -> mapping.getMatcher().matches(exchange)
|
|
|
- .filter(PayloadExchangeMatcher.MatchResult::isMatch).map((r) -> r.getVariables())
|
|
|
+ .filter(PayloadExchangeMatcher.MatchResult::isMatch).map(MatchResult::getVariables)
|
|
|
.flatMap((variables) -> mapping.getEntry().check(authentication,
|
|
|
new PayloadExchangeAuthorizationContext(exchange, variables))))
|
|
|
.next().switchIfEmpty(Mono.fromCallable(() -> new AuthorizationDecision(false)));
|