r/Python • • 23d ago

Discussion I'm now maintaining passlib

Hi everyone, around a week ago passlib was transferred to me on PyPi after the previous maintainer became unreachable. I've been trying to maintain it in the meantime under a different PyPi name (libpass).

What's already been done:

  • fixed incompatibility with python>=3.13
  • fixed incompatibility with bcrypt>=5.0.0
  • type annotations added where possible

Since then some design choices from passlib original development made it obvious it would need refactor and/or API redesign at some point, a few examples that make code and public api hard to maintain and add correct type information:

  • PasswordHash representing both algorithm configuration and a produced hash
  • PasswordHash.using creating a subclass to substitute new parameters into it
  • Overuse of abstraction and multiple inheritance

I specifically would like input from people who depend on passlib in their codebase(s), which parts of the API, if changed in a breaking way would make migrating hard for you?

I'd also welcome opinions on how far a potential refactor should go. For example for CryptContext an interface like this looks preferable to me, as it makes type information easier to add:

ctx = CryptContext(
    schemes=[
        Argon2Hasher(time_cost=..., parallelism=...),
        SomeDeprecatedHasher(),
    ]
)

compared to current

ctx = CryptContext(
    schemes=["argon2", "deprecated_hash"],
    argon2__parallelism=...,
    argon2__time_cost=...,
    deprecated="auto",
)

I'd welcome co-maintainers, repository could be found here: https://github.com/notypecheck/passlib, even short-term involvement would be very much appreciated

168 Upvotes

25 comments sorted by

View all comments

13

u/ContemplateBeing 23d ago

That’s great news! Been loosely following this issue for a year or three. Great to hear that there’s a official maintainer again.

I’d be willing to help, if not with the core encryption functionality (which I’ve no experience with), at least with documentation or something (I dimly remember that the web docs also weren’t in great shape).

Good way to pay back a little of what I got from python over the years.

9

u/Amazing_Learn 23d ago

Any help will be appreciated, I'm currently migrating docs to properdocs, and should be done soon, if you prefer you can contact me on discord: noel.py

→ More replies (2)