You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great piece of software. Is there any chance that you allow direct ruby calls to read+decrypt eyaml file (like YAML::load) and/or to encrypt/decript strings via function call? Would be great if we could benefit from your work not only while using hiera
The text was updated successfully, but these errors were encountered:
Hi @marek-obuchowicz, that's an interesting request. Theoretically yes that's fine, it would be good to ensure it's all modular anyway so that the encryption stuff is all isolated and the interaction with hiera is just the "presentation" layer, but we'd have to make sure all the keys and options etc are handled in a nice way for both hiera setups and direct ruby usage.
I'm working on refactoring a lot of the options handling and behind the scenes stuff so I'll bear this request in mind as I'm working on it.
Until this issue can be solved in a more straight forward manner, I'm using something similar to this snippet:
I think its only benefit is not having to go through the shell, but YMMV.
require'hiera/backend/eyaml/options'require'hiera/backend/eyaml/subcommands/encrypt'defload_public_key(public_key_file)raise"eyaml public key file not found / readable: #{public_key_file}"unlessFile.readable?public_key_fileHiera::Backend::Eyaml::Options['pkcs7_public_key']=public_key_fileenddefencrypt_string(input,public_key='./keys/public_key.pkcs7.pem')load_public_keypublic_keyHiera::Backend::Eyaml::Options[:source]='string'Hiera::Backend::Eyaml::Options[:input_data]=inputoutput=Hiera::Backend::Eyaml::Subcommands::Encrypt.executeoutput.chompend
Guys,
Great piece of software. Is there any chance that you allow direct ruby calls to read+decrypt eyaml file (like YAML::load) and/or to encrypt/decript strings via function call? Would be great if we could benefit from your work not only while using hiera
The text was updated successfully, but these errors were encountered: