Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
tpazderka committed Jan 30, 2024
1 parent 6258daa commit 0e30cd2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/oic/extension/sts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:license: Apache2, see LICENSE for more details.
"""

import json

from oic.oauth2.message import OPTIONAL_LIST_OF_SP_SEP_STRINGS
Expand Down
6 changes: 3 additions & 3 deletions src/oic/oic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,9 +1240,9 @@ def match_preferences(self, pcr=None, issuer=None):
def store_registration_info(self, reginfo):
self.registration_response = reginfo
if "token_endpoint_auth_method" not in self.registration_response:
self.registration_response[
"token_endpoint_auth_method" # nosec
] = "client_secret_basic"
self.registration_response["token_endpoint_auth_method"] = ( # nosec
"client_secret_basic"
)
self.client_id = reginfo["client_id"]
try:
self.client_secret = reginfo["client_secret"]
Expand Down
4 changes: 1 addition & 3 deletions src/oic/oic/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,7 @@ def _parse_authz(self, query="", **kwargs):
self.redirect_uris = [self.sdb[_state]["redirect_uris"]]
return aresp, _state

def parse_authz(
self, query="", **kwargs
) -> Union[
def parse_authz(self, query="", **kwargs) -> Union[
http_util.BadRequest,
Tuple[
Optional[AuthorizationResponse],
Expand Down
1 change: 1 addition & 0 deletions src/oic/utils/clientdb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Client management databases."""

from abc import ABCMeta
from abc import abstractmethod
from urllib.parse import quote
Expand Down
6 changes: 3 additions & 3 deletions src/oic/utils/rp/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def callback(self, response, session, format="dict"):
:return:
"""
if self.behaviour["response_type"] == "code":
respcls: Union[
Type[AuthorizationResponse], Type[AccessTokenResponse]
] = AuthorizationResponse
respcls: Union[Type[AuthorizationResponse], Type[AccessTokenResponse]] = (
AuthorizationResponse
)
else:
respcls = AccessTokenResponse

Expand Down
1 change: 1 addition & 0 deletions src/oic/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
The settings make use of `pydantic-settings <https://docs.pydantic.dev/usage/settings/>`_ library.
It is possible to instance them directly or use environment values to fill the settings.
"""

from typing import Optional
from typing import Tuple
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pytest fixtures for testing."""

from typing import Any
from typing import Dict

Expand Down
1 change: 1 addition & 0 deletions tests/test_clientdb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unittests for ClientDatabases."""

import json
from operator import itemgetter
from typing import Any
Expand Down
18 changes: 9 additions & 9 deletions tests/test_x_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ def test_password_grant_type_ok(self):
areq = ROPCAccessTokenRequest(
grant_type="password", username="username", password="password"
)
areq[
"client_id"
] = "client1" # Token endpoint would fill that in based on client_authn
areq["client_id"] = (
"client1" # Token endpoint would fill that in based on client_authn
)
resp = self.provider.password_grant_type(areq)

atr = AccessTokenResponse().deserialize(resp.message, "json")
Expand All @@ -527,9 +527,9 @@ def test_password_grant_type_no_authn(self):
areq = ROPCAccessTokenRequest(
grant_type="password", username="username", password="password"
)
areq[
"client_id"
] = "client1" # Token endpoint would fill that in based on client_authn
areq["client_id"] = (
"client1" # Token endpoint would fill that in based on client_authn
)
resp = self.provider.password_grant_type(areq)

atr = TokenErrorResponse().deserialize(resp.message, "json")
Expand All @@ -542,9 +542,9 @@ def test_password_grant_type_bad(self):
areq = ROPCAccessTokenRequest(
grant_type="password", username="username", password="bad_password"
)
areq[
"client_id"
] = "client1" # Token endpoint would fill that in based on client_authn
areq["client_id"] = (
"client1" # Token endpoint would fill that in based on client_authn
)
resp = self.provider.password_grant_type(areq)

atr = TokenErrorResponse().deserialize(resp.message, "json")
Expand Down

1 comment on commit 0e30cd2

@schlenk
Copy link
Collaborator

@schlenk schlenk commented on 0e30cd2 Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems Black 23.3 as used in the 3.7 CI is different than the black 24 used here, so CI breaks for Py 3.7. See #869

Maybe we should deprecate/remove 3.7 and add 3.12.

Please sign in to comment.