mirror of
https://github.com/RGBCube/agenix
synced 2025-07-29 09:47:44 +00:00
feature: add -d/--decrypt option to decrypt a file to stdout
This commit is contained in:
parent
2d735d6518
commit
9cf1967039
3 changed files with 45 additions and 5 deletions
|
@ -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")
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue