Refresh token when connectin to saas#1848
Conversation
WalkthroughThe constructor of Changes
Sequence Diagram(s)sequenceDiagram
participant ConfigLoader
participant RobustaSink
participant ActionRequestReceiver
participant DAL
ConfigLoader->>RobustaSink: Get RobustaSink instance
ConfigLoader->>ActionRequestReceiver: Instantiate with (event_handler, robusta_sink)
ActionRequestReceiver->>RobustaSink: On WebSocket open, access dal
ActionRequestReceiver->>DAL: get_session_token()
DAL-->>ActionRequestReceiver: Return session token
ActionRequestReceiver->>WebSocket: Authenticate using session token
Possibly related PRs
Suggested reviewers
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/robusta/integrations/receiver.py (1)
287-297: Session token fetched lazily – good, but avoid accidental loggingNice move to refresh the token on every
on_open.
Minor nit: be sure thistokennever sneaks into any future debug/trace log lines. At the moment onlyaccount_id/cluster_nameare logged – keep it that way.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/robusta/integrations/receiver.py(2 hunks)src/robusta/runner/config_loader.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/robusta/integrations/receiver.py (4)
src/robusta/core/playbooks/playbooks_event_handler.py (2)
PlaybooksEventHandler(11-83)get_global_config(50-52)src/robusta/core/sinks/robusta/robusta_sink.py (1)
get_global_config(644-645)src/robusta/core/playbooks/playbooks_event_handler_impl.py (1)
get_global_config(334-335)src/robusta/core/sinks/robusta/dal/supabase_dal.py (1)
get_session_token(765-772)
🪛 Ruff (0.11.9)
src/robusta/integrations/receiver.py
79-79: Undefined name RobustaSink
(F821)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: run_tests
- GitHub Check: run_tests
- GitHub Check: Deploy docs
No description provided.