浏览代码

Polish RSocket Anonymous Support

Changed the DSL method name to anonymous to align with jwt.
Since basicAuthenication is deprecated, we don't need to
align with its naming convention.

Also added a since attribute to the method.

Issue gh-17132
Josh Cummings 2 周之前
父节点
当前提交
4cbe8de7ea

+ 1 - 1
config/src/integration-test/java/org/springframework/security/config/annotation/rsocket/AnonymousAuthenticationITests.java

@@ -121,7 +121,7 @@ public class AnonymousAuthenticationITests {
 			ReactiveAuthorizationManager<PayloadExchangeAuthorizationContext> anonymous = (authentication,
 					exchange) -> authentication.map(trustResolver::isAnonymous).map(AuthorizationDecision::new);
 			rsocket.authorizePayload((authorize) -> authorize.anyExchange().access(anonymous));
-			rsocket.anonymousAuthentication((anonymousAuthentication) -> anonymousAuthentication.disable());
+			rsocket.anonymous((anonymousAuthentication) -> anonymousAuthentication.disable());
 			return rsocket.build();
 		}
 

+ 2 - 1
config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java

@@ -171,8 +171,9 @@ public class RSocketSecurity {
 	 * Adds anonymous authentication
 	 * @param anonymous a customizer
 	 * @return this instance
+	 * @since 7.0
 	 */
-	public RSocketSecurity anonymousAuthentication(Customizer<AnonymousAuthenticationSpec> anonymous) {
+	public RSocketSecurity anonymous(Customizer<AnonymousAuthenticationSpec> anonymous) {
 		if (this.anonymousAuthSpec == null) {
 			this.anonymousAuthSpec = new AnonymousAuthenticationSpec(this);
 		}