mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
IP restriction for inbound sms test 2
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from flask import request, _request_ctx_stack, current_app, g
|
||||
from flask import jsonify
|
||||
from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
@@ -43,6 +44,16 @@ def requires_no_auth():
|
||||
pass
|
||||
|
||||
|
||||
def restrict_ip_sms():
|
||||
ip_addr = jsonify({'remote_addr': request.remote_addr,
|
||||
'X-Forwarded_FOR': request.headers.getlist('X-Forwarded-For'),
|
||||
'X_Real-Ip': request.headers.getlist('X-Real-Ip')})
|
||||
|
||||
current_app.logger.info("Inbound sms ip addresses = {}".format(ip_addr))
|
||||
|
||||
return
|
||||
|
||||
|
||||
def requires_admin_auth():
|
||||
auth_token = get_auth_token(request)
|
||||
client = __get_token_issuer(auth_token)
|
||||
|
||||
Reference in New Issue
Block a user