Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 9, 2022
1 parent a8e8742 commit 0e8edc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion jwt/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ def to_jwk(key_obj):
}

if isinstance(key_obj, EllipticCurvePrivateKey):
obj["d"] = to_base64url_uint(key_obj.private_numbers().private_value).decode()
obj["d"] = to_base64url_uint(
key_obj.private_numbers().private_value
).decode()

return json.dumps(obj)

Expand Down
2 changes: 1 addition & 1 deletion tests/keys/testkey_ec_secp192r1.priv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
MG8CAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQEEVTBTAgEBBBiON6kYcPu8ZUDRTu8W
eXJ2FmX7e9yq0hahNAMyAARHecLjkXWDUJfZ4wiFH61JpmonCYH1GpinVlqw68Sf
wtDHg2F6SifQEFC6VKj1ZXw=
-----END PRIVATE KEY-----
-----END PRIVATE KEY-----
4 changes: 2 additions & 2 deletions tests/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ def test_ec_to_jwk_with_valid_curves(self):

with open(key_path(f"jwk_ec_pub_{curve}.json")) as keyfile:
pub_key = algo.from_jwk(keyfile.read())
assert json.loads(algo.to_jwk(pub_key))['crv'] == curve
assert json.loads(algo.to_jwk(pub_key))["crv"] == curve

with open(key_path(f"jwk_ec_key_{curve}.json")) as keyfile:
priv_key = algo.from_jwk(keyfile.read())
assert json.loads(algo.to_jwk(priv_key))['crv'] == curve
assert json.loads(algo.to_jwk(priv_key))["crv"] == curve

@crypto_required
def test_ec_to_jwk_with_invalid_curve(self):
Expand Down

0 comments on commit 0e8edc6

Please sign in to comment.