ruma::state_res::event_auth

Function auth_check

Source
pub fn auth_check<E>(
    room_version: &RoomVersion,
    incoming_event: impl Event,
    current_third_party_invite: Option<impl Event>,
    fetch_state: impl Fn(&StateEventType, &str) -> Option<E>,
) -> Result<bool, Error>
where E: Event,
Available on crate feature state-res only.
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.