Skip to content

Commit

Permalink
Pin black version and bump it
Browse files Browse the repository at this point in the history
  • Loading branch information
gbip committed Jan 20, 2025
1 parent 1e3e942 commit f5dbeba
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ on:

jobs:

mypy:
black:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: psf/black@stable
with:
version: "~= 24.0"

linting:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -20,7 +34,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: psf/black@stable
- name: Install dependencies
run: python -m pip download .[drf]

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
1 change: 1 addition & 0 deletions django_pyoidc/providers/keycloak_10.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Base Keycloak Provider class.
"""

from typing import Any, Optional
from urllib.parse import urlparse

Expand Down
6 changes: 3 additions & 3 deletions django_pyoidc/providers/keycloak_18.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Keycloak18Provider(Keycloak17Provider):
def get_default_config(self) -> ProviderConfig:
result = super().get_default_config()
# logout redirection query string parameter name altered, from redirect_uri to post_logout_redirect_uri
result[
"oidc_logout_query_string_redirect_parameter"
] = "post_logout_redirect_uri"
result["oidc_logout_query_string_redirect_parameter"] = (
"post_logout_redirect_uri"
)
return result
2 changes: 1 addition & 1 deletion django_pyoidc/providers/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Rare usages ---
"client_authn_method": Optional[bool],
"oidc_logout_query_string_redirect_parameter": Optional[str],
"oidc_logout_query_string_extra_parameters_dict": Optional[Dict[str, Any]]
"oidc_logout_query_string_extra_parameters_dict": Optional[Dict[str, Any]],
# "client_consumer_config_dict": None,
# some providers may return even more stuff (...) ---
},
Expand Down
4 changes: 3 additions & 1 deletion django_pyoidc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ def post(self, request: HttpRequest) -> HttpResponse:
if sid:
try:
client = OIDCClient(self.op_name, session_id=sid)
except Exception as e: # FIXME : Finer exception handling (KeyError,ParseError,CommunicationError)
except (
Exception
) as e: # FIXME : Finer exception handling (KeyError,ParseError,CommunicationError)
logger.error("OIDC Logout call error when loading OIDC state: ")
logger.exception(e)

Expand Down
1 change: 0 additions & 1 deletion tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ def test_callback_calling_hook_validate_access_token(
class BackchannelLogoutTestCase(OIDCTestCase):
@classmethod
def setUpTestData(cls):

"""
To generate an other jwk key : 'jose jwk gen -i '{"alg":"HS256"}' -o oct.jwk'
"""
Expand Down

0 comments on commit f5dbeba

Please sign in to comment.