Skip to content

Commit d9493a2

Browse files
committed
Merge branch 'master' of github.com:IdentityPython/JWTConnect-Python-CryptoJWT
2 parents d7138ea + 175b63f commit d9493a2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/cryptojwt/key_bundle.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def do_local_jwk(self, filename):
304304
305305
:param filename: Name of the file from which the JWKS should be loaded
306306
"""
307-
LOGGER.debug("Reading JWKS from %s", filename)
307+
LOGGER.info("Reading local JWKS from %s", filename)
308308
with open(filename) as input_file:
309309
_info = json.load(input_file)
310310
if 'keys' in _info:
@@ -322,7 +322,7 @@ def do_local_der(self, filename, keytype, keyusage=None, kid=''):
322322
:param keytype: Presently 'rsa' and 'ec' supported
323323
:param keyusage: encryption ('enc') or signing ('sig') or both
324324
"""
325-
LOGGER.debug("Reading DER from %s", filename)
325+
LOGGER.info("Reading local DER from %s", filename)
326326
key_args = {}
327327
_kty = keytype.lower()
328328
if _kty in ['rsa', 'ec']:
@@ -354,6 +354,7 @@ def do_remote(self):
354354
# if self.verify_ssl is not None:
355355
# self.httpc_params["verify"] = self.verify_ssl
356356

357+
LOGGER.info("Reading remote JWKS from %s", self.source)
357358
try:
358359
LOGGER.debug('KeyBundle fetch keys from: %s', self.source)
359360
httpc_params = self.httpc_params.copy()
@@ -388,9 +389,11 @@ def do_remote(self):
388389

389390
elif _http_resp.status_code == 304: # Not modified
390391
LOGGER.debug("%s not modified since %s", self.source, self.last_remote)
391-
pass
392+
self.time_out = time.time() + self.cache_time
392393

393394
else:
395+
LOGGER.warning("HTTP status %d reading remote JWKS from %s",
396+
_http_resp.status_code, self.source)
394397
raise UpdateFailed(
395398
REMOTE_FAILED.format(self.source, _http_resp.status_code))
396399
self.last_updated = time.time()

tests/test_03_key_bundle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def test_remote_not_modified():
10141014
assert kb.last_remote == headers.get("Last-Modified")
10151015
timeout2 = kb.time_out
10161016

1017-
assert timeout1 == timeout2
1017+
assert timeout1 != timeout2
10181018

10191019
exp = kb.dump()
10201020
kb2 = KeyBundle().load(exp)

0 commit comments

Comments
 (0)