mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
add new performance-platform section to cf config
it's a new cf-service we've got to create, that contains endpoints and the bearer tokens for them.
This commit is contained in:
@@ -34,6 +34,8 @@ def set_config_env_vars(vcap_services):
|
||||
extract_firetext_config(s)
|
||||
elif s['name'] == 'redis':
|
||||
extract_redis_config(s)
|
||||
elif s['name'] == 'performance-platform':
|
||||
extract_performance_platform_config(s)
|
||||
|
||||
|
||||
def extract_notify_config(notify_config):
|
||||
@@ -42,10 +44,13 @@ def extract_notify_config(notify_config):
|
||||
os.environ['ADMIN_CLIENT_SECRET'] = notify_config['credentials']['admin_client_secret']
|
||||
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'] = json.dumps(notify_config['credentials']['allow_ip_inbound_sms'])
|
||||
|
||||
|
||||
def extract_performance_platform_config(performance_platform_config):
|
||||
os.environ['PERFORMANCE_PLATFORM_ENDPOINTS'] = json.dumps(performance_platform_config['credentials'])
|
||||
|
||||
|
||||
def extract_notify_aws_config(aws_config):
|
||||
os.environ['NOTIFICATION_QUEUE_PREFIX'] = aws_config['credentials']['sqs_queue_prefix']
|
||||
os.environ['AWS_ACCESS_KEY_ID'] = aws_config['credentials']['aws_access_key_id']
|
||||
|
||||
@@ -273,6 +273,10 @@ class Config(object):
|
||||
|
||||
SMS_INBOUND_WHITELIST = json.loads(os.environ.get('SMS_INBOUND_WHITELIST', '[]'))
|
||||
|
||||
# Format is as follows:
|
||||
# {"dataset_1": "token_1", ...}
|
||||
PERFORMANCE_PLATFORM_ENDPOINTS = json.loads(os.environ.get('PERFORMANCE_PLATFORM_ENDPOINTS', '{}'))
|
||||
|
||||
|
||||
######################
|
||||
# Config overrides ###
|
||||
|
||||
Reference in New Issue
Block a user