Move event contents into third_party_layout field

This commit is contained in:
Daniel Wagner-Hall 2015-10-13 15:48:12 +01:00
parent 32a453d7ba
commit 17dffef5ec
7 changed files with 35 additions and 21 deletions

View file

@ -42,6 +42,12 @@ class ThirdPartyInvites(object):
return False
return True
@classmethod
def join_has_third_party_invite(cls, content):
if "third_party_invite" not in content:
return False
return cls.has_join_keys(content["third_party_invite"])
@classmethod
def copy_join_keys(cls, src, dst):
for key in cls.JOIN_KEYS:
@ -53,8 +59,8 @@ class ThirdPartyInvites(object):
def check_key_valid(cls, http_client, event):
try:
response = yield http_client.get_json(
event.content["key_validity_url"],
{"public_key": event.content["public_key"]}
event.content["third_party_invite"]["key_validity_url"],
{"public_key": event.content["third_party_invite"]["public_key"]}
)
if not response["valid"]:
raise AuthError(403, "Third party certificate was invalid")