From a35b04f5e73942c6a684ff05fe7c386590428f8a Mon Sep 17 00:00:00 2001 From: venusbb Date: Tue, 19 Dec 2017 15:00:51 +0000 Subject: [PATCH] Enable MMG inbound blocking --- app/notifications/receive_notifications.py | 4 ++-- tests/app/notifications/test_receive_notification.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/notifications/receive_notifications.py b/app/notifications/receive_notifications.py index c6bf80811..cd6eda598 100644 --- a/app/notifications/receive_notifications.py +++ b/app/notifications/receive_notifications.py @@ -34,11 +34,11 @@ def receive_mmg_sms(): if not auth: current_app.logger.warning("Inbound sms (MMG) no auth header") - # abort(401) + abort(401) elif auth.username not in current_app.config['MMG_INBOUND_SMS_USERNAME'] \ or auth.password not in current_app.config['MMG_INBOUND_SMS_AUTH']: current_app.logger.warning("Inbound sms (MMG) incorrect username ({}) or password".format(auth.username)) - # abort(403) + abort(403) inbound_number = strip_leading_forty_four(post_data['Number']) diff --git a/tests/app/notifications/test_receive_notification.py b/tests/app/notifications/test_receive_notification.py index 02898d564..1d8f662dd 100644 --- a/tests/app/notifications/test_receive_notification.py +++ b/tests/app/notifications/test_receive_notification.py @@ -430,7 +430,6 @@ def test_firetext_inbound_sms_auth(notify_db_session, notify_api, client, mocker ["", [], 401], ["testkey", [], 403], ]) -@pytest.mark.skip(reason="aborts are disabled at the moment") def test_mmg_inbound_sms_auth(notify_db_session, notify_api, client, mocker, auth, keys, status_code): mocker.patch("app.notifications.receive_notifications.tasks.send_inbound_sms_to_service.apply_async")