This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Allow use of environment variables as an alternative to database credentials in application.properties #15
Merged
Conversation
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
|
TomAlard
reviewed
Feb 24, 2022
Could you add some comments to the code? |
|
I thought this would be a problem for tests, but as discussed in 'Meeting 2' this code works fine with tests. |
MaartenS11
force-pushed
the
env_variable_credentials
branch
from
February 28, 2022 08:36
2e7e167
to
85a7737
Compare
TomAlard
previously approved these changes
Feb 28, 2022
Nyxes5
previously approved these changes
Feb 28, 2022
backend/src/main/kotlin/be/osoc/team1/backend/DataSourceConfig.kt
Outdated
Show resolved
Hide resolved
backend/src/main/kotlin/be/osoc/team1/backend/DataSourceConfig.kt
Outdated
Show resolved
Hide resolved
backend/src/main/kotlin/be/osoc/team1/backend/DataSourceConfig.kt
Outdated
Show resolved
Hide resolved
This commit allows getting the password, username and/or url for the database from the respective OSOC_DB_PASSWORD, OSOC_DB_USERNAME and OSOC_DB_URL env variables if they are set. In the case that they are not set default values from the "application.properties" file will be used just like before this commit. Implementation details: The "application.properties" file is loaded lazily into the applicationProperties field when it is needed and reused if any other env variables were not set.
MaartenS11
force-pushed
the
env_variable_credentials
branch
from
February 28, 2022 17:07
85a7737
to
18590b7
Compare
Nyxes5
approved these changes
Feb 28, 2022
TomAlard
approved these changes
Feb 28, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows getting the password, username and/or url for the database from the respective
OSOC_DB_PASSWORD
,OSOC_DB_USERNAME
andOSOC_DB_URL
env variables if they are set. In the case that they are not set default values from theapplication.properties
file will be used just like before this merge request.