Skip to content

Commit f789abc

Browse files
committed
Use ServerHttpSecurity Lambda DSL in JavaDoc
Issue gh-13067
1 parent 461f00e commit f789abc

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,8 @@
270270
* @Bean
271271
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
272272
* http
273-
* .authorizeExchange()
274-
* .anyExchange().authenticated()
275-
* .and()
276-
* .httpBasic().and()
273+
* .authorizeExchange((exchange) -> exchange.anyExchange().authenticated())
274+
* .httpBasic(Customizer.withDefaults())
277275
* .formLogin();
278276
* return http.build();
279277
* }
@@ -1219,9 +1217,8 @@ public ServerHttpSecurity oidcLogout(Customizer<OidcLogoutSpec> oidcLogoutCustom
12191217
* // ...
12201218
* .headers()
12211219
* // customize frame options to be same origin
1222-
* .frameOptions()
1223-
* .mode(XFrameOptionsServerHttpHeadersWriter.Mode.SAMEORIGIN)
1224-
* .and()
1220+
* .frameOptions((frame) -> frame
1221+
* .mode(XFrameOptionsServerHttpHeadersWriter.Mode.SAMEORIGIN))
12251222
* // disable cache control
12261223
* .cache().disable();
12271224
* return http.build();
@@ -1857,7 +1854,7 @@ protected void setApplicationContext(ApplicationContext applicationContext) thro
18571854
*
18581855
* @author Rob Winch
18591856
* @since 5.0
1860-
* @see #authorizeExchange()
1857+
* @see #authorizeExchange(Customizer)
18611858
*/
18621859
public class AuthorizeExchangeSpec extends AbstractServerWebExchangeMatcherRegistry<AuthorizeExchangeSpec.Access> {
18631860

@@ -2306,7 +2303,7 @@ public Duration getMaxIdleTime() {
23062303
*
23072304
* @author Josh Cummings
23082305
* @since 5.1
2309-
* @see #redirectToHttps()
2306+
* @see #redirectToHttps(Customizer)
23102307
*/
23112308
public class HttpsRedirectSpec {
23122309

@@ -2380,7 +2377,7 @@ public ServerHttpSecurity and() {
23802377
*
23812378
* @author Rob Winch
23822379
* @since 5.0
2383-
* @see #csrf()
2380+
* @see #csrf(Customizer)
23842381
*/
23852382
public final class CsrfSpec {
23862383

@@ -2483,7 +2480,7 @@ protected void configure(ServerHttpSecurity http) {
24832480
*
24842481
* @author Rob Winch
24852482
* @since 5.0
2486-
* @see #exceptionHandling()
2483+
* @see #exceptionHandling(Customizer)
24872484
*/
24882485
public final class ExceptionHandlingSpec {
24892486

@@ -2532,7 +2529,7 @@ public ServerHttpSecurity and() {
25322529
*
25332530
* @author Rob Winch
25342531
* @since 5.0
2535-
* @see #requestCache()
2532+
* @see #requestCache(Customizer)
25362533
*/
25372534
public final class RequestCacheSpec {
25382535

@@ -2588,7 +2585,7 @@ public ServerHttpSecurity disable() {
25882585
*
25892586
* @author Rob Winch
25902587
* @since 5.0
2591-
* @see #httpBasic()
2588+
* @see #httpBasic(Customizer)
25922589
*/
25932590
public final class HttpBasicSpec {
25942591

@@ -2814,7 +2811,7 @@ private PasswordManagementSpec() {
28142811
*
28152812
* @author Rob Winch
28162813
* @since 5.0
2817-
* @see #formLogin()
2814+
* @see #formLogin(Customizer)
28182815
*/
28192816
public final class FormLoginSpec {
28202817

@@ -3080,7 +3077,7 @@ protected void configure(ServerHttpSecurity http) {
30803077
*
30813078
* @author Rob Winch
30823079
* @since 5.0
3083-
* @see #headers()
3080+
* @see #headers(Customizer)
30843081
*/
30853082
public final class HeaderSpec {
30863083

@@ -3916,7 +3913,7 @@ public HeaderSpec and() {
39163913
*
39173914
* @author Shazin Sadakath
39183915
* @since 5.0
3919-
* @see #logout()
3916+
* @see #logout(Customizer)
39203917
*/
39213918
public final class LogoutSpec {
39223919

@@ -4136,7 +4133,7 @@ private CorsWebFilter getCorsFilter() {
41364133
*
41374134
* @author Alexey Nesterov
41384135
* @since 5.2
4139-
* @see #x509()
4136+
* @see #x509(Customizer)
41404137
*/
41414138
public final class X509Spec {
41424139

@@ -5275,7 +5272,7 @@ private void registerDefaultCsrfOverride(ServerHttpSecurity http) {
52755272
AndServerWebExchangeMatcher matcher = new AndServerWebExchangeMatcher(
52765273
CsrfWebFilter.DEFAULT_CSRF_MATCHER,
52775274
new NegatedServerWebExchangeMatcher(this.authenticationConverterServerWebExchangeMatcher));
5278-
http.csrf().requireCsrfProtectionMatcher(matcher);
5275+
http.csrf((csrf) -> csrf.requireCsrfProtectionMatcher(matcher));
52795276
}
52805277
}
52815278

0 commit comments

Comments
 (0)