Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read configurations from arbitrary directories #309

Closed
ddobrin opened this issue Oct 16, 2018 · 4 comments
Closed

Read configurations from arbitrary directories #309

ddobrin opened this issue Oct 16, 2018 · 4 comments
Assignees
Labels
enhancement Issue: Enhancement

Comments

@ddobrin
Copy link
Contributor

ddobrin commented Oct 16, 2018

The Config class offers very convenient methods to load config files in yml or json formats.

The are predicated on being available in the "light-4j-config-dir", which is specified at startup as usually with a "-D".

The Config.loadMapConfig(String fileName) could be overloaded with a directory location as:
Config.loadMapConfig(String fileName, String directoryName).

It would be useful for :

  • tools as the networknt:light-bot project for loading config files from multiple locations
  • specifying configurations in multiple folders, in addition to the standard /src/main/resources/config
@DSchrupert
Copy link
Member

@ddobrin @stevehu Is there an rfc for this?

@ddobrin
Copy link
Contributor Author

ddobrin commented Feb 4, 2019

networknt/light-rfcs#11

@stevehu stevehu added the help wanted Issue: Help Wanted label Feb 5, 2019
@ddobrin
Copy link
Contributor Author

ddobrin commented Feb 6, 2019

RFC has been split into 3 smaller RFCs, by problem area.
It can be found here:
networknt/light-rfcs#15

@jiachen1120 jiachen1120 self-assigned this Feb 11, 2019
@DSchrupert DSchrupert removed the help wanted Issue: Help Wanted label Feb 11, 2019
stevehu pushed a commit that referenced this issue Feb 14, 2019
* - Allowed exclusion list of files which should not check/allow values injection

* - Rename the exclusions.yml to config.yml

* - Remove the extensions from config.yml

* Reducing some duplication in Config.java for potential future changes and adding a couple test cases to the CentralizedManagement class

* - Added typeCast method to cast environment variables and default value
- trim the default value
- Added tests for type cast
- Added test for exclusion injection
- Since the mergeMap is merge the map in place, I deleted the return

* merge different with develop

* - Added comments

* - Change comments

* - Supported absolute path for the config file in Config module

* - Supported reading configurations from arbitrary directories by overloading method

* - Added comments

* - Set same property for all test to eliminate conflicts caused by singleton

* - use reflection to inject field in ConfigPropertyPathTest

* - Improved the boolean casting
@stevehu
Copy link
Contributor

stevehu commented Feb 16, 2019

@stevehu stevehu closed this as completed Feb 16, 2019
younggwon1 pushed a commit to younggwon1/light-4j that referenced this issue Feb 10, 2024
)

* - Allowed exclusion list of files which should not check/allow values injection

* - Rename the exclusions.yml to config.yml

* - Remove the extensions from config.yml

* Reducing some duplication in Config.java for potential future changes and adding a couple test cases to the CentralizedManagement class

* - Added typeCast method to cast environment variables and default value
- trim the default value
- Added tests for type cast
- Added test for exclusion injection
- Since the mergeMap is merge the map in place, I deleted the return

* merge different with develop

* - Added comments

* - Change comments

* - Supported absolute path for the config file in Config module

* - Supported reading configurations from arbitrary directories by overloading method

* - Added comments

* - Set same property for all test to eliminate conflicts caused by singleton

* - use reflection to inject field in ConfigPropertyPathTest

* - Improved the boolean casting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue: Enhancement
Projects
None yet
Development

No branches or pull requests

5 participants