Skip to content

Commit 6947a73

Browse files
committed
feat: add a production environment config (wip)
1 parent 8d60de8 commit 6947a73

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,27 @@ Second, define the foreign key in the `foreignKeys` array:
186186
]
187187
}
188188
}
189-
```
189+
```
190+
191+
### Configuration Parameters
192+
193+
RELATIVE_PATH
194+
ABSOLUTE_PATH
195+
ROOT_PATH
196+
MIGRATION_HOME
197+
DATA_RESOURCE_SLEEP_INTERVAL
198+
DATA_MODEL_SLEEP_INTERVAL
199+
SQLALCHEMY_TRACK_MODIFICATIONS
200+
PROPAGATE_EXCEPTIONS
201+
POSTGRES_USER
202+
POSTGRES_PASSWORD
203+
POSTGRES_DATABASE
204+
POSTGRES_HOSTNAME
205+
POSTGRES_PORT
206+
SQLALCHEMY_DATABASE_URI
207+
OAUTH2_PROVIDER
208+
OAUTH2_URL
209+
OAUTH2_JWKS_URL
210+
OAUTH2_AUDIENCE
211+
OAUTH2_ALGORITHMS
212+
SECRET_MANAGER

data_resource_api/config/configuration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class Config(object):
5656
OAUTH2_AUDIENCE = os.getenv('OAUTH2_AUDIENCE', 'http://localhost:8000')
5757
OAUTH2_ALGORITHMS = ['RS256']
5858

59+
# Secret Manager
60+
SECRET_MANAGER = None
61+
5962
@staticmethod
6063
def get_oauth2_provider():
6164
"""Retrieve the OAuth 2.0 Provider.
@@ -144,6 +147,12 @@ class ProductionConfig(Config):
144147
def __init__(self):
145148
super().__init__()
146149

150+
SECRET_MANAGER = os.getenv('SECRET_MANAGER', 'environment').upper()
151+
if SECRET_MANAGER == 'ENVIRONMENT':
152+
print('Pulling from environment')
153+
elif SECRET_MANAGER == 'SSM':
154+
print('AWS has our secrets')
155+
147156

148157
class ConfigurationFactory(object):
149158
"""A factory for handling configuration object creation.

0 commit comments

Comments
 (0)