diff --git a/autopush/settings.py b/autopush/settings.py index f76b6d34..7c5126c9 100644 --- a/autopush/settings.py +++ b/autopush/settings.py @@ -86,7 +86,7 @@ def __init__(self, enable_cors=False, hello_timeout=0, bear_hash_key=None, - preflight_uaid="deadbeef00000000deadbeef000000000", + preflight_uaid="deadbeef00000000deadbeef00000000", ami_id=None, client_certs=None, ): diff --git a/autopush/web/message.py b/autopush/web/message.py index 8e2d67d8..749679e1 100644 --- a/autopush/web/message.py +++ b/autopush/web/message.py @@ -8,10 +8,7 @@ class MessageSchema(Schema): - uaid = fields.UUID() - channel_id = fields.UUID() - topic = fields.Str(allow_none=True) - message_id = fields.Str() + notification = fields.Raw() @pre_load def extract_data(self, req): @@ -32,10 +29,7 @@ def extract_data(self, req): except (InvalidToken, InvalidTokenException): raise InvalidRequest("Invalid message ID", status_code=400) - return dict(uaid=notif.uaid, - channel_id=notif.channel_id, - topic=notif.topic, - message_id=message_id) + return dict(notification=notif) class MessageHandler(BaseWebHandler): @@ -52,13 +46,7 @@ def delete(self, *args, **kwargs): """ - notif = WebPushNotification( - uaid=self.valid_input['uaid'], - channel_id=self.valid_input['channel_id'], - data=None, - ttl=None, - topic=self.valid_input['topic'], - message_id=self.valid_input['message_id']) + notif = self.valid_input['notification'] d = deferToThread(self.ap_settings.message.delete_message, notif) d.addCallback(self._delete_completed)