Key.to_dict() now always returns JSON encodeable keys and values.#139
Key.to_dict() now always returns JSON encodeable keys and values.#139zejn wants to merge 1 commit intompdavis:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
=======================================
Coverage 96.54% 96.54%
=======================================
Files 14 14
Lines 1071 1071
=======================================
Hits 1034 1034
Misses 37 37
Continue to review full report at Codecov.
|
| assert as_dict['k'] == encoded | ||
|
|
||
| # as_dict should be serializable to JSON | ||
| import json |
There was a problem hiding this comment.
Same nitpick here: import json at the top of the module.
| assert 'qi' not in as_dict | ||
|
|
||
| # as_dict should be serializable to JSON | ||
| import json |
There was a problem hiding this comment.
Same nitpick here: import json at the top of the module.
| assert 'd' not in as_dict | ||
|
|
||
| # as_dict should be serializable to JSON | ||
| import json |
There was a problem hiding this comment.
Nitpick: import json at the top of the module.
| 'alg': self._algorithm, | ||
| 'kty': 'oct', | ||
| 'k': base64url_encode(self.prepared_key), | ||
| 'k': base64url_encode(self.prepared_key).decode('ascii'), |
There was a problem hiding this comment.
Nitpick: I know that the encoding names get normalized anyway, but I'd prefer to have one style. ASCII is capitalized everywhere else, so I'd like it capitalized here as well.
If this is merged, then a major version should be bumped as this change is somewhat backwards incompatible.
Fixes #137 and #127.