From 247f737bc8ae9e71061ec77e8c66f3b37ad77548 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Wed, 11 Oct 2017 15:16:29 -0500 Subject: [PATCH] Move HttpBasicServerAuthenticationEntryPoint Move it up a package as www is too sparse. This is different than servlet based support, but we also are now using a generic AuthenticationWebFilter Fixes gh-4617 --- .../security/config/web/server/ServerHttpSecurity.java | 2 +- .../web/server/authentication/AuthenticationWebFilter.java | 1 - .../{www => }/HttpBasicServerAuthenticationEntryPoint.java | 2 +- .../server/authorization/ExceptionTranslationWebFilter.java | 2 +- .../HttpBasicServerAuthenticationEntryPointTests.java | 3 ++- 5 files changed, 5 insertions(+), 5 deletions(-) rename webflux/src/main/java/org/springframework/security/web/server/authentication/{www => }/HttpBasicServerAuthenticationEntryPoint.java (96%) rename webflux/src/test/java/org/springframework/security/web/server/authentication/{www => }/HttpBasicServerAuthenticationEntryPointTests.java (94%) diff --git a/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java b/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java index 331f3f4398..dd9bb4c099 100644 --- a/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java @@ -38,7 +38,7 @@ import org.springframework.security.web.server.authentication.RedirectServerAuth import org.springframework.security.web.server.authentication.logout.ServerLogoutHandler; import org.springframework.security.web.server.authentication.logout.LogoutWebFilter; import org.springframework.security.web.server.authentication.logout.SecurityContextServerLogoutHandler; -import org.springframework.security.web.server.authentication.www.HttpBasicServerAuthenticationEntryPoint; +import org.springframework.security.web.server.authentication.HttpBasicServerAuthenticationEntryPoint; import org.springframework.security.web.server.authorization.AuthorizationContext; import org.springframework.security.web.server.authorization.AuthorizationWebFilter; import org.springframework.security.web.server.authorization.DelegatingReactiveAuthorizationManager; diff --git a/webflux/src/main/java/org/springframework/security/web/server/authentication/AuthenticationWebFilter.java b/webflux/src/main/java/org/springframework/security/web/server/authentication/AuthenticationWebFilter.java index 370f1d94b6..1cb622a411 100644 --- a/webflux/src/main/java/org/springframework/security/web/server/authentication/AuthenticationWebFilter.java +++ b/webflux/src/main/java/org/springframework/security/web/server/authentication/AuthenticationWebFilter.java @@ -25,7 +25,6 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextImpl; import org.springframework.security.web.server.ServerHttpBasicAuthenticationConverter; import org.springframework.security.web.server.WebFilterExchange; -import org.springframework.security.web.server.authentication.www.HttpBasicServerAuthenticationEntryPoint; import org.springframework.security.web.server.context.ServerSecurityContextRepository; import org.springframework.security.web.server.context.SecurityContextRepositoryServerWebExchange; import org.springframework.security.web.server.context.ServerWebExchangeAttributeServerSecurityContextRepository; diff --git a/webflux/src/main/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPoint.java b/webflux/src/main/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPoint.java similarity index 96% rename from webflux/src/main/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPoint.java rename to webflux/src/main/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPoint.java index af90e2170e..a32b8283b0 100644 --- a/webflux/src/main/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPoint.java +++ b/webflux/src/main/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPoint.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.web.server.authentication.www; +package org.springframework.security.web.server.authentication; import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpResponse; diff --git a/webflux/src/main/java/org/springframework/security/web/server/authorization/ExceptionTranslationWebFilter.java b/webflux/src/main/java/org/springframework/security/web/server/authorization/ExceptionTranslationWebFilter.java index e40aa9f6da..24c22de72f 100644 --- a/webflux/src/main/java/org/springframework/security/web/server/authorization/ExceptionTranslationWebFilter.java +++ b/webflux/src/main/java/org/springframework/security/web/server/authorization/ExceptionTranslationWebFilter.java @@ -21,7 +21,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; import org.springframework.security.web.server.ServerAuthenticationEntryPoint; -import org.springframework.security.web.server.authentication.www.HttpBasicServerAuthenticationEntryPoint; +import org.springframework.security.web.server.authentication.HttpBasicServerAuthenticationEntryPoint; import org.springframework.util.Assert; import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.WebFilter; diff --git a/webflux/src/test/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPointTests.java b/webflux/src/test/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPointTests.java similarity index 94% rename from webflux/src/test/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPointTests.java rename to webflux/src/test/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPointTests.java index 4ab97973ed..5aa1b6c830 100644 --- a/webflux/src/test/java/org/springframework/security/web/server/authentication/www/HttpBasicServerAuthenticationEntryPointTests.java +++ b/webflux/src/test/java/org/springframework/security/web/server/authentication/HttpBasicServerAuthenticationEntryPointTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.web.server.authentication.www; +package org.springframework.security.web.server.authentication; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,6 +25,7 @@ import org.springframework.http.HttpStatus; import org.springframework.mock.http.server.reactive.MockServerHttpRequest; import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.server.authentication.HttpBasicServerAuthenticationEntryPoint; import org.springframework.web.server.ServerWebExchange; import static org.assertj.core.api.Assertions.assertThat;