Skip to content

Commit a4a3f4f

Browse files
committed
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
1 parent 20d3bbc commit a4a3f4f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
121121
ReactiveAuthorizationManager<PayloadExchangeAuthorizationContext> anonymous = (authentication,
122122
exchange) -> authentication.map(trustResolver::isAnonymous).map(AuthorizationDecision::new);
123123
rsocket.authorizePayload((authorize) -> authorize.anyExchange().access(anonymous));
124-
rsocket.anonymousAuthentication((anonymousAuthentication) -> anonymousAuthentication.disable());
124+
rsocket.anonymous((anonymousAuthentication) -> anonymousAuthentication.disable());
125125
return rsocket.build();
126126
}
127127

config/src/main/java/org/springframework/security/config/annotation/rsocket/RSocketSecurity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ public RSocketSecurity simpleAuthentication(Customizer<SimpleAuthenticationSpec>
171171
* Adds anonymous authentication
172172
* @param anonymous a customizer
173173
* @return this instance
174+
* @since 7.0
174175
*/
175-
public RSocketSecurity anonymousAuthentication(Customizer<AnonymousAuthenticationSpec> anonymous) {
176+
public RSocketSecurity anonymous(Customizer<AnonymousAuthenticationSpec> anonymous) {
176177
if (this.anonymousAuthSpec == null) {
177178
this.anonymousAuthSpec = new AnonymousAuthenticationSpec(this);
178179
}

0 commit comments

Comments
 (0)