Skip to content

Commit

Permalink
RSocketSecurity delegates to correct matcher
Browse files Browse the repository at this point in the history
Fixes gh-7414
  • Loading branch information
rwinch committed Sep 9, 2019
1 parent 1b699a4 commit 6296e6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,20 @@ public Access setup() {
return matcher(PayloadExchangeMatchers.setup());
}

/**
* Matches if {@link org.springframework.security.rsocket.api.PayloadExchangeType#isRequest()} is true, else
* not a match
* @return the Access to set up the authorization rule.
*/
public Access anyRequest() {
return matcher(PayloadExchangeMatchers.anyRequest());
}

/**
* Always matches
* @return the Access to set up the authorization rule.
*/
public Access anyExchange() {
return matcher(PayloadExchangeMatchers.anyExchange());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
.authorizePayload(authorize ->
authorize
.route("secure.admin.*").authenticated()
.anyRequest().permitAll()
.anyExchange().permitAll()
)
.jwt(Customizer.withDefaults());
return rsocket.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
.authorizePayload(authorize -> {
authorize
.route("secure.*").authenticated()
.anyRequest().permitAll();
.anyExchange().permitAll();
})
.basicAuthentication(Customizer.withDefaults());
return rsocket.build();
Expand Down

0 comments on commit 6296e6e

Please sign in to comment.