mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-20 01:21:49 -05:00
Merge pull request #1511 from alphagov/vb-turn-on-mmg-blocking
Enable MMG inbound sms blocking based on bearer tokens
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user