You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the vid field in third party caveats is not correctly encoded, which leads to an exception when trying to serialize macaroons in JSON format.
>>> m = macaroons.create("my location", "my secret key", "my identifier")
>>> m = m.add_third_party_caveat("tp location", "tp root key", "tp caveat")
>>> m.serialize(format='json')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bindings/python/macaroons.pyx", line 181, in macaroons.Macaroon.serialize (bindings/python/macaroons.c:2259)
return bytes(data[:data_sz]).decode('utf8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 90: invalid start byte
I added a print statement before the exception was raised, and it printed this:
Yes. As I mentioned in #47, the JSON format wasn't complete w.r.t. UTF-8 and supporting it well. I think at one point I required a build flag stating it was experimental, but may have removed that.
There either is or needs to be a {,de}serialization test for unicode, third party, and strings that must be normalized when converted to unicode.
It seems that the vid field in third party caveats is not correctly encoded, which leads to an exception when trying to serialize macaroons in JSON format.
I added a print statement before the exception was raised, and it printed this:
It looks like the vid field should have been base64 encoded and then the v64 field used.
The text was updated successfully, but these errors were encountered: