-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add digest_method to SessionMiddleware
#2986
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
base: main
Are you sure you want to change the base?
Conversation
This is needed to support FIPS builds without SHA-1. itsdangerous includes a patch for this issue, but the TimestampSigner used in SessionMiddleware does not allow the digest_method to be changed from the itsdangerous default, which is SHA1, and causes SessionMiddleware to generate an exception in a ubi8/ubi9 RedHat container
| same_site: Literal["lax", "strict", "none"] = "lax", | ||
| https_only: bool = False, | ||
| domain: str | None = None, | ||
| digest_method: Any | None = None, |
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.
What's the right type for this digest_method?
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 am not sure what the correct type is, I just borrowed the Any type from the itsdangerous code.
https://github.com/pallets/itsdangerous/blob/672971d66a2ef9f85151e53283113f33d642dabd/src/itsdangerous/signer.py#L60
digest_method to SessionMiddleware
|
What is the status of this one? To be able to add digest method is highly appreciated. |
Summary
itsdangerous includes a patch for this issue, but the TimestampSigner used in SessionMiddleware does not allow the digest_method to be changed from the itsdangerous default, which is SHA1, and causes SessionMiddleware to generate an exception in a ubi8/ubi9 RedHat container. This commit allows the Starlette Session Middleware to support FIPS builds without SHA-1 by adding a digest_method parameter to the constructor.
Checklist