Update HttpSecurity Formatting
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ public class WebfluxFormSecurityConfiguration {
|
||||
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.pathMatchers("/login").permitAll()
|
||||
.anyExchange().authenticated()
|
||||
)
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class WebfluxX509Application {
|
||||
// @formatter:off
|
||||
http
|
||||
.x509(withDefaults())
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.anyExchange().authenticated()
|
||||
);
|
||||
// @formatter:on
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class SecurityConfiguration {
|
||||
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.anyExchange().authenticated()
|
||||
)
|
||||
.formLogin(withDefaults());
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SecurityConfiguration {
|
||||
http
|
||||
// Demonstrate that method security works
|
||||
// Best practice to use both for defense in depth
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.anyExchange().permitAll()
|
||||
)
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class SecurityConfiguration {
|
||||
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.pathMatchers(HttpMethod.GET, "/message/**").hasAuthority("SCOPE_message:read")
|
||||
.pathMatchers(HttpMethod.POST, "/message/**").hasAuthority("SCOPE_message:write")
|
||||
.anyExchange().authenticated()
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class SecurityConfiguration {
|
||||
SecurityWebFilterChain configure(ServerHttpSecurity http) {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.authorizeExchange((authorize) -> authorize
|
||||
.pathMatchers("/", "/public/**").permitAll()
|
||||
.anyExchange().authenticated()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user