From 95e53ac53576de2980e8f7683b59f4fa7fce038b Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Tue, 13 Oct 2015 17:18:24 +0100 Subject: [PATCH] Add some docstring --- synapse/api/auth.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/synapse/api/auth.py b/synapse/api/auth.py index ca280707c5..c0762df567 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -374,6 +374,21 @@ class Auth(object): return True def _verify_third_party_invite(self, event, auth_events): + """ + Validates that the join event is authorized by a previous third-party invite. + + Checks that the public key, and keyserver, match those in the invite, + and that the join event has a signature issued using that public key. + + Args: + event: The m.room.member join event being validated. + auth_events: All relevant previous context events which may be used + for authorization decisions. + + Return: + True if the event fulfills the expectations of a previous third party + invite event. + """ if not ThirdPartyInvites.join_has_third_party_invite(event.content): return False join_third_party_invite = event.content["third_party_invite"]