Skip to main content

parse_socket_frame

Function parse_socket_frame 

Source
pub fn parse_socket_frame(envelope: &Value) -> SlackInboundEvent
Expand description

Parse a top-level Socket Mode envelope (the WS text frame’s JSON) into a SlackInboundEvent. This is the SINGLE wire-parse entry point the real Socket Mode loop and the tests share: it routes by the envelope type (interactive → block_actions; events_api → message.im) and yields SlackInboundEvent::Ignore for everything else (the bot’s own echo, a non-DM channel message, an unknown action, a hello/disconnect frame).

The closed-set output is the MC-6 anti-injection boundary BY CONSTRUCTION: a hostile envelope — even one whose DM body is literally a config-mutation payload — can only ever produce a ButtonInteraction, a PairingDm, or Ignore. There is NO arm that manufactures a config mutation.