-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serialization produces invalid base64 #26
Comments
We switched to the URL Base64 format so tokens can be put into URLs. See here for more discussion: #20. This library will handle both, but produces the URL format. |
Thanks. I hadn't appreciated that the URL encoding conventionally omits padding. I think there might be a benefit to exposing functions that don't do any |
I'm up for adding a (possibly hidden) function that can directly output non-base64 tokens so binary data can be sent in the clear. Ditto for the JSON format once it settles. I went for base64 by default because it's the easiest to use safely under the widest variety of scenarios I can imagine. The lack of whitespace or non-ascii characters means its easy to parse a complete token, and use it in every place I could imagine a token being used. Developers who want to do things more cleverly than that are certainly welcome to do so, but we shouldn't make it the default. |
Interesting discussion. I also want to add my 2 cts. I prefer Base64, because its plain ASCII and can be easily transported (nearly) everywhere on the web. When we're talking about character encoding, I prefer JSON, because it's solved there. The current macaroon binary format doesn't specify this.Besides this, I don't see any values in using JSON. But I'm interested to hear yours. (context: macaroon serialization) In the future I would like to see only one preferred transport format, which eases the cross platform or cross language implementation adoption of macaroons. |
The base64 does not have the required padding characters to
allow it to be parsed by standard base64 decoders.
Verify by taking some serialization from the example README.md:
produces an error.
The text was updated successfully, but these errors were encountered: