Skip to content

Commit c498983

Browse files
committed
Fixed some spelling errors.
Slightly improved logging messages. Removed unused imports.
1 parent f48aa2d commit c498983

File tree

8 files changed

+10
-14
lines changed

8 files changed

+10
-14
lines changed

src/cryptojwt/jwk/ec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(self, kty="EC", alg="", use="", kid="", crv="", x="", y="", d="", *
113113
def deserialize(self):
114114
"""
115115
Starting with information gathered from the on-the-wire representation
116-
of an elliptic curve key (a JWK) initiate an
116+
of an elliptic curve key (a JWK) initiate a
117117
cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey
118118
or EllipticCurvePrivateKey instance. So we have to get from having::
119119

src/cryptojwt/jws/dsa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def verify(self, msg, sig, key):
8585
def _cross_check(self, pub_key):
8686
"""
8787
In Ecdsa, both the key and the algorithm define the curve.
88-
Therefore, we must cross check them to make sure they're the same.
88+
Therefore, we must crosscheck them to make sure they're the same.
8989
9090
:param key:
9191
:raises: ValueError is the curves are not the same

src/cryptojwt/key_bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def __init__(
235235
236236
:param keys: A dictionary or a list of dictionaries
237237
with the keys ["kty", "key", "alg", "use", "kid"]
238-
:param source: Where the key set can be fetch from
238+
:param source: Where the key set can be fetched from
239239
:param fileformat: For a local file either "jwks" or "der"
240240
:param keytype: Iff local file and 'der' format what kind of key it is.
241241
presently 'rsa' and 'ec' are supported.
@@ -467,7 +467,7 @@ def _do_remote(self, set_keys=True):
467467

468468
if self.ignore_errors_until and time.time() < self.ignore_errors_until:
469469
LOGGER.warning(
470-
"Not reading remote JWKS from %s (in error holddown until %s)",
470+
"Not reading remote JWKS from %s (in error hold down until %s)",
471471
self.source,
472472
datetime.fromtimestamp(self.ignore_errors_until),
473473
)

src/cryptojwt/key_issuer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def add_url(self, url, **kwargs):
9191
if not url:
9292
raise KeyError("No url given")
9393

94-
logger.debug("httpc_params: %s", self.httpc_params)
94+
logger.debug(f"add_url: httpc_params: {self.httpc_params}")
9595

9696
if "/localhost:" in url or "/localhost/" in url:
9797
_params = self.httpc_params.copy()
@@ -433,7 +433,7 @@ def mark_all_keys_as_inactive(self):
433433

434434
self._bundles = kbl
435435

436-
def key_summary(self):
436+
def key_summary(self) -> str:
437437
"""
438438
Return a text representation of all the keys.
439439

src/cryptojwt/key_jar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ def load_keys(self, issuer_id, jwks_uri="", jwks=None, replace=False):
323323
:param jwks: A dictionary representation of a JWKS
324324
:param issuer_id: The provider URL
325325
:param replace: If all previously gathered keys from this provider
326-
should be replace.
326+
should be replaced.
327327
:return: Dictionary with usage as key and keys as values
328328
"""
329-
logger.debug("Initiating key bundle for issuer: %s" % issuer_id)
329+
logger.debug(f"Initiating key bundle for issuer: {issuer_id}")
330330

331331
_issuer = self.return_issuer(issuer_id)
332332
if replace:

src/cryptojwt/simple_jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def pack(self, parts=None, headers=None):
7575
else:
7676
headers = {"alg": "none"}
7777

78-
logging.debug("JWT header: {}".format(headers))
78+
logging.debug("(pack) JWT header: {}".format(headers))
7979

8080
if not parts:
8181
return ".".join([a.decode() for a in self.b64part])

tests/test_04_key_jar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ def test_key_summary():
822822
kj.add_kb("C", KeyBundle(JWK2["keys"]))
823823

824824
out = kj.key_summary("Alice")
825-
assert out
825+
assert out == "RSA::abc"
826826

827827

828828
PUBLIC_FILE = "{}/public_jwks.json".format(BASEDIR)

tests/test_40_serialize.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import os
22

3-
from cryptojwt.jwk.hmac import SYMKey
4-
from cryptojwt.jwk.rsa import RSAKey
5-
from cryptojwt.jwk.rsa import import_rsa_key_from_cert_file
63
from cryptojwt.key_bundle import keybundle_from_local_file
7-
from cryptojwt.key_bundle import rsa_init
84
from cryptojwt.key_issuer import KeyIssuer
95
from cryptojwt.serialize import item
106

0 commit comments

Comments
 (0)