diff --git a/requirements.txt b/requirements.txt index 1c6175044..f2124af1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ SQLAlchemy-Utils==0.30.5 Flask-WTF==0.11 Flask-Login==0.2.11 Flask-Bcrypt==0.6.2 +credstash==1.8.0 git+https://github.com/alphagov/notify-api-client.git@0.1.4#egg=notify-api-client==0.1.4 diff --git a/wsgi.py b/wsgi.py index 0b647461e..9aea43f28 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,7 +1,14 @@ from app import create_app import os +from credstash import getAllSecrets -application = create_app(os.getenv('NOTIFICATIONS_ADMIN_ENVIRONMENT') or 'development') +secrets = getAllSecrets(region="eu-west-1") + +application = create_app(os.getenv('NOTIFICATIONS_ADMIN_ENVIRONMENT') or 'live') + +for key in application.config.keys(): + if key in secrets: + application.config[key] = secrets[key] if __name__ == "__main__": application.run()