Function ruma_state_res::event_auth::auth_check[][src]

pub fn auth_check<E: Event>(
    room_version: &RoomVersion,
    incoming_event: &Arc<E>,
    prev_event: Option<Arc<E>>,
    auth_events: &StateMap<Arc<E>>,
    current_third_party_invite: Option<Arc<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
  • check that the events signatures are valid
  • then there are checks for specific event types

The auth_events that are passed to this function should be a state snapshot. We need to know if the event passes auth against some state not a recursive collection of auth_events fields.


This returns an Error only when serialization fails or some other fatal outcome.