Skip to content

Commit b4974bb

Browse files
committed
Polish Message Security Preparation Steps
- Added step to declare the 5.8 default in case later preparation steps cannot be taken yet Issue gh-11337
1 parent 31a1486 commit b4974bb

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/modules/ROOT/pages/migration.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,38 @@ If after moving to either you see ``AnnotationConfigurationException``s in your
216216

217217
xref:servlet/integrations/websocket.adoc[Message Security] has been xref:servlet/integrations/websocket.adoc#websocket-configuration[improved] through {security-api-url}org/springframework/security/authorization/AuthorizationManager.html[the `AuthorizationManager` API] and direct use of Spring AOP.
218218

219+
==== Declare the 5.8 default
220+
221+
In case you run into trouble with the ensuing steps and cannot use `AuthorizationManager` at this time, it's recommended as a first step to declare you are using the 5.8 default so that 5.8 behavior is preserved when you update.
222+
223+
The only default to change for Method Security is if you are using `<websocket-message-broker>` in which case you will change:
224+
225+
====
226+
.Xml
227+
[source,xml,role="secondary"]
228+
----
229+
<websocket-message-broker>
230+
<intercept-message pattern="/user/queue/errors" access="permitAll"/>
231+
<intercept-message pattern="/admin/**" access="hasRole('ADMIN')"/>
232+
</websocket-message-broker>
233+
----
234+
====
235+
236+
to:
237+
238+
====
239+
.Xml
240+
[source,xml,role="secondary"]
241+
----
242+
<websocket-message-broker use-authorization-manager="false">
243+
<intercept-message pattern="/user/queue/errors" access="permitAll"/>
244+
<intercept-message pattern="/admin/**" access="hasRole('ADMIN')"/>
245+
</websocket-message-broker>
246+
----
247+
====
248+
249+
Later steps will turn this value back on, but now your code is minimally ready for upgrading in case you run into trouble with the remaining steps.
250+
219251
==== Ensure all messages have defined authorization rules
220252

221253
The now-deprecated {security-api-url}org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.html[message security support] permits all messages by default.

0 commit comments

Comments
 (0)