go-macaroon / macaroon

A native Go implementation of macaroons
BSD 3-Clause "New" or "Revised" License
182 stars 24 forks source link

drop support for hex-encoded fields #22

Closed rogpeppe closed 7 years ago

rogpeppe commented 7 years ago

The official format specification has dropped support for hex-encoded fields and we never used that format when marshaling, so remove the code for it.

Also be more intelligent about when to use base64-encoding. Some strings that are valid UTF-8 nonetheless encode as longer than their base64-encoded counterparts (for example "\x03\x00" as seen in a caveat id, encodes to the JSON string "\u0003\u0000".