-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Corey Carvalho <[email protected]>
- Loading branch information
1 parent
ab3115f
commit b801ac2
Showing
14 changed files
with
387 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
import json | ||
import os | ||
|
||
ENP_DB_NAME = os.getenv('DB_NAME', 'va-enp-api-db') | ||
ENP_DB_READ_URI = os.getenv( | ||
'ENP_DB_READ_URI', 'postgresql+psycopg://postgres:LocalPassword@localhost:5433/va-enp-api-db' | ||
) | ||
ENP_DB_WRITE_URI = os.getenv( | ||
'ENP_DB_WRITE_URI', 'postgresql+psycopg://postgres:LocalPassword@localhost:5433/va-enp-api-db' | ||
) | ||
DB_ENGINE = 'postgresql+psycopg' | ||
|
||
ENP_DB_NAME = os.getenv('ENP_DB_NAME', 'va_enp_api') | ||
ENP_DB_PORT = os.getenv('ENP_DB_PORT', '5433') | ||
|
||
# These configs require a change in infra to be updated | ||
DB_AUTH = json.loads(os.getenv('DB_AUTH', '{"username": "postgres", "password": "LocalPassword"}')) | ||
DB_USERNAME = DB_AUTH['username'] | ||
DB_PASSWORD = DB_AUTH['password'] | ||
|
||
ENP_DB_HOSTNAME = os.getenv('DB_HOSTNAME', 'localhost') | ||
ENP_DB_HOSTNAME_READ = os.getenv('DB_HOSTNAME_READ', 'localhost') | ||
|
||
# get the notification api database URI | ||
NAPI_DB_READ_URI = os.getenv( | ||
'NAPI_DB_READ_URI', 'postgresql+psycopg://postgres:LocalPassword@localhost:5432/notification_api' | ||
'NAPI_DB_READ_URI', f'{DB_ENGINE}://postgres:LocalPassword@localhost:5432/notification_api' | ||
) | ||
NAPI_DB_WRITE_URI = os.getenv( | ||
'NAPI_DB_WRITE_URI', 'postgresql+psycopg://postgres:LocalPassword@localhost:5432/notification_api' | ||
'NAPI_DB_WRITE_URI', f'{DB_ENGINE}://postgres:LocalPassword@localhost:5432/notification_api' | ||
) | ||
|
||
# Ensure the correct DB_ENGINE is used. This is necessary when deployed. | ||
NAPI_DB_READ_URI = DB_ENGINE + '://' + NAPI_DB_READ_URI.split('://')[1] | ||
NAPI_DB_WRITE_URI = DB_ENGINE + '://' + NAPI_DB_WRITE_URI.split('://')[1] | ||
|
||
# Construct the ENP database URIs | ||
ENP_DB_READ_URI = f'{DB_ENGINE}://{DB_USERNAME}:{DB_PASSWORD}@{ENP_DB_HOSTNAME_READ}:{ENP_DB_PORT}/{ENP_DB_NAME}' | ||
ENP_DB_WRITE_URI = f'{DB_ENGINE}://{DB_USERNAME}:{DB_PASSWORD}@{ENP_DB_HOSTNAME}:{ENP_DB_PORT}/{ENP_DB_NAME}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ENP_ALGORITHM=HS256 | ||
ENP_ACCESS_TOKEN_EXPIRE_SECONDS=60 | ||
ENP_DB_NAME=va_enp_api | ||
ENP_DB_PORT=5433 | ||
MAX_RETRIES=2886 | ||
DB_NAME=va_enp_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ENP_ALGORITHM=HS256 | ||
ENP_ACCESS_TOKEN_EXPIRE_SECONDS=60 | ||
ENP_DB_NAME=va_enp_api | ||
ENP_DB_PORT=5433 | ||
MAX_RETRIES=2886 | ||
DB_NAME=va_enp_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
AWS_ACCESS_KEY_ID=test | ||
AWS_REGION_NAME=us-east-1 | ||
AWS_SECRET_ACCESS_KEY=test | ||
ENP_DB_NAME=va-enp-api-db | ||
NAPI_DB_READ_URI=postgresql+psycopg://postgres:[email protected]:5432/notification_api | ||
NAPI_DB_WRITE_URI=postgresql+psycopg://postgres:[email protected]:5432/notification_api | ||
ENP_DB_READ_URI=postgresql+psycopg://postgres:LocalPassword@enp-db:5432/va-enp-api-db | ||
ENP_DB_WRITE_URI=postgresql+psycopg://postgres:LocalPassword@enp-db:5432/va-enp-api-db | ||
DB_HOSTNAME=enp-db | ||
DB_HOSTNAME_READ=enp-db | ||
ENP_ADMIN_SECRET_KEY=not-very-secret | ||
ENV=local | ||
ENP_DB_NAME=va_enp_api | ||
ENP_DB_PORT=5432 | ||
ENV=local | ||
NAPI_DB_READ_URI=postgresql://postgres:[email protected]:5432/notification_api | ||
NAPI_DB_WRITE_URI=postgresql://postgres:[email protected]:5432/notification_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.