From a0af32763d512c4fa53a9eae0ab0aad473ac1143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20M=C3=BCnch?= Date: Wed, 22 May 2024 16:35:59 +0200 Subject: [PATCH] Fix Kotlin example in authorize-http-requests.adoc - Consistency: Replaced mix of tabs/spaces with spaces indentation --- .../authorize-http-requests.adoc | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc b/docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc index 7cb7fab3217..0e46caaf464 100644 --- a/docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc +++ b/docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc @@ -185,15 +185,15 @@ Java:: [source,java,role="primary"] ---- @Bean -SecurityFilterChain web(HttpSecurity http) throws Exception { - http - .authorizeHttpRequests((authorize) -> authorize - .requestMatchers("/endpoint").hasAuthority("USER") - .anyRequest().authenticated() - ) +public SecurityFilterChain web(HttpSecurity http) throws Exception { + http + .authorizeHttpRequests((authorize) -> authorize + .requestMatchers("/endpoint").hasAuthority("USER") + .anyRequest().authenticated() + ) // ... - - return http.build(); + + return http.build(); } ---- @@ -202,14 +202,15 @@ Kotlin:: [source,kotlin,role="secondary"] ---- @Bean -SecurityFilterChain web(HttpSecurity http) throws Exception { - http { +fun web(http: HttpSecurity): SecurityFilterChain { + http { authorizeHttpRequests { authorize("/endpoint", hasAuthority("USER")) authorize(anyRequest, authenticated) } - } - return http.build(); + } + + return http.build() } ----