| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This assumes all direct calls to private methods (leading underscore in name)
are from pyjwt code, hence stacklevel=3 nor 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
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
* Setup pre-commit hooks
* Run initial `tox -e lint`
* Fix package name
* Fix .travis.yml
|
| |
|
|
|
|
|
|
|
|
|
| |
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]]"
|
| |
|
|
|
|
| |
* 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()
* Update CHANGELOG and bump version to 1.6.4
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
| |
Resolves #205,
|
| |
|
|
|
| |
Since no signature verification will occur, passing in `algorithms` does
not make much sense.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
- 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
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
The issue also occurs when payload is int raising:
AttributeError: 'int' object has no attribute 'rsplit'
Test for None and int payload added
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
| |
retrieved by the application. Closes #155
|
| |
|
|
| |
refactoring
|
| |
|