fftddlZddlZddlmZddlmZmZddlm Z m Z ddl m Z ddlmZGdd ZdS) N) lru_cache)AnyList)PyJWKPyJWKSet)decode_complete)PyJWKClientErrorcteZdZddededefdZdefdZde fd Z de e fd Z d ede fd Zd ede fdZdS) PyJWKClientTuri cache_keysmax_cached_keyscb||_|r%t||j|_dSdS)N)maxsize)rrget_signing_key)selfrrrs o/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/jwt/jwks_client.py__init__zPyJWKClient.__init__ sG  \$F9_#E#E#EdFZ#[#[D  \ \returnctj|j5}t j|cdddS#1swxYwYdSN)urllibrequesturlopenrjsonload)rresponses r fetch_datazPyJWKClient.fetch_datas ^ # #DH - - '9X&& ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'sAA  A cR|}tj|Sr)r!r from_dict)rdatas r get_jwk_setzPyJWKClient.get_jwk_sets"  !$'''rc|}g}|jD])}|jdkr|jr||*t |dkrt d|S)Nsigrz2The JWKS endpoint did not contain any signing keys)r%keyspublic_key_usekey_idappendlenr )rjwk_set signing_keys jwk_set_keys rget_signing_keyszPyJWKClient.get_signing_keyss|""$$ "< 1 1K)U22{7I2##K000 |   ! !"#WXX Xrkidc|}d}|D]}|j|kr|}n|std|d|S)Nz,Unable to find a signing key that matches: "")r0r*r )rr1r. signing_keykeys rrzPyJWKClient.get_signing_key(su,,..    CzS  ! ! "EsEEE rtokenct|ddi}|d}||dS)Nverify_signatureF)optionsheaderr1) decode_tokenrget)rr6 unverifiedr:s rget_signing_key_from_jwtz$PyJWKClient.get_signing_key_from_jwt8sD!%2De1LMMM H%##FJJu$5$5666rN)Tr )__name__ __module__ __qualname__strboolintrrr!rr%rrr0rr>rrr r s\\C\T\3\\\\'C''''(X(((( $u+    35 7c7e777777rr )rurllib.requestr functoolsrtypingrrapi_jwkrrapi_jwtr r; exceptionsr r rErrrLs $$$$$$$$444444((((((07070707070707070707r