mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Merge pull request #1142 from alphagov/log-ip-block
log ip address as separate field to allow analysis of messages
This commit is contained in:
@@ -59,13 +59,16 @@ def restrict_ip_sms():
|
|||||||
if request.headers.get("X-Custom-forwarder"):
|
if request.headers.get("X-Custom-forwarder"):
|
||||||
current_app.logger.info("X-Custom-forwarder {}".format(request.headers.get("X-Custom-forwarder")))
|
current_app.logger.info("X-Custom-forwarder {}".format(request.headers.get("X-Custom-forwarder")))
|
||||||
|
|
||||||
if ip in current_app.config.get('SMS_INBOUND_WHITELIST'):
|
current_app.logger.info({
|
||||||
current_app.logger.info("Inbound sms ip addresses {} passed ".format(ip))
|
'message': 'Inbound sms ip address',
|
||||||
return
|
'log_contents': {
|
||||||
else:
|
'passed': ip in current_app.config.get('SMS_INBOUND_WHITELIST'),
|
||||||
current_app.logger.info("Inbound sms ip addresses blocked {}".format(ip))
|
'ip_address': ip
|
||||||
return
|
}
|
||||||
# raise AuthError('Unknown source IP address from the SMS provider', 403)
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
# raise AuthError('Unknown source IP address from the SMS provider', 403)
|
||||||
|
|
||||||
|
|
||||||
def requires_admin_auth():
|
def requires_admin_auth():
|
||||||
|
|||||||
Reference in New Issue
Block a user