Shopify / ejson

EJSON is a small library to manage encrypted secrets using asymmetric encryption.
MIT License
1.34k stars 62 forks source link

Flag to read private key from STDIN #43

Closed stevehodgkiss closed 7 years ago

stevehodgkiss commented 7 years ago

Removes the need to write the private key to decrypt an EJSON file.

Background: https://github.com/Shopify/ejson/pull/41

burke commented 7 years ago

Sorry to ask for yet another revision, but I think the API I'd actually like here is:

echo 1234deadbeefcafe | ejson decrypt --key-from-stdin secrets.ejson

Would that be suitable for your needs? I think it would only be ~4 lines more code.

IIn either case, I'd make it a local option, but I don't have an extremely strong opinion. --keydir is global because it feels like it could be relevant to multiple commands, whereas passing a --private-key is specifically modifying the operation of the decryption.

stevehodgkiss commented 7 years ago

Yep, reading from stdin will work too. I prefer that approach actually.

burke commented 7 years ago

Sorry for the huge delay, I got wrapped up in a project and ignored github for a bit. Looks good at a glance; I'll take a closer look and probably merge later today.

stevehodgkiss commented 7 years ago

@burke no worries. I've addressed your feedback.