feat: support loading secrets when only present in dotenv#1879
feat: support loading secrets when only present in dotenv#1879haddowg wants to merge 1 commit intobrefphp:masterfrom
Conversation
GrahamCampbell
left a comment
There was a problem hiding this comment.
I don't think this makes sense, as we explicitly wanted to throw the exception to let people know, instead of this silently failing. If we did want to change that behaviour, you'd also need to delete lines 30-34.
The suggested changes do not alter this behaviour, it will not silently fail, and will still throw an exception if the dependency is missing but you have a If the dependency is present it will load the secrets the If the dependency is missing and you have no |
|
Ah, I see. |
|
Probably we should add a test to validate this. |
Happy to, but not sure how practical that will be as the secret loader is a dev dependency currently. Could remove it and change the |
Please see the related PR on the secrets loader which adds support for defining secret env values in dotenv.
This change ensures we will always attempt to load secrets if the secret-loader is a dependency, as there may be no secret values (
bref-ssm:...) in the lambda directly but there may be some in a dotenv file.We keep the check for un-loaded secret values after the loader has run (if it was present) for cases where the dependency was missing or where the secret loading has somehow failed.