Skip to content

Commit

Permalink
fix: DeprecationWarning:
Browse files Browse the repository at this point in the history
* The 'EncryptedType' class will change implementation from
  'LargeBinary' to 'String' in a future version. Use 'StringEncryptedType'
  to use the 'String' implementation.
  • Loading branch information
utnapischtim committed Dec 12, 2024
1 parent 69baf41 commit 39cbd40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2016-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 Down Expand Up @@ -56,7 +57,9 @@ def upgrade():
"oauthclient_remotetoken",
sa.Column("id_remote_account", sa.Integer(), nullable=False),
sa.Column("token_type", sa.String(length=40), nullable=False),
sa.Column("access_token", sqlalchemy_utils.EncryptedType(), nullable=False),
sa.Column(
"access_token", sqlalchemy_utils.StringEncryptedType(), nullable=False
),
sa.Column("secret", sa.Text(), nullable=False),
sa.ForeignKeyConstraint(
["id_remote_account"],
Expand Down
4 changes: 2 additions & 2 deletions invenio_oauthclient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from invenio_db import db
from sqlalchemy.ext.mutable import MutableDict
from sqlalchemy.orm import backref
from sqlalchemy_utils import EncryptedType, JSONType, Timestamp
from sqlalchemy_utils import JSONType, StringEncryptedType, Timestamp


def _secret_key():
Expand Down Expand Up @@ -116,7 +116,7 @@ class RemoteToken(db.Model, Timestamp):
"""Type of token."""

access_token = db.Column(
EncryptedType(type_in=db.Text, key=_secret_key), nullable=False
StringEncryptedType(type_in=db.Text, key=_secret_key), nullable=False
)
"""Access token to remote application."""

Expand Down

0 comments on commit 39cbd40

Please sign in to comment.