AuthenticatedAuthorizationManager->AuthenticatedReactiveAuthorizationManager
Issue gh-4615
This commit is contained in:
parent
866ce5eaec
commit
f1bc82dcef
|
@ -20,7 +20,7 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
|||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.authentication.ReactiveAuthenticationManager;
|
||||
import org.springframework.security.authorization.AuthenticatedAuthorizationManager;
|
||||
import org.springframework.security.authorization.AuthenticatedReactiveAuthorizationManager;
|
||||
import org.springframework.security.authorization.AuthorityReactiveAuthorizationManager;
|
||||
import org.springframework.security.authorization.AuthorizationDecision;
|
||||
import org.springframework.security.authorization.ReactiveAuthorizationManager;
|
||||
|
@ -301,7 +301,7 @@ public class HttpSecurity {
|
|||
}
|
||||
|
||||
public AuthorizeExchangeBuilder authenticated() {
|
||||
return access(AuthenticatedAuthorizationManager.authenticated());
|
||||
return access(AuthenticatedReactiveAuthorizationManager.authenticated());
|
||||
}
|
||||
|
||||
public AuthorizeExchangeBuilder access(ReactiveAuthorizationManager<AuthorizationContext> manager) {
|
||||
|
|
|
@ -23,7 +23,7 @@ import reactor.core.publisher.Mono;
|
|||
* @author Rob Winch
|
||||
* @since 5.0
|
||||
*/
|
||||
public class AuthenticatedAuthorizationManager<T> implements ReactiveAuthorizationManager<T> {
|
||||
public class AuthenticatedReactiveAuthorizationManager<T> implements ReactiveAuthorizationManager<T> {
|
||||
|
||||
@Override
|
||||
public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, T object) {
|
||||
|
@ -32,9 +32,9 @@ public class AuthenticatedAuthorizationManager<T> implements ReactiveAuthorizati
|
|||
.defaultIfEmpty(new AuthorizationDecision(false));
|
||||
}
|
||||
|
||||
public static <T> AuthenticatedAuthorizationManager<T> authenticated() {
|
||||
return new AuthenticatedAuthorizationManager<>();
|
||||
public static <T> AuthenticatedReactiveAuthorizationManager<T> authenticated() {
|
||||
return new AuthenticatedReactiveAuthorizationManager<>();
|
||||
}
|
||||
|
||||
private AuthenticatedAuthorizationManager() {}
|
||||
private AuthenticatedReactiveAuthorizationManager() {}
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.springframework.security.authorization;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
|
@ -33,11 +32,12 @@ import static org.mockito.Mockito.when;
|
|||
* @since 5.0
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AuthenticatedAuthorizationManagerTests {
|
||||
public class AuthenticatedReactiveAuthorizationManagerTests {
|
||||
@Mock
|
||||
Authentication authentication;
|
||||
|
||||
AuthenticatedAuthorizationManager<Object> manager = AuthenticatedAuthorizationManager.authenticated();
|
||||
AuthenticatedReactiveAuthorizationManager<Object> manager = AuthenticatedReactiveAuthorizationManager
|
||||
.authenticated();
|
||||
|
||||
@Test
|
||||
public void checkWhenAuthenticatedThenReturnTrue() {
|
Loading…
Reference in New Issue