go-macaroon / macaroon

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

associate macaroons with a version #15

Closed rogpeppe closed 8 years ago

rogpeppe commented 8 years ago

One parsed as a given version, a macaroon will also marshal as that version. We lose the MarshalAs method and we also lose the option to marshal JSON macaroons as a base64-encoded binary blob, which means that there is no longer any need to specify how a macaroon will be marshaled.

This means that we can now know whether a given caveat id or macaroon id is appropriate for the version of the macaroon and return an error if not.

It means that external code can also decide on what encoding might be appropriate based on the macaroon version, and it also simplifies the API.

mhilton commented 8 years ago

:+1:

alesstimec commented 8 years ago

👍