Fix Kotlin example in authorize-http-requests.adoc
- Consistency: Replaced mix of tabs/spaces with spaces indentation
This commit is contained in:
parent
9744cc44d2
commit
df59516b18
|
@ -185,7 +185,7 @@ Java::
|
||||||
[source,java,role="primary"]
|
[source,java,role="primary"]
|
||||||
----
|
----
|
||||||
@Bean
|
@Bean
|
||||||
SecurityFilterChain web(HttpSecurity http) throws Exception {
|
public SecurityFilterChain web(HttpSecurity http) throws Exception {
|
||||||
http
|
http
|
||||||
.authorizeHttpRequests((authorize) -> authorize
|
.authorizeHttpRequests((authorize) -> authorize
|
||||||
.requestMatchers("/endpoint").hasAuthority("USER")
|
.requestMatchers("/endpoint").hasAuthority("USER")
|
||||||
|
@ -202,14 +202,15 @@ Kotlin::
|
||||||
[source,kotlin,role="secondary"]
|
[source,kotlin,role="secondary"]
|
||||||
----
|
----
|
||||||
@Bean
|
@Bean
|
||||||
SecurityFilterChain web(HttpSecurity http) throws Exception {
|
fun web(http: HttpSecurity): SecurityFilterChain {
|
||||||
http {
|
http {
|
||||||
authorizeHttpRequests {
|
authorizeHttpRequests {
|
||||||
authorize("/endpoint", hasAuthority("USER"))
|
authorize("/endpoint", hasAuthority("USER"))
|
||||||
authorize(anyRequest, authenticated)
|
authorize(anyRequest, authenticated)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return http.build();
|
|
||||||
|
return http.build()
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue