Skip to content

Commit

Permalink
Fix mypy typing
Browse files Browse the repository at this point in the history
  • Loading branch information
tpazderka committed Jul 22, 2024
1 parent 5d6b46b commit c9c55ca
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/oic/extension/proof_of_possesion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/oic/oauth2/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions src/oic/oic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/oic/utils/authn/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def __init__(self, cli=None):
"""
self.cli = cli

def construct(self, **kwargs):
def construct(self, *args, **kwargs):
"""
Add authentication information to a request.
:return:
"""
raise NotImplementedError

def verify(self, **kwargs):
def verify(self, *args, **kwargs):
"""
Verify authentication information in a request.
Expand Down
4 changes: 3 additions & 1 deletion src/oic/utils/authn/ldap_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion src/oic/utils/authn/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/oic/utils/sdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c9c55ca

Please sign in to comment.