config flag for turning off inbound SMS replies

This commit is contained in:
jimmoffet
2022-10-07 17:25:31 -07:00
parent 97aa118fee
commit 863dfe39ba
2 changed files with 9 additions and 0 deletions

View File

@@ -113,6 +113,9 @@ class Config(object):
# Firetext API Key
FIRETEXT_API_KEY = os.environ.get("FIRETEXT_API_KEY", "placeholder")
FIRETEXT_INTERNATIONAL_API_KEY = os.environ.get("FIRETEXT_INTERNATIONAL_API_KEY", "placeholder")
# Whether to ignore POSTs from SNS for replies to SMS we sent
RECEIVE_INBOUND_SMS = False
# Use notify.sandbox.10x sending domain unless overwritten by environment
NOTIFY_EMAIL_DOMAIN = 'notify.sandbox.10x.gsa.gov'

View File

@@ -38,6 +38,12 @@ def receive_sns_sms():
}
"""
# Whether or not to ignore inbound SMS replies
if not current_app.config['RECEIVE_INBOUND_SMS']:
return jsonify(
result="success", message="SMS-SNS callback succeeded"
), 200
try:
post_data = sns_notification_handler(request.data, request.headers)
except Exception as e: