summaryrefslogtreecommitdiff
path: root/passlib/apache.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2016-06-10 12:32:52 -0400
committerEli Collins <elic@assurancetechnologies.com>2016-06-10 12:32:52 -0400
commit281dacd121d72c7570442a13f2113f63c6c439ba (patch)
tree997fcabde572da2fc5c8158243e26cce64ee3874 /passlib/apache.py
parent61dc39910c6904c69f2e81d5dd41090cac1f18a1 (diff)
downloadpasslib-281dacd121d72c7570442a13f2113f63c6c439ba.tar.gz
.encrypt() method renamed to .hash(), other api cleanups
.encrypt() ---------- hash.encrypt() & context.encrypt() have been renamed to .hash(). this should take care of the long-standing issue 21 (the poor naming of .encrypt). per docs, legacy aliases will remain in place until passlib 2.0. .genhash() / .genconfig() ------------------------- taking advantage of this reorganization to also deprecate .genconfig() and .genhash() -- they're not really useful in a modern system, nor as needed for historical support as initially thought: .genconfig() will be retired completely in passlib 2.0; .genhash() is rolled into the new .hash() method along with .encrypt().
Diffstat (limited to 'passlib/apache.py')
-rw-r--r--passlib/apache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/passlib/apache.py b/passlib/apache.py
index cb166b9..1aea738 100644
--- a/passlib/apache.py
+++ b/passlib/apache.py
@@ -589,7 +589,7 @@ class HtpasswdFile(_CommonFile):
The old alias is deprecated, and will be removed in Passlib 1.8.
"""
user = self._encode_user(user)
- hash = self.context.encrypt(password)
+ hash = self.context.hash(password)
if PY3:
hash = hash.encode(self.encoding)
existing = (user in self._records)
@@ -916,7 +916,7 @@ class HtdigestFile(_CommonFile):
realm = self._encode_realm(realm)
key = (user, realm)
existing = (key in self._records)
- hash = htdigest.encrypt(password, user, realm, encoding=self.encoding)
+ hash = htdigest.hash(password, user, realm, encoding=self.encoding)
if PY3:
hash = hash.encode(self.encoding)
self._records[key] = hash