From 1b699a49fb7677c80d654c93f539edf27edeb0f9 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 6 Sep 2019 16:07:33 -0500 Subject: [PATCH] Polish RSocket packaging Fixes gh-7413 --- .../rsocket/PayloadInterceptorOrder.java | 3 ++- .../config/annotation/rsocket/RSocketSecurity.java | 4 ++-- .../config/annotation/rsocket/JwtITests.java | 2 +- .../RSocketMessageHandlerConnectionITests.java | 2 +- .../rsocket/RSocketMessageHandlerITests.java | 2 +- .../rsocket/{ => api}/PayloadExchange.java | 2 +- .../rsocket/{ => api}/PayloadExchangeType.java | 2 +- .../rsocket/{ => api}/PayloadInterceptor.java | 2 +- .../rsocket/{ => api}/PayloadInterceptorChain.java | 2 +- .../AnonymousPayloadInterceptor.java | 6 +++--- .../AuthenticationPayloadInterceptor.java | 6 +++--- ...asicAuthenticationPayloadExchangeConverter.java | 2 +- .../BearerPayloadExchangeConverter.java | 2 +- .../PayloadExchangeAuthenticationConverter.java | 2 +- .../AuthorizationPayloadInterceptor.java | 6 +++--- ...xchangeMatcherReactiveAuthorizationManager.java | 2 +- .../{ => core}/ContextPayloadInterceptorChain.java | 5 ++++- .../rsocket/{ => core}/DefaultPayloadExchange.java | 4 +++- .../{ => core}/PayloadInterceptorRSocket.java | 4 +++- .../rsocket/{ => core}/PayloadSocketAcceptor.java | 4 +++- .../PayloadSocketAcceptorInterceptor.java | 3 ++- .../PayloadExchangeAuthorizationContext.java | 2 +- .../util/matcher/PayloadExchangeMatcher.java | 2 +- .../util/matcher/PayloadExchangeMatchers.java | 4 ++-- .../util/matcher/RoutePayloadExchangeMatcher.java | 2 +- .../AnonymousPayloadInterceptorTests.java | 2 +- .../AuthenticationPayloadInterceptorChain.java | 4 ++-- .../AuthenticationPayloadInterceptorTests.java | 8 ++++---- .../AuthorizationPayloadInterceptorTests.java | 4 ++-- ...ngeMatcherReactiveAuthorizationManagerTest.java | 2 +- .../{ => core}/PayloadInterceptorRSocketTests.java | 14 +++++++------- .../PayloadSocketAcceptorInterceptorTests.java | 10 +++++----- .../{ => core}/PayloadSocketAcceptorTests.java | 10 +++++----- .../matcher/RoutePayloadExchangeMatcherTests.java | 6 +++--- 34 files changed, 74 insertions(+), 63 deletions(-) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => api}/PayloadExchange.java (94%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => api}/PayloadExchangeType.java (97%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => api}/PayloadInterceptor.java (96%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => api}/PayloadInterceptorChain.java (95%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => core}/ContextPayloadInterceptorChain.java (92%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => core}/DefaultPayloadExchange.java (90%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => core}/PayloadInterceptorRSocket.java (95%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => core}/PayloadSocketAcceptor.java (95%) rename rsocket/src/main/java/org/springframework/security/rsocket/{ => core}/PayloadSocketAcceptorInterceptor.java (94%) rename rsocket/src/test/java/org/springframework/security/rsocket/{ => core}/PayloadInterceptorRSocketTests.java (97%) rename rsocket/src/test/java/org/springframework/security/rsocket/{ => core}/PayloadSocketAcceptorInterceptorTests.java (92%) rename rsocket/src/test/java/org/springframework/security/rsocket/{ => core}/PayloadSocketAcceptorTests.java (94%) diff --git a/config/src/main/java/org/springframework/security/config/annotation/rsocket/PayloadInterceptorOrder.java b/config/src/main/java/org/springframework/security/config/annotation/rsocket/PayloadInterceptorOrder.java index 8192d411c0..eba69bd9c5 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/rsocket/PayloadInterceptorOrder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/rsocket/PayloadInterceptorOrder.java @@ -18,9 +18,10 @@ package org.springframework.security.config.annotation.rsocket; import org.springframework.core.Ordered; import org.springframework.security.config.Customizer; +import org.springframework.security.rsocket.api.PayloadInterceptor; /** - * The standard order for {@link org.springframework.security.rsocket.PayloadInterceptor} to be + * The standard order for {@link PayloadInterceptor} to be * sorted. The actual values might change, so users should use the {@link #getOrder()} method to * calculate the position dynamically rather than copy values. * diff --git a/config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java index df88ccbe84..94c6fa7ed4 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java +++ b/config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java @@ -29,8 +29,8 @@ import org.springframework.security.authorization.ReactiveAuthorizationManager; import org.springframework.security.config.Customizer; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; import org.springframework.security.oauth2.server.resource.authentication.JwtReactiveAuthenticationManager; -import org.springframework.security.rsocket.PayloadInterceptor; -import org.springframework.security.rsocket.PayloadSocketAcceptorInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.core.PayloadSocketAcceptorInterceptor; import org.springframework.security.rsocket.authentication.AnonymousPayloadInterceptor; import org.springframework.security.rsocket.authentication.AuthenticationPayloadInterceptor; import org.springframework.security.rsocket.authentication.BearerPayloadExchangeConverter; diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java index c1d5648420..0dfd968178 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/JwtITests.java @@ -34,7 +34,7 @@ import org.springframework.security.config.Customizer; import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; -import org.springframework.security.rsocket.PayloadSocketAcceptorInterceptor; +import org.springframework.security.rsocket.core.PayloadSocketAcceptorInterceptor; import org.springframework.security.rsocket.metadata.BasicAuthenticationEncoder; import org.springframework.security.rsocket.metadata.BearerTokenMetadata; import org.springframework.stereotype.Controller; diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java index 2b58d1b392..75a8e8bde2 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerConnectionITests.java @@ -35,7 +35,7 @@ import org.springframework.security.config.Customizer; import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.rsocket.PayloadSocketAcceptorInterceptor; +import org.springframework.security.rsocket.core.PayloadSocketAcceptorInterceptor; import org.springframework.security.rsocket.metadata.BasicAuthenticationEncoder; import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; import org.springframework.stereotype.Controller; diff --git a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java index 38b0aca8bd..59dcac2401 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/rsocket/RSocketMessageHandlerITests.java @@ -36,7 +36,7 @@ import org.springframework.security.config.Customizer; import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.rsocket.PayloadSocketAcceptorInterceptor; +import org.springframework.security.rsocket.core.PayloadSocketAcceptorInterceptor; import org.springframework.security.rsocket.metadata.BasicAuthenticationEncoder; import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; import org.springframework.stereotype.Controller; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchange.java b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchange.java similarity index 94% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchange.java rename to rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchange.java index fbb2adf542..1979d5e263 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchange.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchange.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.api; import io.rsocket.Payload; import org.springframework.util.MimeType; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchangeType.java b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchangeType.java similarity index 97% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchangeType.java rename to rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchangeType.java index cae02f9579..e31d84b50e 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadExchangeType.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadExchangeType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.api; /** * The {@link PayloadExchange} type diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptor.java similarity index 96% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptor.java rename to rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptor.java index d4f7e9d637..2f6f36c02b 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.api; import reactor.core.publisher.Mono; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorChain.java b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptorChain.java similarity index 95% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorChain.java rename to rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptorChain.java index d49dbeaf90..30307ffc05 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorChain.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/api/PayloadInterceptorChain.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.api; import reactor.core.publisher.Mono; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptor.java index 54c3be0363..69fc5f6015 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptor.java @@ -23,9 +23,9 @@ import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.util.Assert; import reactor.core.publisher.Mono; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; import java.util.List; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptor.java index 7219c65588..2765f1e7b7 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptor.java @@ -20,9 +20,9 @@ import org.springframework.core.Ordered; import org.springframework.security.authentication.ReactiveAuthenticationManager; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.ReactiveSecurityContextHolder; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptor; -import org.springframework.security.rsocket.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; import org.springframework.util.Assert; import reactor.core.publisher.Mono; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BasicAuthenticationPayloadExchangeConverter.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BasicAuthenticationPayloadExchangeConverter.java index 0471a4a689..dac42d0ba4 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BasicAuthenticationPayloadExchangeConverter.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BasicAuthenticationPayloadExchangeConverter.java @@ -21,7 +21,7 @@ import org.springframework.messaging.rsocket.DefaultMetadataExtractor; import org.springframework.messaging.rsocket.MetadataExtractor; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import org.springframework.security.rsocket.metadata.BasicAuthenticationDecoder; import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; import org.springframework.util.MimeType; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BearerPayloadExchangeConverter.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BearerPayloadExchangeConverter.java index b52a229c30..9b1d92a58d 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BearerPayloadExchangeConverter.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/BearerPayloadExchangeConverter.java @@ -20,7 +20,7 @@ import io.netty.buffer.ByteBuf; import io.rsocket.metadata.CompositeMetadata; import org.springframework.security.core.Authentication; import org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import org.springframework.security.rsocket.metadata.BearerTokenMetadata; import reactor.core.publisher.Mono; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/PayloadExchangeAuthenticationConverter.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/PayloadExchangeAuthenticationConverter.java index dc34ef0262..dbb247246e 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/PayloadExchangeAuthenticationConverter.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/PayloadExchangeAuthenticationConverter.java @@ -17,7 +17,7 @@ package org.springframework.security.rsocket.authentication; import org.springframework.security.core.Authentication; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import reactor.core.publisher.Mono; /** diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptor.java index 097f25cdf2..c439f98a88 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptor.java @@ -23,9 +23,9 @@ import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.context.SecurityContext; import org.springframework.util.Assert; import reactor.core.publisher.Mono; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; /** * Provides authorization of the {@link PayloadExchange}. diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManager.java b/rsocket/src/main/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManager.java index bcb3a573e6..0382491137 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManager.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManager.java @@ -22,7 +22,7 @@ import org.springframework.security.core.Authentication; import org.springframework.util.Assert; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import org.springframework.security.rsocket.PayloadExchange; +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.PayloadExchangeMatcherEntry; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/ContextPayloadInterceptorChain.java b/rsocket/src/main/java/org/springframework/security/rsocket/core/ContextPayloadInterceptorChain.java similarity index 92% rename from rsocket/src/main/java/org/springframework/security/rsocket/ContextPayloadInterceptorChain.java rename to rsocket/src/main/java/org/springframework/security/rsocket/core/ContextPayloadInterceptorChain.java index 005d4b1bd6..c92785b7d0 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/ContextPayloadInterceptorChain.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/core/ContextPayloadInterceptorChain.java @@ -14,8 +14,11 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; import reactor.core.publisher.Mono; import reactor.util.context.Context; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/DefaultPayloadExchange.java b/rsocket/src/main/java/org/springframework/security/rsocket/core/DefaultPayloadExchange.java similarity index 90% rename from rsocket/src/main/java/org/springframework/security/rsocket/DefaultPayloadExchange.java rename to rsocket/src/main/java/org/springframework/security/rsocket/core/DefaultPayloadExchange.java index ab684a68b6..e49ccb5154 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/DefaultPayloadExchange.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/core/DefaultPayloadExchange.java @@ -14,9 +14,11 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.Payload; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchangeType; import org.springframework.util.Assert; import org.springframework.util.MimeType; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorRSocket.java b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocket.java similarity index 95% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorRSocket.java rename to rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocket.java index 8132d62da2..418fb67121 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadInterceptorRSocket.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocket.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.Payload; import io.rsocket.RSocket; import io.rsocket.ResponderRSocket; import io.rsocket.util.RSocketProxy; import org.reactivestreams.Publisher; +import org.springframework.security.rsocket.api.PayloadExchangeType; +import org.springframework.security.rsocket.api.PayloadInterceptor; import org.springframework.util.MimeType; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptor.java similarity index 95% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptor.java rename to rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptor.java index 6d4059dfb7..5e8839c139 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.ConnectionSetupPayload; import io.rsocket.Payload; @@ -22,6 +22,8 @@ import io.rsocket.RSocket; import io.rsocket.SocketAcceptor; import io.rsocket.metadata.WellKnownMimeType; import org.springframework.lang.Nullable; +import org.springframework.security.rsocket.api.PayloadExchangeType; +import org.springframework.security.rsocket.api.PayloadInterceptor; import org.springframework.util.Assert; import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptor.java b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptor.java similarity index 94% rename from rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptor.java rename to rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptor.java index b735d61632..52cba75c45 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptor.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptor.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.SocketAcceptor; import io.rsocket.metadata.WellKnownMimeType; import io.rsocket.plugins.SocketAcceptorInterceptor; import org.springframework.lang.Nullable; +import org.springframework.security.rsocket.api.PayloadInterceptor; import org.springframework.util.Assert; import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeAuthorizationContext.java b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeAuthorizationContext.java index 2cb3719c88..7312dbb4d0 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeAuthorizationContext.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeAuthorizationContext.java @@ -16,7 +16,7 @@ package org.springframework.security.rsocket.util.matcher; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import java.util.Collections; import java.util.Map; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatcher.java b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatcher.java index f7baaac650..cf8f00bc98 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatcher.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatcher.java @@ -15,7 +15,7 @@ */ package org.springframework.security.rsocket.util.matcher; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import reactor.core.publisher.Mono; import java.util.Collections; diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatchers.java b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatchers.java index 979eea096a..a6e110ebeb 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatchers.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/PayloadExchangeMatchers.java @@ -16,8 +16,8 @@ package org.springframework.security.rsocket.util.matcher; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadExchangeType; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchangeType; import reactor.core.publisher.Mono; /** diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcher.java b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcher.java index ed0c2207ae..ce5bf542d7 100644 --- a/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcher.java +++ b/rsocket/src/main/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcher.java @@ -17,7 +17,7 @@ package org.springframework.security.rsocket.util.matcher; import org.springframework.messaging.rsocket.MetadataExtractor; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import org.springframework.util.Assert; import org.springframework.util.RouteMatcher; import reactor.core.publisher.Mono; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptorTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptorTests.java index f9a6123bda..5aa69706fe 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptorTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AnonymousPayloadInterceptorTests.java @@ -27,7 +27,7 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.context.ReactiveSecurityContextHolder; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; import java.util.List; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorChain.java b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorChain.java index 3979c35faa..30693d6b45 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorChain.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorChain.java @@ -20,8 +20,8 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.context.SecurityContext; import reactor.core.publisher.Mono; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; /** * @author Rob Winch diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorTests.java index bec12b17dc..7c3926e231 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadInterceptorTests.java @@ -37,7 +37,7 @@ import org.springframework.security.authentication.ReactiveAuthenticationManager import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; -import org.springframework.security.rsocket.PayloadExchangeType; +import org.springframework.security.rsocket.api.PayloadExchangeType; import org.springframework.security.rsocket.metadata.BasicAuthenticationEncoder; import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; import org.springframework.util.MimeType; @@ -45,9 +45,9 @@ import org.springframework.util.MimeTypeUtils; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.test.publisher.PublisherProbe; -import org.springframework.security.rsocket.DefaultPayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.core.DefaultPayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; import java.util.Map; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptorTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptorTests.java index 75251083ee..5e5178a46d 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptorTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/authorization/AuthorizationPayloadInterceptorTests.java @@ -29,8 +29,8 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.test.publisher.PublisherProbe; import reactor.util.context.Context; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.api.PayloadExchange; import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManagerTest.java b/rsocket/src/test/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManagerTest.java index 15fec2d043..03a614b792 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManagerTest.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/authorization/PayloadExchangeMatcherReactiveAuthorizationManagerTest.java @@ -22,7 +22,7 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.security.authorization.AuthorizationDecision; import org.springframework.security.authorization.ReactiveAuthorizationManager; -import org.springframework.security.rsocket.PayloadExchange; +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.PayloadExchangeMatcherEntry; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadInterceptorRSocketTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocketTests.java similarity index 97% rename from rsocket/src/test/java/org/springframework/security/rsocket/PayloadInterceptorRSocketTests.java rename to rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocketTests.java index 45472009a7..a925ac676e 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadInterceptorRSocketTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadInterceptorRSocketTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.Payload; import io.rsocket.RSocket; @@ -33,12 +33,12 @@ import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.rsocket.DefaultPayloadExchange; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadExchangeType; -import org.springframework.security.rsocket.PayloadInterceptor; -import org.springframework.security.rsocket.PayloadInterceptorChain; -import org.springframework.security.rsocket.PayloadInterceptorRSocket; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchangeType; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.api.PayloadInterceptorChain; +import org.springframework.security.rsocket.core.DefaultPayloadExchange; +import org.springframework.security.rsocket.core.PayloadInterceptorRSocket; import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; import reactor.core.publisher.Flux; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptorTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptorTests.java similarity index 92% rename from rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptorTests.java rename to rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptorTests.java index 50c4bdc907..d06ac483d0 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorInterceptorTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorInterceptorTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.ConnectionSetupPayload; import io.rsocket.Payload; @@ -28,10 +28,10 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.http.MediaType; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptor; -import org.springframework.security.rsocket.PayloadInterceptorRSocket; -import org.springframework.security.rsocket.PayloadSocketAcceptorInterceptor; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.core.PayloadInterceptorRSocket; +import org.springframework.security.rsocket.core.PayloadSocketAcceptorInterceptor; import reactor.core.publisher.Mono; import java.util.Arrays; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorTests.java similarity index 94% rename from rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorTests.java rename to rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorTests.java index 48f95d93f4..943fc978b9 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/PayloadSocketAcceptorTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/core/PayloadSocketAcceptorTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.security.rsocket; +package org.springframework.security.rsocket.core; import io.rsocket.ConnectionSetupPayload; import io.rsocket.Payload; @@ -28,10 +28,10 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.http.MediaType; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadInterceptor; -import org.springframework.security.rsocket.PayloadInterceptorRSocket; -import org.springframework.security.rsocket.PayloadSocketAcceptor; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadInterceptor; +import org.springframework.security.rsocket.core.PayloadInterceptorRSocket; +import org.springframework.security.rsocket.core.PayloadSocketAcceptor; import reactor.core.publisher.Mono; import java.util.Arrays; diff --git a/rsocket/src/test/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcherTests.java b/rsocket/src/test/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcherTests.java index afd1a42416..6d0b2ae73b 100644 --- a/rsocket/src/test/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcherTests.java +++ b/rsocket/src/test/java/org/springframework/security/rsocket/util/matcher/RoutePayloadExchangeMatcherTests.java @@ -25,9 +25,9 @@ import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.http.MediaType; import org.springframework.messaging.rsocket.MetadataExtractor; -import org.springframework.security.rsocket.DefaultPayloadExchange; -import org.springframework.security.rsocket.PayloadExchange; -import org.springframework.security.rsocket.PayloadExchangeType; +import org.springframework.security.rsocket.core.DefaultPayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchange; +import org.springframework.security.rsocket.api.PayloadExchangeType; import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; import org.springframework.util.RouteMatcher;