Skip to content

Commit

Permalink
Fix #351 by reverting argument name changes for .decode() (#352)
Browse files Browse the repository at this point in the history
* Fix #351 by reverting argument name changes for .decode()

* Update CHANGELOG and bump version to 1.6.4
  • Loading branch information
mark-adams authored and jpadilla committed May 24, 2018
1 parent dd753de commit d25c92c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added

[v1.6.4][1.6.4]
-------------------------------------------------------------------------
### Fixed

- Reverse an unintentional breaking API change to .decode() [#352][352]

[v1.6.3][1.6.3]
-------------------------------------------------------------------------
### Changed
Expand Down Expand Up @@ -205,6 +211,7 @@ rarely used. Users affected by this should upgrade to 3.3+.
[1.6.0]: https://github.com/jpadilla/pyjwt/compare/1.5.3...1.6.0
[1.6.1]: https://github.com/jpadilla/pyjwt/compare/1.6.0...1.6.1
[1.6.3]: https://github.com/jpadilla/pyjwt/compare/1.6.1...1.6.3
[1.6.4]: https://github.com/jpadilla/pyjwt/compare/1.6.3...1.6.4

[109]: https://github.com/jpadilla/pyjwt/pull/109
[110]: https://github.com/jpadilla/pyjwt/pull/110
Expand Down Expand Up @@ -250,5 +257,6 @@ rarely used. Users affected by this should upgrade to 3.3+.
[340]: https://github.com/jpadilla/pyjwt/pull/340
[344]: https://github.com/jpadilla/pyjwt/pull/344
[350]: https://github.com/jpadilla/pyjwt/pull/350
[352]: https://github.com/jpadilla/pyjwt/pull/352
[7c1e61d]: https://github.com/jpadilla/pyjwt/commit/7c1e61dde27bafe16e7d1bb6e35199e778962742
[7ca41e]: https://github.com/jpadilla/pyjwt/commit/7ca41e53b3d7d9f5cd31bdd8a2b832d192006239
2 changes: 1 addition & 1 deletion jwt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


__title__ = 'pyjwt'
__version__ = '1.6.3'
__version__ = '1.6.4'
__author__ = 'José Padilla'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-2018 José Padilla'
Expand Down
4 changes: 2 additions & 2 deletions jwt/api_jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def encode(self,
return b'.'.join(segments)

def decode(self,
token, # type: str
jwt, # type: str
key='', # type: str
verify=True, # type: bool
algorithms=None, # type: List[str]
Expand All @@ -146,7 +146,7 @@ def decode(self,
DeprecationWarning
)

payload, signing_input, header, signature = self._load(token)
payload, signing_input, header, signature = self._load(jwt)

if not verify:
warnings.warn('The verify parameter is deprecated. '
Expand Down
6 changes: 3 additions & 3 deletions jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def encode(self,
)

def decode(self,
token, # type: str
jwt, # type: str
key='', # type: str
verify=True, # type: bool
algorithms=None, # type: List[str]
Expand All @@ -82,15 +82,15 @@ def decode(self,
DeprecationWarning
)

payload, _, _, _ = self._load(token)
payload, _, _, _ = self._load(jwt)

if options is None:
options = {'verify_signature': verify}
else:
options.setdefault('verify_signature', verify)

decoded = super(PyJWT, self).decode(
token, key=key, algorithms=algorithms, options=options, **kwargs
jwt, key=key, algorithms=algorithms, options=options, **kwargs
)

try:
Expand Down

0 comments on commit d25c92c

Please sign in to comment.