mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Merge pull request #1284 from alphagov/vb-inbound-sms-ip
Inbound sms ip messages
This commit is contained in:
@@ -70,11 +70,6 @@ def restrict_ip_sms():
|
|||||||
for allowed_ip in allowed_ips
|
for allowed_ip in allowed_ips
|
||||||
)
|
)
|
||||||
|
|
||||||
if allowed:
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
raise AuthError('Unknown source IP address from the SMS provider', 403)
|
|
||||||
|
|
||||||
current_app.logger.info({
|
current_app.logger.info({
|
||||||
'message': 'Inbound sms ip address',
|
'message': 'Inbound sms ip address',
|
||||||
'log_contents': {
|
'log_contents': {
|
||||||
@@ -82,11 +77,12 @@ def restrict_ip_sms():
|
|||||||
'ip_address': inbound_ip
|
'ip_address': inbound_ip
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
|
||||||
|
|
||||||
current_app.logger.error('Traffic from unknown source or route, X-Forwarded-For="{}"'.format(
|
if allowed:
|
||||||
request.headers.get("X-Forwarded-For"))
|
return
|
||||||
)
|
else:
|
||||||
|
raise AuthError('Unknown source IP address from the SMS provider', 403)
|
||||||
|
|
||||||
raise AuthError('Traffic from unknown source or route', 403)
|
raise AuthError('Traffic from unknown source or route', 403)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user