Skip to content

fix: update password generation and remove passlib dependency#546

Open
Samk13 wants to merge 1 commit intoinveniosoftware:masterfrom
Samk13:fix-passlib-pwd-deprecation
Open

fix: update password generation and remove passlib dependency#546
Samk13 wants to merge 1 commit intoinveniosoftware:masterfrom
Samk13:fix-passlib-pwd-deprecation

Conversation

@Samk13
Copy link
Member

@Samk13 Samk13 commented Feb 16, 2026

❤️ Thank you for your contribution!

Description

  • fix: ImportError: cannot import name 'str_to_uascii' from 'passlib.utils.compat' (unknown location)

  • Replace passlib's password generation with a custom function.

  • Update copyright information in hash.py and clean up unused imports.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

* Replace passlib's password generation with a custom function.
* Update copyright information in hash.py and clean up unused imports.
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from passlib.utils.compat import str_to_uascii
from passlib.utils.handlers import GenericHandler, HasSalt, parse_mc2, render_mc2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this also with pythons stdlib?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would adding the dependency libpass to the requirements address this without changing this import? similar to inveniosoftware/flask-security-fork#91 or its not needed once merged?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, would work. i thought, since you replaced the pwd.genword function with an stdlib approach, it would be possible to replace the rest too.

adding libpass to flask-security-fork is enough, it doesn't have to be here too.

@Samk13 Samk13 added this to v14 Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants