Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rglauco committed Mar 12, 2024
1 parent 215e0a6 commit 1133275
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spid_cie_oidc/entity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
logger = logging.getLogger(__name__)


def get_key(jwks, use=KeyUsage.signature):
for jwk in jwks:
if jwk['use'] == use:
return jwk
def get_key(jwks, used=KeyUsage.signature):
# TODO change tests accordingly due 2 core keys
if len(jwks) > 1:
for jwk in jwks:
if jwk['use'] == used:
return jwk
return jwks[0]


def iat_now() -> int:
return int(datetime.datetime.now().timestamp())

Expand All @@ -32,7 +36,7 @@ def datetime_from_timestamp(value) -> datetime.datetime:
return make_aware(datetime.datetime.fromtimestamp(value))


def get_jwks(metadata: dict, federation_jwks:list = []) -> dict:
def get_jwks(metadata: dict, federation_jwks: list = []) -> dict:
"""
get jwks or jwks_uri or signed_jwks_uri
"""
Expand Down

0 comments on commit 1133275

Please sign in to comment.