Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/robusta/integrations/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ class SlackActionsMessage(BaseModel):


class ActionRequestReceiver:
def __init__(self, event_handler: PlaybooksEventHandler, auth_token: str):
def __init__(self, event_handler: PlaybooksEventHandler, robusta_sink: "RobustaSink"):
self.event_handler = event_handler
self.active = True
self.account_id = self.event_handler.get_global_config().get("account_id")
self.cluster_name = self.event_handler.get_global_config().get("cluster_name")
self.auth_provider = AuthProvider()
self.healthy = False
self.auth_token = auth_token
self.robusta_sink = robusta_sink

self.ws = websocket.WebSocketApp(
Comment thread
moshemorad marked this conversation as resolved.
WEBSOCKET_RELAY_ADDRESS,
Expand Down Expand Up @@ -287,12 +287,13 @@ def on_error(self, ws, error):
def on_open(self, ws):
account_id = self.event_handler.get_global_config().get("account_id")
cluster_name = self.event_handler.get_global_config().get("cluster_name")
token = self.robusta_sink.dal.get_session_token()
open_payload = {
"action": "auth",
"account_id": account_id,
"cluster_name": cluster_name,
"version": RUNNER_VERSION,
"token": self.auth_token,
"token": token,
}
logging.info(f"connecting to server as account_id={account_id}; cluster_name={cluster_name}")
ws.send(json.dumps(open_payload))
Expand Down
3 changes: 1 addition & 2 deletions src/robusta/runner/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ def __create_receiver(self):
return

robusta_sink = robusta_sinks[0]
token = robusta_sink.dal.get_session_token()

receiver = ActionRequestReceiver(self.event_handler, token)
receiver = ActionRequestReceiver(self.event_handler, robusta_sink)
self.registry.set_receiver(receiver)
Comment thread
moshemorad marked this conversation as resolved.
return receiver

Expand Down
Loading