Skip to content

Commit

Permalink
global: use invenio_base.jws not itsdangerous
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Dec 6, 2024
1 parent 6e18909 commit e1733a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
9 changes: 1 addition & 8 deletions invenio_oauthclient/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@

from flask import current_app, request, session
from flask_principal import RoleNeed
from invenio_base.jws import TimedJSONWebSignatureSerializer
from invenio_db.utils import rebuild_encrypted_properties
from uritools import uricompose, urisplit
from werkzeug.local import LocalProxy
from werkzeug.utils import import_string

from .models import RemoteToken

try:
# itsdangerous < 2.1.0
from itsdangerous import TimedJSONWebSignatureSerializer
except ImportError:
# itsdangerous >= 2.1.0
from invenio_base.jws import TimedJSONWebSignatureSerializer


_security = LocalProxy(lambda: current_app.extensions["security"])


Expand Down
3 changes: 2 additions & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -17,8 +18,8 @@
from flask_security import login_user
from helpers import check_response_redirect_url
from invenio_accounts.testutils import login_user_via_session
from invenio_base.jws import TimedJSONWebSignatureSerializer
from invenio_db import db
from itsdangerous import TimedJSONWebSignatureSerializer
from mock import MagicMock
from simplejson import JSONDecodeError

Expand Down
3 changes: 2 additions & 1 deletion tests/test_views_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -16,8 +17,8 @@
from flask_oauthlib.client import OAuth as FlaskOAuth
from helpers import check_response_redirect_url, check_response_redirect_url_args
from invenio_accounts.testutils import login_user_via_session
from invenio_base.jws import TimedJSONWebSignatureSerializer
from invenio_db import db
from itsdangerous import TimedJSONWebSignatureSerializer
from mock import MagicMock
from simplejson import JSONDecodeError

Expand Down

0 comments on commit e1733a5

Please sign in to comment.