1
Fork 0
mirror of https://github.com/RGBCube/agenix synced 2025-07-29 01:37:44 +00:00

feature: add -d/--decrypt option to decrypt a file to stdout

This commit is contained in:
muvlon 2023-02-21 02:15:37 +01:00 committed by Ryan Mulligan
parent 2d735d6518
commit 9cf1967039
3 changed files with 45 additions and 5 deletions

View file

@ -90,6 +90,11 @@ pkgs.nixosTest {
# user1 can edit a secret by piping in contents
system1.succeed(userDo("echo 'secret1234' | agenix -e passwordfile-user1.age"))
assert "secret1234" in system1.succeed(userDo("EDITOR=cat agenix -e passwordfile-user1.age"))
# and get it back out via --decrypt
assert "secret1234" in system1.succeed(userDo("agenix -d passwordfile-user1.age"))
# finally, the plain text should not linger around anywhere in the filesystem.
system1.fail("grep -r secret1234 /tmp")
'';
}