diff --git a/src/oic/extension/proof_of_possesion.py b/src/oic/extension/proof_of_possesion.py index 120d5920..24fecd8a 100644 --- a/src/oic/extension/proof_of_possesion.py +++ b/src/oic/extension/proof_of_possesion.py @@ -32,7 +32,7 @@ def __init__(self, *args, **kwargs): # mapping from signed pop token to access token in db self.access_tokens: Dict[JWS, str] = {} - def token_endpoint(self, dtype="urlencoded", **kwargs): + def token_endpoint(self, request="", authn="", dtype="urlencoded", **kwargs): atr = AccessTokenRequest().deserialize(kwargs["request"], dtype) resp = super(PoPProvider, self).token_endpoint(**kwargs) @@ -60,7 +60,7 @@ def token_endpoint(self, dtype="urlencoded", **kwargs): atr["token_type"] = "pop" # nosec return Response(atr.to_json(), content="application/json") - def userinfo_endpoint(self, request, **kwargs): + def userinfo_endpoint(self, request="", **kwargs): access_token = self._parse_access_token(request) shr = SignedHttpRequest(self._get_client_public_key(access_token)) http_signature = self._parse_signature(request) diff --git a/src/oic/oauth2/message.py b/src/oic/oauth2/message.py index a339d1b0..35c63d2b 100644 --- a/src/oic/oauth2/message.py +++ b/src/oic/oauth2/message.py @@ -829,7 +829,7 @@ def only_extras(self): else: return False - def update(self, item): + def update(self, item): # type: ignore[override] if isinstance(item, dict): self._dict.update(item) elif isinstance(item, Message): diff --git a/src/oic/oic/__init__.py b/src/oic/oic/__init__.py index 74285412..55cbb880 100644 --- a/src/oic/oic/__init__.py +++ b/src/oic/oic/__init__.py @@ -1607,9 +1607,8 @@ def handle_request_uri(self, request_uri, verify=True, sender=""): logger.debug("Fetched request: {}".format(req)) return req - def parse_authorization_request( - self, request=AuthorizationRequest, url=None, query=None, keys=None - ): + def parse_authorization_request(self, url=None, query=None, keys=None): + request = self.message_factory.get_request_type("authorization_endpoint") if url: parts = urlparse(url) scheme, netloc, path, params, query, fragment = parts[:6] diff --git a/src/oic/utils/authn/client.py b/src/oic/utils/authn/client.py index 0ba9190c..3078e8e6 100644 --- a/src/oic/utils/authn/client.py +++ b/src/oic/utils/authn/client.py @@ -63,7 +63,7 @@ def __init__(self, cli=None): """ self.cli = cli - def construct(self, **kwargs): + def construct(self, *args, **kwargs): """ Add authentication information to a request. @@ -71,7 +71,7 @@ def construct(self, **kwargs): """ raise NotImplementedError - def verify(self, **kwargs): + def verify(self, *args, **kwargs): """ Verify authentication information in a request. diff --git a/src/oic/utils/authn/ldap_member.py b/src/oic/utils/authn/ldap_member.py index a9dce310..633d98ed 100644 --- a/src/oic/utils/authn/ldap_member.py +++ b/src/oic/utils/authn/ldap_member.py @@ -13,7 +13,9 @@ def __init__(self, verify_attr=None, verify_attr_valid=None, **kwargs): self.verify_attr = verify_attr self.verify_attr_valid = verify_attr_valid - def __call__(self, userid, **kwargs): + def __call__( + self, userid, client_id, user_info_claims=None, first_only=True, **kwargs + ): result = UserInfoLDAP.__call__(self, userid, None, False) if self.verify_attr in result: for field in result[self.verify_attr]: diff --git a/src/oic/utils/authn/user.py b/src/oic/utils/authn/user.py index 5d8aca0c..4ba7aba1 100644 --- a/src/oic/utils/authn/user.py +++ b/src/oic/utils/authn/user.py @@ -134,7 +134,7 @@ def generate_return_url(self, return_to, uid, path=""): return create_return_url(_path, uid, **{self.query_param: "true"}) - def verify(self, **kwargs): + def verify(self, *args, **kwargs): raise NotImplementedError def get_multi_auth_cookie(self, cookie): diff --git a/src/oic/utils/sdb.py b/src/oic/utils/sdb.py index da89f16c..ba8be9db 100644 --- a/src/oic/utils/sdb.py +++ b/src/oic/utils/sdb.py @@ -208,7 +208,7 @@ def __call__(self, sid="", ttype="", **kwargs): self.crypt.encrypt(lv_pack(rnd, ttype, sid, issued_at).encode()) ).decode("utf-8") - def key(self, user="", areq=None): + def key(self, user="", areq=None, **kwargs): """ Return a key - the session id - that are based on some session connected data.