Skip to content

Commit 224984f

Browse files
committed
Ran black and isort
1 parent 8f65177 commit 224984f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/cryptojwt/jwe/fernet.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010
from cryptojwt.jwe import Encrypter
1111
from cryptojwt.utils import as_bytes
1212

13-
1413
DEFAULT_ITERATIONS = 390000
1514

1615

1716
class FernetEncrypter(Encrypter):
18-
def __init__(self,
19-
password: str,
20-
salt: Optional[bytes] = "",
21-
hash_alg: Optional[str] = "SHA256",
22-
digest_size: Optional[int] = 0,
23-
iterations: Optional[int] = DEFAULT_ITERATIONS):
17+
def __init__(
18+
self,
19+
password: str,
20+
salt: Optional[bytes] = "",
21+
hash_alg: Optional[str] = "SHA256",
22+
digest_size: Optional[int] = 0,
23+
iterations: Optional[int] = DEFAULT_ITERATIONS,
24+
):
2425
Encrypter.__init__(self)
2526
if not salt:
2627
salt = os.urandom(16)

tests/test_07_jwe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import string
77
import sys
88

9+
import pytest
910
from cryptography.hazmat.backends import default_backend
1011
from cryptography.hazmat.primitives.asymmetric import ec
11-
import pytest
1212

1313
from cryptojwt.exception import BadSyntax
1414
from cryptojwt.exception import HeaderError
@@ -673,8 +673,9 @@ def test_fernet_sha512():
673673
def test_fernet_blake2s():
674674
encryption_key = SYMKey(use="enc", key="DukeofHazardpass", kid="some-key-id")
675675

676-
encrypter = FernetEncrypter(encryption_key.key, hash_alg="BLAKE2s", digest_size=32,
677-
iterations=1000)
676+
encrypter = FernetEncrypter(
677+
encryption_key.key, hash_alg="BLAKE2s", digest_size=32, iterations=1000
678+
)
678679
_token = encrypter.encrypt(plain)
679680

680681
decrypter = encrypter

0 commit comments

Comments
 (0)