tellerops/teller

ENV should take precedence over configuration

romans-ovo opened this issue · 0 comments

A typical expected behaviour for any options would be:

  1. take from command-line arguments (if supported)
  2. take from ENV variables
  3. take from .config-files

Looking at this code however, it seems that there is a problem: https://github.com/tellerops/teller/blob/master/teller-providers/src/providers/hashicorp_vault.rs#L61

If options are provided in the configuration they would take precedence over ENV, but more importantly if you only specify ADDRESS as an option, it will not take TOKEN from the env.

I think this behaviour could be improved to look for the value in the environment and if not found, check the opts. I'm happy to provide PR.

While I noticed the problem in Vault provider, there may be similar behaviour elsewhere, I haven't checked.