diff --git a/flaat/access_tokens.py b/flaat/access_tokens.py index 6c416ee..dd2d1c3 100644 --- a/flaat/access_tokens.py +++ b/flaat/access_tokens.py @@ -45,7 +45,7 @@ class AccessTokenInfo: """ Infos about the verification of the JWT. If set to `None`, then the JWT data is unverified.""" - def __init__(self, complete_decode, verification=Optional[dict]): + def __init__(self, complete_decode, verification): self.header = complete_decode.get("header", {}) self.body = complete_decode.get("payload", {}) self.signature = _base64_url_encode(complete_decode.get("signature", b"")) diff --git a/flaat/requirements.py b/flaat/requirements.py index b130af8..8fd3bfa 100644 --- a/flaat/requirements.py +++ b/flaat/requirements.py @@ -319,7 +319,7 @@ def _parse(self, raw: str): def _matches( self, required: aarc_entitlement.Base, available: aarc_entitlement.Base ) -> bool: - return available.satisfies(required) + return available is not None and available.satisfies(required) def _get_claim_requirement(