Add PathRequest to reactive security for parity
This commit is contained in:
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.autoconfigure.security.reactive.EndpointRequest;
|
||||
import org.springframework.boot.autoconfigure.security.reactive.PathRequest;
|
||||
import org.springframework.boot.autoconfigure.security.reactive.StaticResourceRequest;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -101,7 +102,7 @@ public class SampleSecureWebFluxCustomSecurityTests {
|
||||
http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
|
||||
.permitAll().matchers(EndpointRequest.toAnyEndpoint())
|
||||
.hasRole("ACTUATOR")
|
||||
.matchers(StaticResourceRequest.toCommonLocations()).permitAll()
|
||||
.matchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
|
||||
.pathMatchers("/login").permitAll().anyExchange().authenticated()
|
||||
.and().httpBasic();
|
||||
return http.build();
|
||||
|
||||
Reference in New Issue
Block a user