kvesteri / sqlalchemy-utils

Various utility functions and datatypes for SQLAlchemy.
Other
1.27k stars 322 forks source link

Issue with change of implementation of EncryptedType from ‘LargeBinary’ to ‘String’ #722

Open ArchibaldNoah opened 11 months ago

ArchibaldNoah commented 11 months ago

Good morning

It just happend ...

"The ‘EncryptedType’ class will change implementation from ‘LargeBinary’ to ‘String’ in a future version. Use ‘StringEncryptedType’ to use the ‘String’ implementation."

I am not sure what triggered the migration but it worked fine on the database side.

However, when I am running my program now, I am getting: "binascii.Error: Invalid base64-encoded string: number of data characters (49) cannot be 1 more than a multiple of 4"

I am using EncryptedType quite a bit. Typical usage: "last_name = db.Column(StringEncryptedType(Unicode, SA_SECRET_KEY, AesEngine, 'pkcs5'), index=True, unique=False)"

I couldn't find anything on this issue or a hint on the migration in the usual sources. Any suggestions?

Kind regards, Jürgen

ArchibaldNoah commented 11 months ago

Since the last migration I upgraded to SQLAlchemy-Utils==0.41.1 from SQLAlchemy-Utils==0.38.3, SQLAlchemy==2.0.23 from SQLAlchemy==1.4.41.