Skip to content

Commit 00a6374

Browse files
Temporary opened the websocket
1 parent 7099429 commit 00a6374

File tree

2 files changed

+43
-51
lines changed

2 files changed

+43
-51
lines changed

src/main/java/org/spacehub/configuration/SecurityConfiguration.java

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,25 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
6565
.cors(withDefaults())
6666
.csrf(AbstractHttpConfigurer::disable)
6767
.authorizeHttpRequests(auth -> auth
68-
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
69-
.requestMatchers(
70-
// "/ws-messages/**",
71-
// "/api/v1/voice-room/**",
72-
// "/api/v1/**",
73-
// "/api/**",
74-
// "/ws/**",
75-
// "/swagger-ui/**",
76-
// "/v3/api-docs/**",
77-
// "/v3/api-docs.yaml",
78-
// "/chat",
79-
// "/chat/**",
80-
// "/files/**",
81-
// "/notification/**",
82-
// "/wss/**"
83-
"/api/v1/login",
84-
"/api/v1/registration",
85-
"/api/v1/validateregisterotp",
86-
"/api/v1/forgotpassword",
87-
"/api/v1/validateforgototp",
88-
"/api/v1/resetpassword",
89-
"/api/v1/resendotp",
90-
"/api/v1/resendforgototp",
91-
"/swagger-ui/**",
92-
"/v3/api-docs/**"
93-
).permitAll()
94-
.anyRequest().authenticated()
68+
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
69+
.requestMatchers(
70+
"/api/v1/login",
71+
"/api/v1/registration",
72+
"/api/v1/validateregisterotp",
73+
"/api/v1/forgotpassword",
74+
"/api/v1/validateforgototp",
75+
"/api/v1/resetpassword",
76+
"/api/v1/resendotp",
77+
"/api/v1/resendforgototp",
78+
"/swagger-ui/**",
79+
"/v3/api-docs/**",
80+
"/chat",
81+
"/chat/**",
82+
"/ws/**",
83+
"/ws/direct-chat",
84+
"/notifications"
85+
).permitAll()
86+
.anyRequest().authenticated()
9587
)
9688
.httpBasic(AbstractHttpConfigurer::disable)
9789
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
package org.spacehub.configuration.webSocket;
2-
3-
4-
import org.springframework.context.annotation.Configuration;
5-
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
6-
import org.springframework.web.socket.config.annotation.*;
7-
8-
@Configuration
9-
@EnableWebSocketMessageBroker
10-
public class WebSocketConfigFriend implements WebSocketMessageBrokerConfigurer{
11-
12-
@Override
13-
public void configureMessageBroker(MessageBrokerRegistry registry) {
14-
registry.enableSimpleBroker("/topic", "/queue");
15-
registry.setApplicationDestinationPrefixes("/app");
16-
registry.setUserDestinationPrefix("/user");
17-
}
18-
19-
@Override
20-
public void registerStompEndpoints(StompEndpointRegistry registry) {
21-
registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS();
22-
}
23-
24-
}
1+
//package org.spacehub.configuration.webSocket;
2+
//
3+
//
4+
//import org.springframework.context.annotation.Configuration;
5+
//import org.springframework.messaging.simp.config.MessageBrokerRegistry;
6+
//import org.springframework.web.socket.config.annotation.*;
7+
//
8+
//@Configuration
9+
//@EnableWebSocketMessageBroker
10+
//public class WebSocketConfigFriend implements WebSocketMessageBrokerConfigurer{
11+
//
12+
// @Override
13+
// public void configureMessageBroker(MessageBrokerRegistry registry) {
14+
// registry.enableSimpleBroker("/topic", "/queue");
15+
// registry.setApplicationDestinationPrefixes("/app");
16+
// registry.setUserDestinationPrefix("/user");
17+
// }
18+
//
19+
// @Override
20+
// public void registerStompEndpoints(StompEndpointRegistry registry) {
21+
// registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS();
22+
// }
23+
//
24+
//}

0 commit comments

Comments
 (0)