MCPcopy
hub / github.com/authlib/authlib / test_jwk_import_key_set

Function test_jwk_import_key_set

tests/jose/test_jwk.py:258–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256
257
258def test_jwk_import_key_set():
259 jwks_public = read_file_path("jwks_public.json")
260 key_set1 = JsonWebKey.import_key_set(jwks_public)
261 key1 = key_set1.find_by_kid("abc")
262 assert key1["e"] == "AQAB"
263
264 key_set2 = JsonWebKey.import_key_set(jwks_public["keys"])
265 key2 = key_set2.find_by_kid("abc")
266 assert key2["e"] == "AQAB"
267
268 key_set3 = JsonWebKey.import_key_set(json_dumps(jwks_public))
269 key3 = key_set3.find_by_kid("abc")
270 assert key3["e"] == "AQAB"
271
272 with pytest.raises(ValueError):
273 JsonWebKey.import_key_set("invalid")
274
275
276def test_jwk_find_by_kid_with_use():

Callers

nothing calls this directly

Calls 4

read_file_pathFunction · 0.90
json_dumpsFunction · 0.90
import_key_setMethod · 0.80
find_by_kidMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…