joker1007 / yaml_vault

Yaml file encryption/decryption helper.
MIT License
158 stars 20 forks source link

Support of key option for yaml including alias #10

Closed k2tzumi closed 7 years ago

k2tzumi commented 7 years ago

If yaml includes alias, encrypt it with the key option specified.

bundle exec yaml_vault encrypt plain.yml -o encrypted.yml -k 'foo'

https://github.com/joker1007/yaml_vault/blob/2e37a160c0cf8dc584c870beff7f0e1c9ef4bffc/lib/yaml_vault.rb#L24

In order to encrypt the specific key or less after expansion, places that don't want to be plain have been expanded. (Foo.x, foo.y are encrypted but bar.x, bar.y are not encrypted)

foo:
  x: encrypted-1
  y: encrypted-2
bar:
  x: encrypted-1
  y: encrypted-2
  z: 3
joker1007 commented 7 years ago

Thanks! I understand this case. But it is difficult. This feature needs Psyck low level interface and YAML AST Processing. I don't have enough time to implement it for now.