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

Make env-config side-effects optional #86

Open
ajpauwels opened this issue Sep 12, 2021 · 1 comment
Open

Make env-config side-effects optional #86

ajpauwels opened this issue Sep 12, 2021 · 1 comment

Comments

@ajpauwels
Copy link

ajpauwels commented Sep 12, 2021

Currently, this library sources credentials for performing operations exclusively from env. Although this is convenient most of the time, it introduces two problems:

  • Side effects, any consuming binary or library now needs to support and document these environment variables even if completely unrelated to its own config management
  • Unable to inject config/credentials into the library, meaning it's impossible to perform config gathering ONCE at the beginning of the app, and then pass relevant config to subsystems; note that this also makes it impossible to hot-load a new config into the binary consuming this lib, it must be completely terminated and restarted.

As it stands, the library config is self-contained within the ServiceAccount struct after loading from env. Allowing for optional passing in of this struct on creation of the client should solve this issue. All downstream code would need to be updated to use this optional config over the globally-defined crate::SERVICE_ACCOUNT however.

@ThouCheese
Copy link
Owner

I believe that #73 would go a long way in resolving this, which I am hoping to merge soon. Is there something more you have in mind that what is being offered there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants