Function ruma::state_res::auth_check[][src]

pub fn auth_check<E>(
    room_version: &RoomVersion,
    incoming_event: &Arc<E>,
    prev_event: Option<Arc<E>>,
    auth_events: &BTreeMap<(EventType, String), Arc<E>>,
    current_third_party_invite: Option<Arc<E>>
) -> Result<bool, Error> where
    E: Event
This is supported 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
  • 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.

Returns

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