MCPcopy
hub / github.com/django/django / check_password

Function check_password

django/contrib/auth/hashers.py:75–86  ·  view source on GitHub ↗

Return a boolean of whether the raw password matches the three part encoded digest. If setter is specified, it'll be called when you need to regenerate the password.

(password, encoded, setter=None, preferred="default")

Source from the content-addressed store, hash-verified

73
74
75def check_password(password, encoded, setter=None, preferred="default"):
76 """
77 Return a boolean of whether the raw password matches the three part encoded
78 digest.
79
80 If setter is specified, it'll be called when you need to regenerate the
81 password.
82 """
83 is_correct, must_update = verify_password(password, encoded, preferred=preferred)
84 if setter and is_correct and must_update:
85 setter(password)
86 return is_correct
87
88
89async def acheck_password(password, encoded, setter=None, preferred="default"):

Callers 15

check_passwordMethod · 0.90
test_simpleMethod · 0.90
test_bytesMethod · 0.90
test_pbkdf2Method · 0.90
test_md5Method · 0.90
test_bcrypt_sha256Method · 0.90
test_bcryptMethod · 0.90
test_bcrypt_upgradeMethod · 0.90
test_unusableMethod · 0.90
test_upgradeMethod · 0.90
test_no_upgradeMethod · 0.90

Calls 1

verify_passwordFunction · 0.85

Tested by 15

test_simpleMethod · 0.72
test_bytesMethod · 0.72
test_pbkdf2Method · 0.72
test_md5Method · 0.72
test_bcrypt_sha256Method · 0.72
test_bcryptMethod · 0.72
test_bcrypt_upgradeMethod · 0.72
test_unusableMethod · 0.72
test_upgradeMethod · 0.72
test_no_upgradeMethod · 0.72