Skip to content

Commit 0e8edc6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a8e8742 commit 0e8edc6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

jwt/algorithms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,9 @@ def to_jwk(key_obj):
473473
}
474474

475475
if isinstance(key_obj, EllipticCurvePrivateKey):
476-
obj["d"] = to_base64url_uint(key_obj.private_numbers().private_value).decode()
476+
obj["d"] = to_base64url_uint(
477+
key_obj.private_numbers().private_value
478+
).decode()
477479

478480
return json.dumps(obj)
479481

tests/keys/testkey_ec_secp192r1.priv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
MG8CAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQEEVTBTAgEBBBiON6kYcPu8ZUDRTu8W
33
eXJ2FmX7e9yq0hahNAMyAARHecLjkXWDUJfZ4wiFH61JpmonCYH1GpinVlqw68Sf
44
wtDHg2F6SifQEFC6VKj1ZXw=
5-
-----END PRIVATE KEY-----
5+
-----END PRIVATE KEY-----

tests/test_algorithms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ def test_ec_to_jwk_with_valid_curves(self):
319319

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

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

328328
@crypto_required
329329
def test_ec_to_jwk_with_invalid_curve(self):

0 commit comments

Comments
 (0)