UX: non-existent identities aren't completely ignored
What were you trying to do / what happened
$ rage --version
rage 0.7.1
$ rage -i /non-existent/path -i ~/.ssh/id_ed25519 -d secret.age
Error: No such file or directory (os error 2)
[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report
I was expecting that the non-existent path identity would be totally ignored because the private key path (~/.ssh/id_ed25519) exists and is able to decrypt the secret, instead it complains about not being able to open the non-existent path. I think this could be useful for situations where you want to have a fallback identity, or want to transition the location of an identity to a different path.
rage has always rejected non-existent identity files. Originally it would parse the identities from the given files, and then coalesce them (so e.g. identities from the same plugin would be tried together). This behaviour was changed in https://github.com/str4d/rage/pull/248/commits/481b9944379bdf07d581dba992d6d01d8d7ea86c to instead match age, and treat the provided -i flags as a direct indication of the user's decryption preferences. That line of reasoning implies that if a user specifies an -i flag, they intend for that identity to be used, and hence it must exist.
How does age behave in this context? cc @FiloSottile