File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ WORKDIR /workspaces
44
55# Install Python dependencies from requirements.txt if it exists
66COPY requirements_test.txt .
7- RUN pip3 install -r requirement_test .txt \
7+ RUN pip3 install -r requirements_test .txt \
88 && pip3 install tox \
99 && rm -f requirements_test.txt
1010
Original file line number Diff line number Diff line change @@ -197,22 +197,21 @@ def __init__(
197197 self .client = boto3 .client ("cognito-idp" , ** boto3_client_kwargs )
198198
199199 def get_keys (self ):
200-
201- try :
200+ if self .pool_jwk :
202201 return self .pool_jwk
203- except AttributeError :
204- # Check for the dictionary in environment variables.
205- pool_jwk_env = env ("COGNITO_JWKS" , {}, var_type = "dict" )
206- if len ( pool_jwk_env . keys ()) > 0 :
207- self .pool_jwk = pool_jwk_env
208- return self . pool_jwk
209- # If it is not there use the requests library to get it
202+
203+ # Check for the dictionary in environment variables.
204+ pool_jwk_env = env ("COGNITO_JWKS" , {}, var_type = "dict" )
205+ if pool_jwk_env :
206+ self .pool_jwk = pool_jwk_env
207+ # If it is not there use the requests library to get it
208+ else :
210209 self .pool_jwk = requests .get (
211210 "https://cognito-idp.{}.amazonaws.com/{}/.well-known/jwks.json" .format (
212211 self .user_pool_region , self .user_pool_id
213212 )
214213 ).json ()
215- return self .pool_jwk
214+ return self .pool_jwk
216215
217216 def get_key (self , kid ):
218217 keys = self .get_keys ().get ("keys" )
You can’t perform that action at this time.
0 commit comments