-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improve passlib.apache
#13689
Improve passlib.apache
#13689
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
both def check_password(self, user, password):
"""
Verify password for specified user.
If algorithm marked as deprecated by CryptContext, will automatically be re-hashed.
:returns:
* ``None`` if user not found.
* ``False`` if user found, but password does not match.
* ``True`` if user found and password matches.
.. versionchanged:: 1.6
This method was previously called ``verify``, it was renamed
to prevent ambiguity with the :class:`!CryptContext` method.
The old alias is deprecated, and will be removed in Passlib 1.8.
""" |
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.
Thanks, one thing I noticed below.
stubs/passlib/passlib/apache.pyi
Outdated
encoding: str | None | ||
return_unicode: bool | 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.
While those are initialized to None
in the class, they are immediately set in __init__
, so they should never be None
in instances:
encoding: str | None | |
return_unicode: bool | None | |
encoding: str | |
return_unicode: bool |
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.
While those are initialized to
None
in the class, they are immediately set in__init__
, so they should never beNone
in instances:
Unfortunately that means we need a stubtest_allowlist entry, but it is what it is.
Co-authored-by: Sebastian Rittau <[email protected]>
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/addons/proxyauth.py:211: error: Incompatible return value type (got "bool | None", expected "bool") [return-value]
|
No description provided.