@@ -76,14 +76,14 @@ class SlackActionsMessage(BaseModel):
7676
7777
7878class ActionRequestReceiver :
79- def __init__ (self , event_handler : PlaybooksEventHandler , auth_token : str ):
79+ def __init__ (self , event_handler : PlaybooksEventHandler , robusta_sink : "RobustaSink" ):
8080 self .event_handler = event_handler
8181 self .active = True
8282 self .account_id = self .event_handler .get_global_config ().get ("account_id" )
8383 self .cluster_name = self .event_handler .get_global_config ().get ("cluster_name" )
8484 self .auth_provider = AuthProvider ()
8585 self .healthy = False
86- self .auth_token = auth_token
86+ self .robusta_sink = robusta_sink
8787
8888 self .ws = websocket .WebSocketApp (
8989 WEBSOCKET_RELAY_ADDRESS ,
@@ -287,12 +287,13 @@ def on_error(self, ws, error):
287287 def on_open (self , ws ):
288288 account_id = self .event_handler .get_global_config ().get ("account_id" )
289289 cluster_name = self .event_handler .get_global_config ().get ("cluster_name" )
290+ token = self .robusta_sink .dal .get_session_token ()
290291 open_payload = {
291292 "action" : "auth" ,
292293 "account_id" : account_id ,
293294 "cluster_name" : cluster_name ,
294295 "version" : RUNNER_VERSION ,
295- "token" : self . auth_token ,
296+ "token" : token ,
296297 }
297298 logging .info (f"connecting to server as account_id={ account_id } ; cluster_name={ cluster_name } " )
298299 ws .send (json .dumps (open_payload ))
0 commit comments