org.bidib.wizard.server.config.WebSocketSecurityConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-server Show documentation
Show all versions of bidibwizard-server Show documentation
jBiDiB BiDiB Wizard Server POM
package org.bidib.wizard.server.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;
@Configuration(proxyBeanMethods = false)
public class WebSocketSecurityConfig extends AbstractSecurityWebSocketMessageBrokerConfigurer {
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
messages
.nullDestMatcher().permitAll().simpDestMatchers("/**").permitAll().simpDestMatchers("/user/queue/errors")
.permitAll().simpDestMatchers("/admin/**").hasRole("ADMIN").anyMessage().authenticated();
}
@Override
protected boolean sameOriginDisabled() {
return true;
}
}