Function ruma_state_res::event_auth::auth_check

source ยท
pub fn auth_check<E: Event>(
    room_version: &RoomVersion,
    incoming_event: impl Event,
    current_third_party_invite: Option<impl Event>,
    fetch_state: impl Fn(&StateEventType, &str) -> Option<E>
) -> Result<bool>
Expand description

Authenticate the incoming event.

The steps of authentication are:

  • check that the event is being authenticated for the correct room
  • then there are checks for specific event types

The fetch_state closure should gather state from a state snapshot. We need to know if the event passes auth against some state not a recursive collection of auth_events fields.