This whole thing was created because it's annoying for devs to set up Vault, but Vault is an Ops process, not a Dev process. Just use environment variables and let Ops take care of exporting them via a credential management system. Coding a specific credential management system into your app is a bad idea.
Thanks, you raise a good point. To be clear, EnvKey is completely based around environment variables, so you won't need any EnvKey-specific code in your app apart from a line or two to install/import the package. In code, config is accessed in the same way as local environment variables. For example, with python, it's just: $ pip install envkey # in main.py (the entrypoint of your app) import envkey # anywhere else i…
import envkey # Fetches and install environment
In Python at least, that feels a bit icky. Modules can run complex code at import time, but it's rarely done.The import order between modules is often not specified or carefully maintained, and web projects can have many main entry points. For example, a Django app might start from "wsgi.py" if run in a web server, from "manage.py" when running command-line utility scripts or tests, or from any other script file at all if a few setup lines are added.
People prefer to put all imports at the top of the file, but may want to do something right before or after envkey runs. Imports are not supposed to fail or throw exceptions, unless there is a serious code bug.
It would be nicer to have
import envkey # No important side-effects
envkey.setup() # Can be placed at the appropriate place
or similar.