Skip to content

Commit 74a25c3

Browse files
committed
Add shouldFilterAllDispatcherTypes Migration Steps
1 parent 0849907 commit 74a25c3

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

docs/modules/ROOT/pages/migration-7/configuration.adoc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,60 @@ In versions prior to 6.2, if you had a xref:servlet/configuration/java.adoc#jc-c
123123
However, starting from version 6.2, this method is deprecated and will be removed in 7.0 because it will no longer be possible to chain configurations using `.and()` once `.and()` is removed (see https://github.com/spring-projects/spring-security/issues/13067).
124124
Instead, it is recommended to use the new `.with(...)` method.
125125
For more information about how to use `.with(...)` please refer to the xref:servlet/configuration/java.adoc#jc-custom-dsls[Custom DSLs section].
126+
127+
== Use `dispatcherTypeMatchers` instead of `shouldFilterAllDispatcherTypes`
128+
129+
If you are permitting the ERROR dispatch, you may be using `shouldFilterAllDispatcherTypes(false)` in the `auhorizeHttpRequests` DSL:
130+
131+
[tabs]
132+
======
133+
Java::
134+
+
135+
[source,java,role="primary"]
136+
----
137+
http
138+
.authorizeHttpRequests((authorize) -> authorize
139+
.shouldFilterAllDispatcherTypes(false)
140+
// ...
141+
)
142+
----
143+
144+
Kotlin::
145+
+
146+
[source,kotlin,role="secondary"]
147+
----
148+
http {
149+
authorizeHttpRequests {
150+
shouldFilterAllDispatcherTypes = false
151+
// ...
152+
}
153+
}
154+
----
155+
======
156+
157+
In preparation for 7, change this to use `dispatcherTypeMatchers`:
158+
159+
[tabs]
160+
======
161+
Java::
162+
+
163+
[source,java,role="primary"]
164+
----
165+
http
166+
.authorizHttpRequests((authorize) -> authorize
167+
.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll()
168+
// ...
169+
)
170+
----
171+
172+
Kotlin::
173+
+
174+
[source,kotlin,role="secondary"]
175+
----
176+
http {
177+
authorizeHttpRequests {
178+
authorize(new DispatcherTypeRequestMatcher(DispatcherType.ERROR), permitAll())
179+
}
180+
}
181+
----
182+
======

0 commit comments

Comments
 (0)