本文整理汇总了Java中org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry类的典型用法代码示例。如果您正苦于以下问题:Java MessageSecurityMetadataSourceRegistry类的具体用法?Java MessageSecurityMetadataSourceRegistry怎么用?Java MessageSecurityMetadataSourceRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageSecurityMetadataSourceRegistry类属于org.springframework.security.config.annotation.web.messaging包,在下文中一共展示了MessageSecurityMetadataSourceRegistry类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.simpTypeMatchers(SimpMessageType.CONNECT, SimpMessageType.HEARTBEAT, SimpMessageType.UNSUBSCRIBE, SimpMessageType.DISCONNECT).permitAll()
// matches any destination that starts with /rooms/
.simpDestMatchers(WS_API.QUEUE_DESTINATION_PREFIX + "**").authenticated()
.simpDestMatchers(WS_API.TOPIC_DESTINATION_PREFIX + "**").authenticated()
// (i.e. cannot send messages directly to /topic/, /queue/)
// (i.e. cannot subscribe to /topic/messages/* to get messages sent to
// /topic/messages-user<id>)
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).authenticated()
// catch all
.anyMessage().authenticated();
// https://github.com/jhipster/generator-jhipster/issues/1370
//.simpMessageDestMatchers("/queue/**", "/topic/**").denyAll()
//.simpSubscribeDestMatchers("/queue/**/*-user*", "/topic/**/*-user*").denyAll()
//.anyMessage().authenticated();
}
开发者ID:Pivopil,项目名称:spring-boot-oauth2-rest-service-password-encoding,代码行数:22,代码来源:WebSocketSecurityConfig.java
示例2: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
// message types other than MESSAGE and SUBSCRIBE
.nullDestMatcher().permitAll()
// matches any destination that starts with /rooms/
.simpMessageDestMatchers("/topic/player_commands").hasAuthority(AuthoritiesConstants.ADMIN)
.simpSubscribeDestMatchers("/topic/player_events").permitAll()
.simpMessageDestMatchers("/topic/vote_commands").authenticated()
.simpSubscribeDestMatchers("/topic/vote_events").permitAll()
// (i.e. cannot send messages directly to /topic/, /queue/)
// (i.e. cannot subscribe to /topic/messages/* to get messages sent to
// /topic/messages-user<id>)
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll()
// catch all
.anyMessage().denyAll();
}
示例3: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
// message types other than MESSAGE and SUBSCRIBE
.nullDestMatcher().authenticated()
// matches any destination that starts with /rooms/
.simpDestMatchers("/topic/tracker").hasAuthority(AuthoritiesConstants.ADMIN)
.simpDestMatchers("/topic/**").authenticated()
// (i.e. cannot send messages directly to /topic/, /queue/)
// (i.e. cannot subscribe to /topic/messages/* to get messages sent to
// /topic/messages-user<id>)
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll()
// catch all
.anyMessage().denyAll();
}
示例4: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.nullDestMatcher().authenticated()
.simpDestMatchers("/topic/tracker").hasAuthority(AuthoritiesConstants.ADMIN)
// matches any destination that starts with /topic/
// (i.e. cannot send messages directly to /topic/)
// (i.e. cannot subscribe to /topic/messages/* to get messages sent to
// /topic/messages-user<id>)
.simpDestMatchers("/topic/**").authenticated()
// message types other than MESSAGE and SUBSCRIBE
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll()
// catch all
.anyMessage().denyAll();
}
示例5: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.simpMessageDestMatchers("/queue/**", "/topic/**").denyAll()
.simpSubscribeDestMatchers("/queue/**/*-user*", "/topic/**/*-user*").denyAll()
.anyMessage().authenticated();
}
示例6: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages.simpMessageDestMatchers("/**").authenticated()
.simpSubscribeDestMatchers("/**").permitAll()
.anyMessage().authenticated()
;
}
示例7: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
// message types other than MESSAGE and SUBSCRIBE
.nullDestMatcher().authenticated()
// matches any destination that starts with /rooms/
.simpDestMatchers("/topic/**").authenticated()
// (i.e. cannot send messages directly to /topic/, /queue/)
// (i.e. cannot subscribe to /topic/messages/* to get messages sent to
// /topic/messages-user<id>)
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll()
// catch all
.anyMessage().denyAll();
}
示例8: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.nullDestMatcher().authenticated()
.simpDestMatchers("/topic/tracker").hasAuthority(AuthoritiesConstants.ADMIN)
.simpDestMatchers("/topic/**").authenticated()
.simpTypeMatchers(SimpMessageType.MESSAGE, SimpMessageType.SUBSCRIBE).denyAll()
.anyMessage().denyAll();
}
示例9: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
// Waiting on a response here: https://jira.spring.io/browse/SEC-2802
// messages
// .antMatchers(SimpMessageType.MESSAGE, "/user/queue/errors").permitAll()
// .antMatchers(SimpMessageType.MESSAGE, "/user/*").hasRole("USER")
// .antMatchers(SimpMessageType.MESSAGE, "/app/user/*").hasRole("USER")
// .anyMessage().permitAll();
}
示例10: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(final MessageSecurityMetadataSourceRegistry messages) {
messages.anyMessage().authenticated();
}
示例11: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages.simpDestMatchers("/**").permitAll();
}
示例12: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages.nullDestMatcher().authenticated()
.simpSubscribeDestMatchers("/logs").hasRole("ADMIN");
}
示例13: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(final MessageSecurityMetadataSourceRegistry messages) {
messages.anyMessage().permitAll();
}
示例14: configureInbound
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; //导入依赖的package包/类
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.simpMessageDestMatchers(Constants.WS_TOPIC_ACTIVITY_FEED_PATH, "/queue/*", "/app/queue/*").permitAll();
}