-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Replace first |
operator in secrets functions with ||
#277
Comments
Suggestion: with this change, could it also support |
What is the use case the above might be needed? |
Just did a bit of experimenting; I actually misunderstood how the chain in that example works when I first saw it - I was missing the fact that the OR part generated a new secret if it didn't already exist. For this sort of example, where you have one secret derived from another, if you delete the backing secret for password, then recompile, password will get a new secret, but password_sha256 will still be the hash of the old one. You now have a derivation relationship, such that you have to remember to delete the derived secret as well, when what I think I'd want is for the derivation function to just be applied to the revealed source secret at reveal time, and not generate its own secret. (But as I just discovered, I'm probably missing some subtlety here.) |
@nikkomega yes that I exactly how it works and it does suffer from that limitation. You'll need to delete derived secrets as they are only recreated if not existent. |
Fix issue #277: Change first '|' operator in secrets functions with '||'
Currently as discussed in #131 the first
|
operator in secrets is semantically different than the rest of then.Given
${<ref_type>:<file_path>:<hash_digest>|<func_str|func2|func3>}
the first operator checks if the filepath exists, and only executes func_str/2/3 etc if that file doesn't exist. The other operators after that are always executed if the first check passes.
This isn't clear in the secrets reference structure.
Something like
${<ref_type>:<file_path>:<hash_digest>||<func_str|func2|func3>}
would make it easier to understand and would act like a logicalOR
operator (as it currently does).This is a breaking change, so extra attention needs to be paid either on communicating it or making it work in the interim.
The text was updated successfully, but these errors were encountered: