You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/servlet/integrations/websocket.adoc
+72Lines changed: 72 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,78 @@ This will ensure that:
205
205
<5> Any other message of type MESSAGE or SUBSCRIBE is rejected. Due to 6 we do not need this step, but it illustrates how one can match on specific message types.
206
206
<6> Any other Message is rejected. This is a good idea to ensure that you do not miss any messages.
207
207
208
+
[[migrating-spel-expressions]]
209
+
=== Migrating SpEL Expressions
210
+
211
+
If you are migrating from an older version of Spring Security, your destination matchers may include SpEL expressions.
212
+
It's recommended that these be changed to using concrete implementations of `AuthorizationManager` since this is independently testable.
213
+
214
+
However, to ease migration, you can also use a class like the following:
215
+
216
+
[source,java]
217
+
----
218
+
public final class MessageExpressionAuthorizationManager implements AuthorizationManager<MessageAuthorizationContext<?>> {
219
+
220
+
private SecurityExpressionHandler<Message<?>> expressionHandler = new DefaultMessageSecurityExpressionHandler();
221
+
222
+
private Expression expression;
223
+
224
+
public MessageExpressionAuthorizationManager(String expressionString) {
225
+
Assert.hasText(expressionString, "expressionString cannot be empty");
0 commit comments