synapse/event_auth.py
def auth_types_for_event(event):
    """Given an event, return a list of (EventType, StateKey) that may be
    needed to auth the event. The returned list may be a superset of what
    would actually be required depending on the full state of the room.

    Used to limit the number of events to fetch from the database to
    actually auth the event.
    """
    if event.type == EventTypes.Create:
        return []

    auth_types = []

    auth_types.append((EventTypes.PowerLevels, "", ))
    auth_types.append((EventTypes.Member, event.user_id, ))
    auth_types.append((EventTypes.Create, "", ))

    if event.type == EventTypes.Member:
        membership = event.content["membership"]
        if membership in [Membership.JOIN, Membership.INVITE]:
            auth_types.append((EventTypes.JoinRules, "", ))

        auth_types.append((EventTypes.Member, event.state_key, ))

        if membership == Membership.INVITE:
            if "third_party_invite" in event.content:
                key = (
                    EventTypes.ThirdPartyInvite,
                    event.content["third_party_invite"]["signed"]["token"]
                )
                auth_types.append(key)

    return auth_types
Given an event, return a list of (EventType, StateKey) that may be
    needed to auth the event. The returned list may be a superset of what
    would actually be required depending on the full state of the room.

    Used to limit the number of events to fetch from the database to
    actually auth the event.
    
Given an event, return a list of (EventType, StateKey) that may be
needed to auth the event. The returned list may be a superset of what
would actually be required depending on the full state of the room.

Used to limit the number of events to fetch from the database to
actually auth the event.
Given an event return a list of ( EventType StateKey ) that may be needed to auth the event . The returned list may be a superset of what would actually be required depending on the full state of the room . Used to limit the number of events to fetch from the database to actually auth the event .
def auth_types_for_event(event):
    if event.type == EventTypes.Create:
        return []
    auth_types = []
    auth_types.append((EventTypes.PowerLevels, "", ))
    auth_types.append((EventTypes.Member, event.user_id, ))
    auth_types.append((EventTypes.Create, "", ))
    if event.type == EventTypes.Member:
        membership = event.content["membership"]
        if membership in [Membership.JOIN, Membership.INVITE]:
            auth_types.append((EventTypes.JoinRules, "", ))
        auth_types.append((EventTypes.Member, event.state_key, ))
        if membership == Membership.INVITE:
            if "third_party_invite" in event.content:
                key = (
                    EventTypes.ThirdPartyInvite,
                    event.content["third_party_invite"]["signed"]["token"]
                )
                auth_types.append(key)
    return auth_types
def auth_types_for_event ( event ) : if event . type == EventTypes . Create : return [ ] auth_types = [ ] auth_types . append ( ( EventTypes . PowerLevels , "" , ) ) auth_types . append ( ( EventTypes . Member , event . user_id , ) ) auth_types . append ( ( EventTypes . Create , "" , ) ) if event . type == EventTypes . Member : membership = event . content [ "membership" ] if membership in [ Membership . JOIN , Membership . INVITE ] : auth_types . append ( ( EventTypes . JoinRules , "" , ) ) auth_types . append ( ( EventTypes . Member , event . state_key , ) ) if membership == Membership . INVITE : if "third_party_invite" in event . content : key = ( EventTypes . ThirdPartyInvite , event . content [ "third_party_invite" ] [ "signed" ] [ "token" ] ) auth_types . append ( key ) return auth_types
Given an event, return a list of (EventType, StateKey) that may be
needed to auth the event.
Given an event return a list of ( EventType StateKey ) that may be needed to auth the event .
"""Given an event, return a list of (EventType, StateKey) that may be
    needed to auth the event. The returned list may be a superset of what
    would actually be required depending on the full state of the room.

    Used to limit the number of events to fetch from the database to
    actually auth the event.
    """
event