From 75bf29abc112cb39a22eb9bb73261ea84f4793b5 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Fri, 24 Feb 2023 14:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E7=94=A8=E6=88=B7=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=81=AB=E7=82=B9=E6=95=B0=E6=8D=AE=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 ---- .../config/WebSocketSecurityConfig.java | 25 ------------------- 2 files changed, 30 deletions(-) delete mode 100644 src/main/java/com/xkrs/common/config/WebSocketSecurityConfig.java diff --git a/pom.xml b/pom.xml index 4a08061..9de937c 100644 --- a/pom.xml +++ b/pom.xml @@ -62,11 +62,6 @@ org.springframework.security spring-security-messaging - - org.springframework.boot - spring-boot-starter-websocket - - org.springframework.boot spring-boot-devtools diff --git a/src/main/java/com/xkrs/common/config/WebSocketSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSocketSecurityConfig.java deleted file mode 100644 index 5ea9f85..0000000 --- a/src/main/java/com/xkrs/common/config/WebSocketSecurityConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xkrs.common.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; -import org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer; - -import static org.springframework.messaging.simp.SimpMessageType.MESSAGE; -import static org.springframework.messaging.simp.SimpMessageType.SUBSCRIBE; - - -/** - * @author xkrs - */ -@Configuration -public class WebSocketSecurityConfig extends AbstractSecurityWebSocketMessageBrokerConfigurer { - @Override - protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) { - messages - .nullDestMatcher().authenticated() - .simpSubscribeDestMatchers("/user/queue/errors").permitAll() - .simpTypeMatchers(MESSAGE, SUBSCRIBE).denyAll() - .anyMessage().denyAll(); - - } -} \ No newline at end of file