File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
main/java/info/unterrainer/websocketserver
test/java/info/unterrainer/websocketserver Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1010
1111 <modelVersion >4.0.0</modelVersion >
1212 <artifactId >websocket-server</artifactId >
13- <version >1.0.17 </version >
13+ <version >1.0.18 </version >
1414 <name >WebsocketServer</name >
1515 <packaging >jar</packaging >
1616
3838 <dependency >
3939 <groupId >info.unterrainer.commons</groupId >
4040 <artifactId >oauth-token-manager</artifactId >
41- <version >1.0.10 </version >
41+ <version >1.0.11 </version >
4242 </dependency >
4343 </dependencies >
4444
Original file line number Diff line number Diff line change @@ -136,12 +136,12 @@ public final void onMessage(WsMessageContext ctx) throws Exception {
136136 String tenantId = tokenHandler .checkAccess (ctx .message ());
137137 tenantIdsBySession .put (ctx .session , tenantId );
138138 WsConnectContext client = getQuarantinedClient (ctx .session );
139- log .debug ("(" + name + ") Client [{}] passed token validation. Moving from quarantine to connected." ,
140- ctx .session .getRemoteAddress ());
141139 clientsQuarantined .removeIf (c -> c .session .equals (ctx .session ));
142140 clientsConnected .add (client );
141+ log .debug ("(" + name + ") Client [{}] passed token validation. Moving from quarantine to connected." ,
142+ ctx .session .getRemoteAddress ());
143143 return ;
144- } catch (Exception e ) {
144+ } catch (Throwable e ) {
145145 log .debug ("(" + name + ") Token validation failed for client [{}]. Disconnecting." ,
146146 ctx .session .getRemoteAddress (), e );
147147 ctx .session .close (1000 , "(" + name + ") Unauthorized access with invalid token" );
Original file line number Diff line number Diff line change 77@ Slf4j
88public class AiComm extends WsOauthHandlerBase {
99
10+ public AiComm (String name ) {
11+ super (name );
12+ }
13+
1014 @ Override
1115 public void onMsg (WsMessageContext ctx ) throws Exception {
1216 super .onMsg (ctx );
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ public static void main(String[] args) {
66 WebsocketServer server = new WebsocketServer ("https://keycloak.lan.elite-zettl.at" , "Cms" );
77 AiComm aiComm ;
88
9- aiComm = new AiComm ();
9+ aiComm = new AiComm ("ai-comm-test" );
1010
1111 server .wsOauth ("/jwt" , aiComm );
1212 server .ws ("/ws" , ws -> {
You can’t perform that action at this time.
0 commit comments