Improve DX with custom Stanzas #443
Replies: 2 comments 1 reply
-
For context this is related to how we're using custom stanzas in https://github.com/drand/tlock and as you can see the ciphertext that are generated here: https://timevault.drand.love/ For example this one:
PS: Yes, I plan to look into implementing a plugin mode for |
Beta Was this translation helpful? Give feedback.
-
I opened #486 to improve the error message, but I am going back and forth about custom armor headers. They would be reasonably easy to do for library use of age, but generally we want to encourage not reinventing cmd/age and writing plugins instead, now that those are an option. Should a plugin be allowed to set the armor header? What if two plugins try to do that? How would that work on the decryption side? Maybe we could contact the plugins before reading the file, to get supported armor headers, but that feels like a lot of complexity. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I'm talking here as a developer using the age library, I guess it falls under UX reports?
While it is possible to implement our own
Wrap
andUnwrap
types, it is difficult currently to advertise we've done so when using age as a library.For instance a custom
Wrap
implementation with our own recipient type will error as follow when decrypted withage
:which is expected, but not very informative for the user.
Furthermore, it's not possible to set custom Header and Footer in
armor
to differentiate our armored ciphertext from a commonage
ciphertext:age/armor/armor.go
Lines 23 to 26 in 084c974
And it's also not possible to tweak the
intro
to advertise a custom type of age Stanza:age/internal/format/format.go
Line 108 in 084c974
While the latter is fine since it's quickly apparent that a custom recipient type was used by looking at the
->
headers' lines, it's not the case at all with the armored ciphertexts.My suggested improvements would be to:
armor
, since this package could very well be of use to other developers on its own.age
, error out like now, but display at least one of them to help the user understand they need a custom plugin / other tool to decrypt the ciphertext.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions