From 3367c25e770c45e2a51040566b85329b6003246c Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Tue, 26 Mar 2024 14:44:17 +0000 Subject: [PATCH] stop using passlib passlib is unmaintained and has not had a release since 2020 a recent bcrypt release just broke passlib see https://github.com/pyca/bcrypt/issues/684 trove's use of passlib is pretty tirval so this change just removes it as a depency and delegate the random password generation in trove.common.utils to the generate_random_key function in the trove.common.crypto_utils module Change-Id: I6b6c64147c627025d5f89db6032d1c54445df94f --- .../scripts/files/requirements/fedora-requirements.txt | 1 - .../scripts/files/requirements/ubuntu-requirements.txt | 1 - requirements.txt | 1 - trove/common/utils.py | 4 ++-- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/integration/scripts/files/requirements/fedora-requirements.txt b/integration/scripts/files/requirements/fedora-requirements.txt index 0b09cb28bb..aa42fb51c9 100644 --- a/integration/scripts/files/requirements/fedora-requirements.txt +++ b/integration/scripts/files/requirements/fedora-requirements.txt @@ -11,7 +11,6 @@ python-keystoneclient>=2.0.0,!=2.1.0 # Apache-2.0 kombu>=2.5.0 babel>=1.3 python-heatclient>=0.3.0 -passlib jinja2>=2.6 PyMySQL>=0.6.2 # MIT License python-neutronclient>=2.3.11,<3 diff --git a/integration/scripts/files/requirements/ubuntu-requirements.txt b/integration/scripts/files/requirements/ubuntu-requirements.txt index a6347bdb14..9c322b05dd 100644 --- a/integration/scripts/files/requirements/ubuntu-requirements.txt +++ b/integration/scripts/files/requirements/ubuntu-requirements.txt @@ -11,7 +11,6 @@ python-keystoneclient>=2.0.0,!=2.1.0 # Apache-2.0 kombu>=2.5.0 babel python-heatclient>=0.2.9 -passlib jinja2 PyMySQL>=0.6.2 # MIT License python-neutronclient>=2.3.6,<3 diff --git a/requirements.txt b/requirements.txt index 4e1d65a184..b40c99c8ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,6 @@ sqlalchemy-migrate>=0.11.0 # Apache-2.0 netaddr>=0.7.18 # BSD httplib2>=0.9.1 # MIT lxml!=3.7.0,>=3.4.1 # BSD -passlib>=1.7.0 # BSD python-heatclient>=1.10.0 # Apache-2.0 python-novaclient>=9.1.0 # Apache-2.0 python-cinderclient>=3.3.0 # Apache-2.0 diff --git a/trove/common/utils.py b/trove/common/utils.py index 0acf7eb65e..e58e18147f 100644 --- a/trove/common/utils.py +++ b/trove/common/utils.py @@ -30,9 +30,9 @@ from oslo_service import loopingcall from oslo_utils.encodeutils import safe_encode from oslo_utils import importutils from oslo_utils import strutils -from passlib import pwd from trove.common import cfg +from trove.common import crypto_utils from trove.common import exception from trove.common.i18n import _ @@ -298,7 +298,7 @@ def generate_random_password(password_length=None): password_length or cfg.get_configuration_property('default_password_length') ) - return pwd.genword(length=password_length) + return crypto_utils.generate_random_key(length=password_length) def try_recover(func):