1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-20 18:59:08 +00:00
community.general/tests
patchback[bot] dc79f4a170
[PR #11860/25b21183 backport][stable-12] udm_user, homectl - replace crypt/legacycrypt with passlib (#11884)
udm_user, homectl - replace crypt/legacycrypt with passlib (#11860)

* udm_user - replace crypt/legacycrypt with passlib

The stdlib crypt module was removed in Python 3.13. Replace the
crypt/legacycrypt import chain with passlib (already used elsewhere
in the collection) and use CryptContext.verify() for password
comparison.

Fixes #4690



* Add changelog fragment for PR 11860



* remove redundant ignore file entries

* udm_user, homectl - replace crypt/legacycrypt with _crypt module utils

Add a new _crypt module_utils that abstracts password hashing and
verification. It uses passlib when available, falling back to the
stdlib crypt or legacycrypt, and raises ImportError if none of them
can be imported. Both udm_user and homectl now use this shared
utility, fixing compatibility with Python 3.13+.

Fixes #4690



* Add BOTMETA entry for _crypt module utils



* _crypt - fix mypy errors and handle complete unavailability

Replace CryptContext = object fallback (rejected by mypy) with a
proper dummy class definition. Add has_crypt_context flag so modules
can detect when no backend is available. Update both modules to
import and check has_crypt_context instead of testing for None.



* adjsutments from review

* Update plugins/modules/homectl.py



* Update plugins/modules/udm_user.py



---------



(cherry picked from commit 25b21183bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-19 22:51:20 +02:00
..
integration [PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881) 2026-04-19 12:49:29 +02:00
sanity [PR #11860/25b21183 backport][stable-12] udm_user, homectl - replace crypt/legacycrypt with passlib (#11884) 2026-04-19 22:51:20 +02:00
unit [PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881) 2026-04-19 12:49:29 +02:00
utils [PR #11686/68ae04a9 backport][stable-12] Cleanup of aliases skip statements (#11709) 2026-03-30 19:58:13 +02:00
.gitignore New module git config info (#7587) 2023-11-29 08:37:50 +01:00
config.yml Add default license header to files which have no copyright or license header yet (#5074) 2022-08-05 14:03:38 +02:00
galaxy-importer.cfg Zuul third-party-check: disable ansible-doc part of galaxy-importer (#7907) 2024-01-27 15:28:10 +01:00