summaryrefslogtreecommitdiff
path: root/jwt/api_jws.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary compatibility shims for Python 2 (#498)Jon Dufresne2020-06-191-5/+5
| | | | | | | | | | | As the project is Python 3 only, can remove the compatibility shims in compat.py. Type checking has been simplified where it can: - str is iterable - bytes is iterable - use isinstance instead of issubclass The remaining function bytes_from_int() has been moved to utils.py.
* Emit warnings about user code, not pyjwt code (#494)Marius Gedminas2020-06-091-0/+1
| | | | This assumes all direct calls to private methods (leading underscore in name) are from pyjwt code, hence stacklevel=3 nor 2.
* Run pyupgrade across project to use modern Python 3 conventions (#491)Jon Dufresne2020-06-081-2/+2
| | | | | | | | pyupgrade is a tool to automatically upgrade Python syntax for newer versions of the language. Running pyupgrade removes several Python-2-isms that are no longer necessary now that the project is Python 3 only. https://github.com/asottile/pyupgrade
* Enhance tracebacks. (#477)Julien Palard2020-05-151-9/+9
|
* DX Tweaks (#450)José Padilla2019-10-211-75/+93
| | | | | | | | | | * Setup pre-commit hooks * Run initial `tox -e lint` * Fix package name * Fix .travis.yml
* Correct type for json_encoder argument (#438)Jon Dufresne2019-09-281-2/+2
| | | | | | | | | | | Per recent upstream fix to typeshed, json.dumps() cls argument should be optional type JSONEncoder. https://github.com/python/typeshed/commit/8e0d288ea49a34f9bd21b1598ec487414a339a1f Fixes mypy error: jwt/api_jws.py:102: error: Argument "cls" to "dumps" has incompatible type "Optional[Callable[..., Any]]"; expected "Optional[Type[JSONEncoder]]" jwt/api_jwt.py:61: error: Argument "cls" to "dumps" has incompatible type "Optional[Callable[..., Any]]"; expected "Optional[Type[JSONEncoder]]"
* Import collection ABC's from correct module (#384)Tsuyoshi Hombashi2018-11-251-2/+1
| | | | | | * Move ABCs imports to compat.py to reuse the imports from other modules * Import collection ABC's from correct module
* Fix #351 by reverting argument name changes for .decode() (#352)1.6.4Mark Adams2018-05-231-2/+2
| | | | | | * Fix #351 by reverting argument name changes for .decode() * Update CHANGELOG and bump version to 1.6.4
* RFC: Add type hints (#344)Jacopo Farina2018-04-081-4/+19
| | | | | | | | | | * Add mypy to Travis and a simple type hint to _get_default_options * Make flake8 accept unused import required by mypy * Add typing to encode and decode, create encode_bytes in JWS to differentiate from encode in JWT * Use Union type to describe both types of payload
* Fix #315: Raise InvalidSignatureError over generic DecodeError (#316)Markus Holtermann2017-12-011-2/+5
|
* Allow list of valid audiences to be passed in to PyJWT.decode() (#306)René Springer2017-11-261-1/+0
| | | Resolves #205,
* Warn about missing algorithms arg only when verify is TruePrzemysław Suliga2017-08-311-7/+8
| | | | | Since no signature verification will occur, passing in `algorithms` does not make much sense.
* Add warning when decoding with no algorithms specifiedJosé Padilla2017-06-221-0/+9
|
* PyJWT.decode: move verify param into options (#271)Daniel Hahler2017-06-211-1/+1
| | | | | | | | | | | Followup to https://github.com/jpadilla/pyjwt/pull/270: It seems that "verify" is only deprecated with `PyJWS.decode`, which makes sense, since you would have to override a lot of options to skip the verification in `PyJWT._validate_claims`. This makes `PyJWT.decode` use the `verify_signature` option when calling `PyJWT.decode`, and therefore also allows to use `stacklevel=2` there then for the DeprecationWarning.
* DeprecationWarnings: more helpful message (#270)Daniel Hahler2017-06-121-1/+2
|
* Changes per code reviewLandon GB2016-11-301-4/+6
|
* Fix all flake8 issues tox is complaining aboutLandon GB2016-11-281-1/+2
|
* Merge remote-tracking branch 'upstream/master'Landon GB2016-11-281-6/+8
|\
| * Add JWK support for HMAC and RSA keysadd-jwk-for-hmac-rsaMark Adams2016-08-281-6/+8
| | | | | | | | | | | | | | - JWKs for RSA and HMAC can be encoded / decoded using the .to_jwk() and .from_jwk() methods on their respective jwt.algorithms instances - Replaced tests.utils ensure_unicode and ensure_bytes with jwt.utils versions
* | Better error messages when missing cryptography packageLandon GB2016-11-281-2/+8
|/
* binary_type verification added to make the code more future-proofMauricio Aizaga2015-10-231-4/+5
|
* Fixed syntax for python 2.6Mauricio Aizaga2015-10-221-1/+1
|
* Fixed #183 AttributeError: 'NoneType' object has no attribute 'rsplit'Mauricio Aizaga2015-10-221-0/+3
| | | | | | The issue also occurs when payload is int raising: AttributeError: 'int' object has no attribute 'rsplit' Test for None and int payload added
* Change TypeError on bad `kid` to InvalidTokenErrorGabriel Gironda2015-07-231-2/+2
|
* Fail on encode and decode of bad JWS header valuesGabriel Gironda2015-07-211-2/+13
| | | | | | | | | | | | | | | The JWS spec: https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#section-4.1.4 States that if `kid` is present then it **MUST** be a string. Currently, the library allows silent creation of invalid JWS (and thus, JWT), as it allows any type for `kid`. This commit adds checks to help ensure output meets the spec. * Add jwt.api_jws.PyJWS._validate_headers for validating JWS headers on encode and decode * Add tests
* Fixed #167 throw InvalidAlgorithmError if alg not in headerAlexandru Mihai2015-06-221-1/+1
|
* Added get_unverified_header to public APIMark Adams2015-05-091-0/+1
|
* Added get_unverified_header method so that unverified headers can be ↵Mark Adams2015-05-081-0/+8
| | | | retrieved by the application. Closes #155
* Removed an extra attempt to encode the payload that I missed when I was ↵Mark Adams2015-04-191-4/+1
| | | | refactoring
* Refactored JWS-specific logic out of PyJWT and into PyJWS superclassMark Adams2015-04-191-0/+183