mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
don't store non-strings to os.environ
in tests, we were replacing os.environ with a basic dict so that we didn't overwrite the contents of the real environment during tests. However, os.environ doesn't accept non-str values, so this commit changes the fixture so that it asserts all values set are strings. We needed to change how we store ip whitelist stuff in the env because of this.
This commit is contained in:
@@ -43,7 +43,7 @@ def extract_notify_config(notify_config):
|
||||
os.environ['SECRET_KEY'] = notify_config['credentials']['secret_key']
|
||||
os.environ['DANGEROUS_SALT'] = notify_config['credentials']['dangerous_salt']
|
||||
os.environ['PERFORMANCE_PLATFORM_TOKEN'] = notify_config['credentials'].get('performance_platform_token', '')
|
||||
os.environ['SMS_INBOUND_WHITELIST'] = notify_config['credentials']['allow_ip_inbound_sms']
|
||||
os.environ['SMS_INBOUND_WHITELIST'] = json.dumps(notify_config['credentials']['allow_ip_inbound_sms'])
|
||||
|
||||
|
||||
def extract_notify_aws_config(aws_config):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from datetime import timedelta
|
||||
import os
|
||||
import json
|
||||
|
||||
from celery.schedules import crontab
|
||||
from kombu import Exchange, Queue
|
||||
@@ -262,7 +263,7 @@ class Config(object):
|
||||
|
||||
FREE_SMS_TIER_FRAGMENT_COUNT = 250000
|
||||
|
||||
SMS_INBOUND_WHITELIST = os.environ.get('SMS_INBOUND_WHITELIST', [])
|
||||
SMS_INBOUND_WHITELIST = json.loads(os.environ.get('SMS_INBOUND_WHITELIST', '[]'))
|
||||
|
||||
|
||||
######################
|
||||
|
||||
Reference in New Issue
Block a user