Skip to content

Commit

Permalink
sort the sample eventwebhook payload keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Harrison committed Jun 11, 2020
1 parent 71fc35c commit 6b6d5aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: venv install test-install test test-integ test-docker clean nopyc

venv:
venv: clean
@python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1);
virtualenv --python=python venv

Expand Down
6 changes: 4 additions & 2 deletions sendgrid/helpers/eventwebhook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from ellipticcurve.ecdsa import Ecdsa
from ellipticcurve.signature import Signature
from ellipticcurve.publicKey import PublicKey
from ellipticcurve.signature import Signature

class EventWebhook():

class EventWebhook:
"""
This class allows you to use the Event Webhook feature. Read the docs for
more details: https://sendgrid.com/docs/for-developers/tracking-events/event
"""

def __init__(self, public_key=None):
"""
Construct the Event Webhook verifier object
Expand Down
3 changes: 2 additions & 1 deletion test/test_eventwebhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from sendgrid import EventWebhook


class UnitTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand All @@ -13,7 +14,7 @@ def setUpClass(cls):
'event': 'test_event',
'category': 'example_payload',
'message_id': 'message_id',
}, separators=(',', ':'))
}, sort_keys=True, separators=(',', ':'))

def test_verify_valid_signature(self):
ew = EventWebhook()
Expand Down

0 comments on commit 6b6d5aa

Please sign in to comment.