-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use itsdangerous library to sign cookie #11
base: main
Are you sure you want to change the base?
Conversation
src/secure_cookie/cookie.py
Outdated
|
||
@classmethod | ||
def _mac_unserialize(cls, string, secret_key): | ||
warnings.warn("Obsolete serialization method used", DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message needs to be more exact. Something like "Unserializing using the old scheme. This is deprecated and the fallback will be removed in version 2.0. Ensure cookies are re-serialized using the new ItsDangerous scheme."
Should also use stacklevel=3
or whatever level makes the error show where in user code caused it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this part. The new string is longer than required by black so I added a # noqa
comment to ignore it. If you prefer, I can extract it in a variable to reformat it.
I don't think it's necessary because the _mac_unserialize()
method will disappear in a future release. What is your opinion about it?
Is this code similar to Flask's use of ItsDangerous for the session cookie? Haven't had a chance to compare yet. If not, we should identify how it's different and why here. |
The current added code for SecureCookieSessionInterface() class use classes from So I don't understand what needs to be compared. Could you give me some hints? |
This PR is about issue #6.
The previous serialization/deserialization is still in the code, until it will be removed in a another future release.
What do you think about it? Do you see improvements to add?
Perhaps the
itsdangerous
library version should be more restricted?