mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
Deprecate shouldFilterAllDispatcherTypes from Kotlin DSL
Issue gh-12138
This commit is contained in:
parent
9f44f3b79a
commit
c89647a56e
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2023 the original author or authors.
|
* Copyright 2002-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -42,6 +42,23 @@ import java.util.function.Supplier
|
|||||||
* @property shouldFilterAllDispatcherTypes whether the [AuthorizationFilter] should filter all dispatcher types
|
* @property shouldFilterAllDispatcherTypes whether the [AuthorizationFilter] should filter all dispatcher types
|
||||||
*/
|
*/
|
||||||
class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl() {
|
class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl() {
|
||||||
|
@Deprecated("""
|
||||||
|
Add authorization rules to DispatcherType directly.
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebSecurity
|
||||||
|
public class SecurityConfig {
|
||||||
|
@Bean
|
||||||
|
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
|
http
|
||||||
|
.authorizeHttpRequests((authorize) -> authorize
|
||||||
|
.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll()
|
||||||
|
// ...
|
||||||
|
);
|
||||||
|
return http.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
""")
|
||||||
var shouldFilterAllDispatcherTypes: Boolean? = null
|
var shouldFilterAllDispatcherTypes: Boolean? = null
|
||||||
|
|
||||||
private val authorizationRules = mutableListOf<AuthorizationManagerRule>()
|
private val authorizationRules = mutableListOf<AuthorizationManagerRule>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user