mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-18 08:02:31 -05:00
retrieve sms ip whitelist from credentials on paas
This commit is contained in:
@@ -313,8 +313,8 @@ def __create_token(service_id):
|
||||
def restrict_ip_sms_app():
|
||||
app = flask.Flask(__name__)
|
||||
app.config['TESTING'] = True
|
||||
app.config['ALLOW_IP_INBOUND_SMS'] = ['134.213.243.188']
|
||||
|
||||
app.config['ALLOW_IP_INBOUND_SMS'] = ['111.111.111.111', '100.100.100.100']
|
||||
# app.config['ALLOW_IP_INBOUND_SMS'] = os.environ['SMS_INBOUND_WHITELIST']
|
||||
blueprint = flask.Blueprint('restrict_ip_sms_app', __name__)
|
||||
|
||||
@blueprint.route('/')
|
||||
@@ -332,7 +332,7 @@ def test_allow_valid_ips(restrict_ip_sms_app):
|
||||
response = restrict_ip_sms_app.get(
|
||||
path='/',
|
||||
headers=[
|
||||
('X-Forwarded-For', '134.213.243.188, 222.222.222.222, 127.0.0.1'),
|
||||
('X-Forwarded-For', '111.111.111.111, 222.222.222.222, 127.0.0.1'),
|
||||
]
|
||||
)
|
||||
|
||||
@@ -345,7 +345,7 @@ def test_reject_invalid_ips(restrict_ip_sms_app):
|
||||
restrict_ip_sms_app.get(
|
||||
path='/',
|
||||
headers=[
|
||||
('X-Forwarded-For', '222.222.222.222, 111.111.111.111, 127.0.0.1')
|
||||
('X-Forwarded-For', '222.222.222.222, 333.333.333.333, 127.0.0.1')
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user