summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2019-11-22 15:54:16 -0500
committerEli Collins <elic@assurancetechnologies.com>2019-11-22 15:54:16 -0500
commit806cd6fc912796a6173646de165be3a5db76847c (patch)
tree3880d71afe79d6841ce6d064c0a45f54b4621c4e
parent110c695c8a2e9d62a47338764789263f4130f3d8 (diff)
downloadpasslib-806cd6fc912796a6173646de165be3a5db76847c.tar.gz
bcrypt: deprecated support for "py-bcrypt" and "bcryptor" backends
-rw-r--r--docs/history/1.7.rst7
-rw-r--r--docs/install.rst7
-rw-r--r--docs/lib/passlib.hash.bcrypt.rst12
-rw-r--r--passlib/handlers/bcrypt.py11
4 files changed, 35 insertions, 2 deletions
diff --git a/docs/history/1.7.rst b/docs/history/1.7.rst
index f5452dc..bf50b44 100644
--- a/docs/history/1.7.rst
+++ b/docs/history/1.7.rst
@@ -59,6 +59,13 @@ Deprecations
However, **Passlib 1.8 will drop support for Python 2.6 & 3.3; and Passlib 2.0 will drop
support for Python 2.x entirely.**
+* Support for Python 2.6 & 3.3 is deprecated; and will be dropped in Passlib 1.8.
+
+* .. py:currentmodule:: passlib.hash
+
+ :class:`bcrypt`: ``py-bcrypt`` and ``bcryptor`` backends are deprecated, and support
+ will be removed in Passlib 1.8. Please switch to the ``bcrypt`` backend.
+
Other Changes
-------------
diff --git a/docs/install.rst b/docs/install.rst
index 8cf0b45..43d25fc 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -40,6 +40,13 @@ Optional Libraries
`py-bcrypt <https://pypi.python.org/pypi/py-bcrypt>`_, or
`bcryptor <https://bitbucket.org/ares/bcryptor/overview>`_
+ .. rst-class:: float-right
+
+ .. warning::
+
+ Support for ``py-bcrypt`` and ``bcryptor`` will be dropped in Passlib 1.8,
+ as these libraries are unmaintained.
+
If any of these packages are installed, they will be used to provide
support for the BCrypt hash algorithm.
This is required if you want to handle BCrypt hashes,
diff --git a/docs/lib/passlib.hash.bcrypt.rst b/docs/lib/passlib.hash.bcrypt.rst
index e116983..a8c4625 100644
--- a/docs/lib/passlib.hash.bcrypt.rst
+++ b/docs/lib/passlib.hash.bcrypt.rst
@@ -48,11 +48,19 @@ Interface
Bcrypt Backends
---------------
+.. rst-class:: float-center
+
+.. warning::
+
+ Support for ``py-bcrypt`` and ``bcryptor`` will be dropped in Passlib 1.8,
+ as these libraries are unmaintained.
+
+
This class will use the first available of five possible backends:
1. `bcrypt <https://pypi.python.org/pypi/bcrypt>`_, if installed.
-2. `py-bcrypt <https://pypi.python.org/pypi/py-bcrypt>`_, if installed.
-3. `bcryptor <https://bitbucket.org/ares/bcryptor/overview>`_, if installed.
+2. `py-bcrypt <https://pypi.python.org/pypi/py-bcrypt>`_, if installed (DEPRECATED)
+3. `bcryptor <https://bitbucket.org/ares/bcryptor/overview>`_, if installed (DEPRECATED).
4. stdlib's :func:`crypt.crypt()`, if the host OS supports BCrypt
(primarily BSD-derived systems).
5. A pure-python implementation of BCrypt, built into Passlib.
diff --git a/passlib/handlers/bcrypt.py b/passlib/handlers/bcrypt.py
index 222c5ce..3c168e9 100644
--- a/passlib/handlers/bcrypt.py
+++ b/passlib/handlers/bcrypt.py
@@ -616,6 +616,12 @@ class _BcryptorBackend(_BcryptCommon):
import bcryptor as _bcryptor
except ImportError: # pragma: no cover
return False
+
+ # deprecated as of 1.7.2
+ if not dryrun:
+ warn("Support for `bcryptor` is deprecated, and will be removed in Passlib 1.8; "
+ "Please use `pip install bcrypt` instead", DeprecationWarning)
+
return mixin_cls._finalize_backend_mixin(name, dryrun)
def _calc_checksum(self, secret):
@@ -653,6 +659,11 @@ class _PyBcryptBackend(_BcryptCommon):
# XXX: should we raise AssertionError here? (if get here, _detect_pybcrypt() is broken)
return False
+ # deprecated as of 1.7.2
+ if not dryrun:
+ warn("Support for `py-bcrypt` is deprecated, and will be removed in Passlib 1.8; "
+ "Please use `pip install bcrypt` instead", DeprecationWarning)
+
# determine pybcrypt version
try:
version = _pybcrypt._bcrypt.__version__