libpass 1.8.2__tar.gz → 1.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libpass-1.8.2 → libpass-1.9.1}/.github/workflows/lint.yaml +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/.github/workflows/publish.yml +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/.github/workflows/test.yaml +2 -4
- {libpass-1.8.2 → libpass-1.9.1}/CHANGELOG.md +29 -1
- {libpass-1.8.2 → libpass-1.9.1}/PKG-INFO +1 -3
- {libpass-1.8.2 → libpass-1.9.1}/Taskfile.yml +1 -22
- {libpass-1.8.2 → libpass-1.9.1}/passlib/__init__.py +1 -1
- libpass-1.9.1/passlib/_logging.py +3 -0
- libpass-1.8.2/libpass/_utils/protocols.py → libpass-1.9.1/passlib/_protocols.py +4 -3
- {libpass-1.8.2 → libpass-1.9.1}/passlib/apache.py +95 -90
- {libpass-1.8.2 → libpass-1.9.1}/passlib/context.py +13 -13
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/_blowfish/base.py +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/des.py +1 -2
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/digest.py +12 -17
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/scrypt/__init__.py +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/passlib/ext/django/utils.py +5 -4
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/argon2.py +5 -5
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/bcrypt.py +14 -124
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/des_crypt.py +3 -46
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/django.py +2 -2
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/fshp.py +3 -3
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/ldap_digests.py +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/md5_crypt.py +2 -23
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/misc.py +2 -1
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/sha1_crypt.py +1 -23
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/sha2_crypt.py +2 -30
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/sun_md5_crypt.py +0 -1
- {libpass-1.8.2 → libpass-1.9.1}/passlib/pwd.py +3 -3
- {libpass-1.8.2 → libpass-1.9.1}/passlib/registry.py +8 -8
- {libpass-1.8.2 → libpass-1.9.1}/passlib/totp.py +4 -5
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/__init__.py +7 -129
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/handlers.py +9 -9
- {libpass-1.8.2 → libpass-1.9.1}/pyproject.toml +16 -18
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_apache.py +2 -2
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_apache_pytest.py +1 -1
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_crypto_builtin_md4.py +3 -3
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_crypto_des.py +9 -9
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_crypto_scrypt.py +5 -5
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_ext_django.py +14 -14
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers.py +3 -12
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_argon2.py +6 -8
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_bcrypt.py +0 -32
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_django.py +10 -10
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_pbkdf2.py +2 -2
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_hosts.py +3 -3
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_totp.py +7 -8
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_utils.py +0 -68
- {libpass-1.8.2 → libpass-1.9.1}/tests/utils.py +77 -107
- {libpass-1.8.2 → libpass-1.9.1}/uv.lock +566 -545
- libpass-1.8.2/libpass/__init__.py +0 -0
- libpass-1.8.2/libpass/_salt.py +0 -14
- libpass-1.8.2/libpass/_utils/__init__.py +0 -0
- libpass-1.8.2/libpass/_utils/base64.py +0 -14
- libpass-1.8.2/libpass/_utils/binary.py +0 -139
- libpass-1.8.2/libpass/_utils/bytes.py +0 -11
- libpass-1.8.2/libpass/_utils/const.py +0 -2
- libpass-1.8.2/libpass/_utils/deprecated.py +0 -66
- libpass-1.8.2/libpass/_utils/str.py +0 -9
- libpass-1.8.2/libpass/_utils/validation.py +0 -4
- libpass-1.8.2/libpass/context.py +0 -52
- libpass-1.8.2/libpass/errors.py +0 -2
- libpass-1.8.2/libpass/hashers/__init__.py +0 -0
- libpass-1.8.2/libpass/hashers/abc.py +0 -17
- libpass-1.8.2/libpass/hashers/argon2.py +0 -48
- libpass-1.8.2/libpass/hashers/bcrypt.py +0 -137
- libpass-1.8.2/libpass/hashers/django.py +0 -42
- libpass-1.8.2/libpass/hashers/pbkdf2.py +0 -117
- libpass-1.8.2/libpass/hashers/sha_crypt.py +0 -358
- libpass-1.8.2/libpass/inspect/__init__.py +0 -0
- libpass-1.8.2/libpass/inspect/bcrypt.py +0 -36
- libpass-1.8.2/libpass/inspect/django.py +0 -20
- libpass-1.8.2/libpass/inspect/pbkdf2.py +0 -56
- libpass-1.8.2/libpass/inspect/phc/__init__.py +0 -3
- libpass-1.8.2/libpass/inspect/phc/_phc.py +0 -144
- libpass-1.8.2/libpass/inspect/phc/defs.py +0 -33
- libpass-1.8.2/libpass/inspect/sha_crypt.py +0 -59
- libpass-1.8.2/libpass/py.typed +0 -0
- libpass-1.8.2/tests/libpass/__init__.py +0 -0
- libpass-1.8.2/tests/libpass/hashers/__init__.py +0 -0
- libpass-1.8.2/tests/libpass/hashers/test_argon2.py +0 -213
- libpass-1.8.2/tests/libpass/hashers/test_bcrypt.py +0 -165
- libpass-1.8.2/tests/libpass/hashers/test_bcrypt_sha256.py +0 -115
- libpass-1.8.2/tests/libpass/hashers/test_django.py +0 -111
- libpass-1.8.2/tests/libpass/hashers/test_pbkdf2.py +0 -139
- libpass-1.8.2/tests/libpass/hashers/test_sha_crypt.py +0 -309
- libpass-1.8.2/tests/libpass/inspect/__init__.py +0 -0
- libpass-1.8.2/tests/libpass/inspect/test_inspect.py +0 -77
- libpass-1.8.2/tests/libpass/test_arch.py +0 -10
- libpass-1.8.2/tests/libpass/test_context.py +0 -73
- libpass-1.8.2/tox.ini +0 -203
- {libpass-1.8.2 → libpass-1.9.1}/.git-blame-ignore-revs +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/.gitignore +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/LICENSE +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/README.md +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_fragments/asa_verify_callout.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_fragments/insecure_hash_warning.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_fragments/trivial_hash_warning.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/bb-logo.png +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/bb-logo.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/logo-128.png +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/logo-64.png +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/logo.ico +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/logo.png +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/logo.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/masthead.png +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/_static/masthead.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/conf.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/contents.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/copyright.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/dev-requirements.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/faq.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/1.5.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/1.6.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/1.7.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/1.8.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/ancient.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/history.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/install.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.apache.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.apps.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.context-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.context.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.crypto.des.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.crypto.digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.crypto.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.exc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.ext.django.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.apr_md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.argon2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.atlassian_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.bcrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.bcrypt_sha256.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.bigcrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.bsdi_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.cisco_asa.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.cisco_pix.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.cisco_type7.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.crypt16.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.cta_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.des_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.django_std.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.dlitz_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.fshp.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.grub_pbkdf2_sha512.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.hex_digests.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.ldap_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.ldap_other.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.ldap_pbkdf2_digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.ldap_std.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.lmhash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.msdcc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.msdcc2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.mssql2000.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.mssql2005.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.mysql323.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.mysql41.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.nthash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.oracle10.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.oracle11.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.pbkdf2_digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.phpass.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.plaintext.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.postgres_md5.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.scram.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.scrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.sha1_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.sha256_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.sha512_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.sun_md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hash.unix_disabled.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.hosts.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.ifc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.pwd.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.registry.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.totp.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.binary.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.compat.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.des.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.handlers.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.pbkdf2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/lib/passlib.utils.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/modular_crypt_format.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/context-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/hash-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/overview.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/quickstart.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/narr/totp-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/new_app_quickstart.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/other.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/overview.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/password_hash_api.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/docs/requirements.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/_data/wordsets/bip39.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/_data/wordsets/eff_long.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/_data/wordsets/eff_prefixed.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/_data/wordsets/eff_short.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/apps.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/_blowfish/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/_blowfish/_gen_files.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/_blowfish/unrolled.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/_md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/scrypt/_builtin.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/scrypt/_gen_files.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/crypto/scrypt/_salsa.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/exc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/ext/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/ext/django/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/ext/django/models.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/cisco.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/digests.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/mssql.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/mysql.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/oracle.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/phpass.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/postgres.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/roundup.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/scram.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/scrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/handlers/windows.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/hash.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/hosts.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/ifc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/binary.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/compat/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/decor.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/des.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/passlib/utils/pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/_test_bad_register.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/sample1.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/sample1b.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/sample1c.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/sample_config_1s.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_apps.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_context.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_crypto_digest.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_cisco.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_handlers_scrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_pwd.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_registry.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_utils_handlers.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_utils_md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/test_utils_pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.1}/tests/utils_.py +0 -0
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
python-version: ${{ matrix.python-version }}
|
|
17
17
|
|
|
18
18
|
- name: Install uv
|
|
19
|
-
uses: astral-sh/setup-uv@
|
|
19
|
+
uses: astral-sh/setup-uv@v5
|
|
20
20
|
with:
|
|
21
21
|
enable-cache: true
|
|
22
22
|
|
|
@@ -24,6 +24,4 @@ jobs:
|
|
|
24
24
|
run: uv sync --all-extras --all-groups
|
|
25
25
|
|
|
26
26
|
- run: |
|
|
27
|
-
uv run
|
|
28
|
-
uv run coverage report -m
|
|
29
|
-
uv run coverage xml
|
|
27
|
+
uv run pytest -n auto --cov
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
## 1.
|
|
1
|
+
## 1.9.1 (2025-05-02)
|
|
2
|
+
|
|
3
|
+
### Fix
|
|
4
|
+
|
|
5
|
+
- don't use root logger
|
|
6
|
+
|
|
7
|
+
### Refactor
|
|
8
|
+
|
|
9
|
+
- **apache**: improve typing of HtpasswdFile and HtdigestFile
|
|
10
|
+
- enable ruff "INP" rule
|
|
11
|
+
- enable ruff "PLW" rule
|
|
12
|
+
- enable ruff "PLC" rule
|
|
13
|
+
|
|
14
|
+
## 1.9.0 (2025-02-18)
|
|
15
|
+
|
|
16
|
+
### Refactor
|
|
17
|
+
|
|
18
|
+
- remove dependency on crypt
|
|
19
|
+
- **libpass**: use functools.cached_property for CryptContext active schemes
|
|
20
|
+
|
|
21
|
+
## 1.8.2 (2025-02-13)
|
|
22
|
+
|
|
23
|
+
### Feat
|
|
24
|
+
|
|
25
|
+
- add django pbkdf2_sha256 and pbkdf2_sha1 hashers
|
|
26
|
+
- add pbkdf2 sha_256 and sha_512 hashes
|
|
27
|
+
- add PasswordHasher.needs_update method
|
|
28
|
+
- add argon2 hasher
|
|
29
|
+
- add CryptContext class
|
|
2
30
|
|
|
3
31
|
### Fix
|
|
4
32
|
- add python 3.13 compatability
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libpass
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.1
|
|
4
4
|
Summary: Fork of passlib, a comprehensive password hashing framework supporting over 30 schemes
|
|
5
5
|
Project-URL: Homepage, https://github.com/ThirVondukr/passlib
|
|
6
6
|
Project-URL: Repository, https://github.com/ThirVondukr/passlib
|
|
@@ -27,8 +27,6 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
27
27
|
Classifier: Topic :: Security :: Cryptography
|
|
28
28
|
Classifier: Topic :: Software Development :: Libraries
|
|
29
29
|
Requires-Python: >=3.9
|
|
30
|
-
Requires-Dist: legacycrypt>=0.3
|
|
31
|
-
Requires-Dist: typing-extensions>=4.6.0
|
|
32
30
|
Provides-Extra: argon2
|
|
33
31
|
Requires-Dist: argon2-cffi>=18.2.0; extra == 'argon2'
|
|
34
32
|
Provides-Extra: bcrypt
|
|
@@ -34,29 +34,8 @@ tasks:
|
|
|
34
34
|
|
|
35
35
|
test:
|
|
36
36
|
desc: Run tests
|
|
37
|
-
cmd: "{{.RUNNER}} pytest -n auto"
|
|
38
|
-
|
|
39
|
-
testcov:
|
|
40
|
-
desc: Run tests and generate a coverage report
|
|
41
|
-
cmds:
|
|
42
|
-
- "{{.RUNNER}} coverage run"
|
|
43
|
-
- "{{.RUNNER}} coverage report -m"
|
|
44
|
-
- "{{.RUNNER}} coverage xml"
|
|
45
|
-
|
|
46
|
-
testcov-libpass:
|
|
47
37
|
cmds:
|
|
48
|
-
- "{{.RUNNER}}
|
|
49
|
-
- '{{.RUNNER}} coverage report -m --include "libpass/*"'
|
|
50
|
-
- "{{.RUNNER}} coverage xml"
|
|
51
|
-
|
|
52
|
-
libpass:
|
|
53
|
-
vars:
|
|
54
|
-
SOURCES: libpass tests/libpass
|
|
55
|
-
cmds:
|
|
56
|
-
- task: format
|
|
57
|
-
- "{{.RUNNER}} mypy {{.SOURCES}}"
|
|
58
|
-
- "{{.RUNNER}} pytest tests/libpass"
|
|
59
|
-
|
|
38
|
+
- "{{.RUNNER}} pytest -n auto --cov"
|
|
60
39
|
|
|
61
40
|
all:
|
|
62
41
|
desc: Run the standard set of checks performed in CI
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Callable, Protocol
|
|
3
|
+
from typing import TYPE_CHECKING, Callable, Protocol
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from typing_extensions import Buffer, Self
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class HashLike(Protocol):
|
|
9
|
-
"""Lifted from hashlib.pyi"""
|
|
10
|
+
"""Lifted from hashlib.pyi."""
|
|
10
11
|
|
|
11
12
|
@property
|
|
12
13
|
def digest_size(self) -> int: ...
|
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
# XXX: relocate this to passlib.ext.apache?
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
-
import logging
|
|
7
6
|
import os
|
|
8
7
|
from io import BytesIO
|
|
9
8
|
from os import PathLike
|
|
10
|
-
from typing import Literal
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, Union, cast
|
|
11
10
|
from warnings import warn
|
|
12
11
|
|
|
12
|
+
from passlib._logging import logger
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from collections.abc import Iterable, Iterator
|
|
16
|
+
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
|
|
13
19
|
from passlib import exc, registry
|
|
14
20
|
from passlib.context import CryptContext
|
|
15
21
|
from passlib.exc import ExpectedStringError
|
|
@@ -32,37 +38,60 @@ _BHASH = b"#"
|
|
|
32
38
|
_INVALID_FIELD_CHARS = b":\n\r\t\x00"
|
|
33
39
|
|
|
34
40
|
#: _CommonFile._source token types
|
|
35
|
-
_SKIPPED = "skipped"
|
|
36
|
-
_RECORD = "record"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
_SKIPPED: Literal["skipped"] = "skipped"
|
|
42
|
+
_RECORD: Literal["record"] = "record"
|
|
43
|
+
_TRecordKey = TypeVar("_TRecordKey")
|
|
44
|
+
|
|
45
|
+
if TYPE_CHECKING:
|
|
46
|
+
_SourceTypes = Union[
|
|
47
|
+
tuple[Literal["skipped"], bytes],
|
|
48
|
+
tuple[Literal["record"], _TRecordKey],
|
|
49
|
+
]
|
|
50
|
+
else:
|
|
51
|
+
_SourceTypes = None
|
|
41
52
|
|
|
42
|
-
# charset encoding used by file (defaults to utf-8)
|
|
43
|
-
encoding = None
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return_unicode = True
|
|
54
|
+
class _CommonFile(Generic[_TRecordKey]):
|
|
55
|
+
"""Common framework for HtpasswdFile & HtdigestFile"""
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
def __init__(
|
|
58
|
+
self,
|
|
59
|
+
path: PathLike | None = None,
|
|
60
|
+
new: bool = False,
|
|
61
|
+
autosave: bool = False,
|
|
62
|
+
encoding: str = "utf-8",
|
|
63
|
+
return_unicode: bool = True,
|
|
64
|
+
) -> None:
|
|
65
|
+
# set encoding
|
|
66
|
+
if not encoding:
|
|
67
|
+
raise TypeError("'encoding' is required")
|
|
68
|
+
if not is_ascii_codec(encoding):
|
|
69
|
+
# htpasswd/htdigest files assumes 1-byte chars, and use ":" separator,
|
|
70
|
+
# so only ascii-compatible encodings are allowed.
|
|
71
|
+
raise ValueError("encoding must be 7-bit ascii compatible")
|
|
52
72
|
|
|
53
|
-
|
|
54
|
-
|
|
73
|
+
# charset encoding used by file (defaults to utf-8)
|
|
74
|
+
self.encoding = encoding
|
|
75
|
+
# whether users() and other public methods should return str or bytes?
|
|
76
|
+
self.return_unicode = return_unicode
|
|
77
|
+
# if true, automatically save to local file after changes are made.
|
|
78
|
+
self.autosave = autosave
|
|
79
|
+
self._path = path # local file path
|
|
80
|
+
self._mtime: float = 0 # mtime when last loaded, or 0
|
|
55
81
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
82
|
+
# dict mapping key -> value for all records in database.
|
|
83
|
+
# (e.g. user => hash for Htpasswd)
|
|
84
|
+
self._records: dict[_TRecordKey, str] = {}
|
|
85
|
+
#: list of tokens for recreating original file contents when saving. if present,
|
|
86
|
+
#: will be sequence of (_SKIPPED, b"whitespace/comments") and (_RECORD, <record key>) tuples.
|
|
87
|
+
self._source: list[_SourceTypes] = []
|
|
59
88
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
89
|
+
# init db
|
|
90
|
+
if path and not new:
|
|
91
|
+
self.load()
|
|
63
92
|
|
|
64
93
|
@classmethod
|
|
65
|
-
def from_string(cls, data, **
|
|
94
|
+
def from_string(cls, data: str | bytes, **kwargs: Any) -> Self:
|
|
66
95
|
"""create new object from raw string.
|
|
67
96
|
|
|
68
97
|
:type data: str or bytes
|
|
@@ -72,14 +101,14 @@ class _CommonFile:
|
|
|
72
101
|
:param \\*\\*kwds:
|
|
73
102
|
all other keywords are the same as in the class constructor
|
|
74
103
|
"""
|
|
75
|
-
if "path" in
|
|
104
|
+
if "path" in kwargs:
|
|
76
105
|
raise TypeError("'path' not accepted by from_string()")
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return
|
|
106
|
+
instance = cls(**kwargs)
|
|
107
|
+
instance.load_string(data)
|
|
108
|
+
return instance
|
|
80
109
|
|
|
81
110
|
@classmethod
|
|
82
|
-
def from_path(cls, path: PathLike, **kwds):
|
|
111
|
+
def from_path(cls, path: PathLike, **kwds: Any) -> Self:
|
|
83
112
|
"""create new object from file, without binding object to file.
|
|
84
113
|
|
|
85
114
|
:type path: str
|
|
@@ -95,37 +124,7 @@ class _CommonFile:
|
|
|
95
124
|
|
|
96
125
|
# XXX: add a new() classmethod, ala TOTP.new()?
|
|
97
126
|
|
|
98
|
-
def
|
|
99
|
-
self,
|
|
100
|
-
path=None,
|
|
101
|
-
new=False,
|
|
102
|
-
autosave=False,
|
|
103
|
-
encoding="utf-8",
|
|
104
|
-
return_unicode=True,
|
|
105
|
-
):
|
|
106
|
-
# set encoding
|
|
107
|
-
if not encoding:
|
|
108
|
-
raise TypeError("'encoding' is required")
|
|
109
|
-
if not is_ascii_codec(encoding):
|
|
110
|
-
# htpasswd/htdigest files assumes 1-byte chars, and use ":" separator,
|
|
111
|
-
# so only ascii-compatible encodings are allowed.
|
|
112
|
-
raise ValueError("encoding must be 7-bit ascii compatible")
|
|
113
|
-
self.encoding = encoding
|
|
114
|
-
|
|
115
|
-
# set other attrs
|
|
116
|
-
self.return_unicode = return_unicode
|
|
117
|
-
self.autosave = autosave
|
|
118
|
-
self._path = path
|
|
119
|
-
self._mtime = 0
|
|
120
|
-
|
|
121
|
-
# init db
|
|
122
|
-
if path and not new:
|
|
123
|
-
self.load()
|
|
124
|
-
else:
|
|
125
|
-
self._records = {}
|
|
126
|
-
self._source = []
|
|
127
|
-
|
|
128
|
-
def __repr__(self):
|
|
127
|
+
def __repr__(self) -> str:
|
|
129
128
|
tail = ""
|
|
130
129
|
if self.autosave:
|
|
131
130
|
tail += " autosave=True"
|
|
@@ -138,21 +137,21 @@ class _CommonFile:
|
|
|
138
137
|
# NOTE: ``path`` is a property so that ``_mtime`` is wiped when it's set.
|
|
139
138
|
|
|
140
139
|
@property
|
|
141
|
-
def path(self):
|
|
140
|
+
def path(self) -> PathLike | None:
|
|
142
141
|
return self._path
|
|
143
142
|
|
|
144
143
|
@path.setter
|
|
145
|
-
def path(self, value):
|
|
144
|
+
def path(self, value: PathLike | None) -> None:
|
|
146
145
|
if value != self._path:
|
|
147
146
|
self._mtime = 0
|
|
148
147
|
self._path = value
|
|
149
148
|
|
|
150
149
|
@property
|
|
151
|
-
def mtime(self):
|
|
150
|
+
def mtime(self) -> float:
|
|
152
151
|
"""modify time when last loaded (if bound to a local file)"""
|
|
153
152
|
return self._mtime
|
|
154
153
|
|
|
155
|
-
def load_if_changed(self):
|
|
154
|
+
def load_if_changed(self) -> bool:
|
|
156
155
|
"""Reload from ``self.path`` only if file has changed since last load"""
|
|
157
156
|
if not self._path:
|
|
158
157
|
raise RuntimeError(f"{self!r} is not bound to a local file")
|
|
@@ -161,7 +160,7 @@ class _CommonFile:
|
|
|
161
160
|
self.load()
|
|
162
161
|
return True
|
|
163
162
|
|
|
164
|
-
def load(self, path: PathLike | None = None) ->
|
|
163
|
+
def load(self, path: PathLike | None = None) -> bool:
|
|
165
164
|
"""Load state from local file.
|
|
166
165
|
If no path is specified, attempts to load from ``self.path``.
|
|
167
166
|
|
|
@@ -182,17 +181,15 @@ class _CommonFile:
|
|
|
182
181
|
)
|
|
183
182
|
return True
|
|
184
183
|
|
|
185
|
-
def load_string(self, data):
|
|
184
|
+
def load_string(self, data: str | bytes) -> None:
|
|
186
185
|
"""Load state from unicode or bytes string, replacing current state"""
|
|
187
|
-
data = to_bytes(data, self.encoding, "data")
|
|
188
186
|
self._mtime = 0
|
|
189
|
-
self._load_lines(BytesIO(data))
|
|
187
|
+
self._load_lines(BytesIO(to_bytes(data, self.encoding, "data")))
|
|
190
188
|
|
|
191
|
-
def _load_lines(self, lines):
|
|
189
|
+
def _load_lines(self, lines: Iterable[bytes]) -> None:
|
|
192
190
|
"""load from sequence of lists"""
|
|
193
|
-
parse = self._parse_record
|
|
194
191
|
records = {}
|
|
195
|
-
source = []
|
|
192
|
+
source: list[_SourceTypes] = []
|
|
196
193
|
skipped = b""
|
|
197
194
|
for idx, line in enumerate(lines):
|
|
198
195
|
# NOTE: per htpasswd source (https://github.com/apache/httpd/blob/trunk/support/htpasswd.c),
|
|
@@ -204,12 +201,12 @@ class _CommonFile:
|
|
|
204
201
|
continue
|
|
205
202
|
|
|
206
203
|
# parse valid line
|
|
207
|
-
key, value =
|
|
204
|
+
key, value = self._parse_record(line, idx + 1)
|
|
208
205
|
|
|
209
206
|
# NOTE: if multiple entries for a key, we use the first one,
|
|
210
207
|
# which seems to match htpasswd source
|
|
211
208
|
if key in records:
|
|
212
|
-
|
|
209
|
+
logger.warning(
|
|
213
210
|
"username occurs multiple times in source file: %r",
|
|
214
211
|
key,
|
|
215
212
|
)
|
|
@@ -233,30 +230,31 @@ class _CommonFile:
|
|
|
233
230
|
self._records = records
|
|
234
231
|
self._source = source
|
|
235
232
|
|
|
236
|
-
def _parse_record(
|
|
233
|
+
def _parse_record(
|
|
234
|
+
self, record: bytes, lineno: int
|
|
235
|
+
) -> tuple[_TRecordKey, Any]: # pragma: no cover - abstract method
|
|
237
236
|
"""parse line of file into (key, value) pair"""
|
|
238
237
|
raise NotImplementedError("should be implemented in subclass")
|
|
239
238
|
|
|
240
|
-
def _set_record(self, key, value):
|
|
239
|
+
def _set_record(self, key: _TRecordKey, value: Any) -> bool:
|
|
241
240
|
"""
|
|
242
241
|
helper for setting record which takes care of inserting source line if needed;
|
|
243
242
|
|
|
244
243
|
:returns:
|
|
245
244
|
bool if key already present
|
|
246
245
|
"""
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
records[key] = value
|
|
246
|
+
existing = key in self._records
|
|
247
|
+
self._records[key] = value
|
|
250
248
|
if not existing:
|
|
251
249
|
self._source.append((_RECORD, key))
|
|
252
250
|
return existing
|
|
253
251
|
|
|
254
|
-
def _autosave(self):
|
|
252
|
+
def _autosave(self) -> None:
|
|
255
253
|
"""subclass helper to call save() after any changes"""
|
|
256
254
|
if self.autosave and self._path:
|
|
257
255
|
self.save()
|
|
258
256
|
|
|
259
|
-
def save(self, path=None):
|
|
257
|
+
def save(self, path: PathLike | None = None) -> None:
|
|
260
258
|
"""Save current state to file.
|
|
261
259
|
If no path is specified, attempts to save to ``self.path``.
|
|
262
260
|
"""
|
|
@@ -271,7 +269,7 @@ class _CommonFile:
|
|
|
271
269
|
f"{self.__class__.__name__}().path is not set, cannot autosave"
|
|
272
270
|
)
|
|
273
271
|
|
|
274
|
-
def to_string(self):
|
|
272
|
+
def to_string(self) -> bytes:
|
|
275
273
|
"""Export current state as a string of bytes"""
|
|
276
274
|
return join_bytes(self._iter_lines())
|
|
277
275
|
|
|
@@ -283,7 +281,7 @@ class _CommonFile:
|
|
|
283
281
|
# self._source = [(_RECORD, key) for key in sorted(self._records)]
|
|
284
282
|
# self._autosave()
|
|
285
283
|
|
|
286
|
-
def _iter_lines(self):
|
|
284
|
+
def _iter_lines(self) -> Iterator[Any]:
|
|
287
285
|
"""iterator yielding lines of database"""
|
|
288
286
|
# NOTE: this relies on <records> being an OrderedDict so that it outputs
|
|
289
287
|
# records in a deterministic order.
|
|
@@ -296,6 +294,10 @@ class _CommonFile:
|
|
|
296
294
|
yield content
|
|
297
295
|
else:
|
|
298
296
|
assert action == _RECORD
|
|
297
|
+
content = cast(
|
|
298
|
+
"_TRecordKey", content
|
|
299
|
+
) # Should be _TRecordKey at this point
|
|
300
|
+
|
|
299
301
|
# 'content' is record key
|
|
300
302
|
if content not in records:
|
|
301
303
|
# record was deleted
|
|
@@ -314,15 +316,17 @@ class _CommonFile:
|
|
|
314
316
|
"""given key/value pair, encode as line of file"""
|
|
315
317
|
raise NotImplementedError("should be implemented in subclass")
|
|
316
318
|
|
|
317
|
-
def _encode_user(self, user):
|
|
319
|
+
def _encode_user(self, user: str | bytes) -> bytes:
|
|
318
320
|
"""user-specific wrapper for _encode_field()"""
|
|
319
321
|
return self._encode_field(user, "user")
|
|
320
322
|
|
|
321
|
-
def _encode_realm(
|
|
323
|
+
def _encode_realm(
|
|
324
|
+
self, realm: str | bytes
|
|
325
|
+
) -> bytes: # pragma: no cover - abstract method
|
|
322
326
|
"""realm-specific wrapper for _encode_field()"""
|
|
323
327
|
return self._encode_field(realm, "realm")
|
|
324
328
|
|
|
325
|
-
def _encode_field(self, value, param="field"):
|
|
329
|
+
def _encode_field(self, value: str | bytes, param="field") -> bytes:
|
|
326
330
|
"""convert field to internal representation.
|
|
327
331
|
|
|
328
332
|
internal representation is always bytes. byte strings are left as-is,
|
|
@@ -343,13 +347,14 @@ class _CommonFile:
|
|
|
343
347
|
value = value.encode(self.encoding)
|
|
344
348
|
elif not isinstance(value, bytes):
|
|
345
349
|
raise ExpectedStringError(value, param)
|
|
350
|
+
|
|
346
351
|
if len(value) > 255:
|
|
347
352
|
raise ValueError(f"{param} must be at most 255 characters: {value!r}")
|
|
348
353
|
if any(c in _INVALID_FIELD_CHARS for c in value):
|
|
349
354
|
raise ValueError(f"{param} contains invalid characters: {value!r}")
|
|
350
355
|
return value
|
|
351
356
|
|
|
352
|
-
def _decode_field(self, value):
|
|
357
|
+
def _decode_field(self, value: bytes) -> bytes | str:
|
|
353
358
|
"""decode field from internal representation to format
|
|
354
359
|
returns by users() method, etc.
|
|
355
360
|
|
|
@@ -481,7 +486,7 @@ def _init_htpasswd_context():
|
|
|
481
486
|
htpasswd_context = _init_htpasswd_context()
|
|
482
487
|
|
|
483
488
|
|
|
484
|
-
class HtpasswdFile(_CommonFile):
|
|
489
|
+
class HtpasswdFile(_CommonFile[bytes]):
|
|
485
490
|
"""class for reading & writing Htpasswd files.
|
|
486
491
|
|
|
487
492
|
The class constructor accepts the following arguments:
|
|
@@ -667,7 +672,7 @@ class HtpasswdFile(_CommonFile):
|
|
|
667
672
|
def _render_record(self, user, hash):
|
|
668
673
|
return render_bytes("%s:%s\n", user, hash)
|
|
669
674
|
|
|
670
|
-
def users(self):
|
|
675
|
+
def users(self) -> list[bytes | str]:
|
|
671
676
|
"""
|
|
672
677
|
Return list of all users in database
|
|
673
678
|
"""
|
|
@@ -777,7 +782,7 @@ class HtpasswdFile(_CommonFile):
|
|
|
777
782
|
return ok
|
|
778
783
|
|
|
779
784
|
|
|
780
|
-
class HtdigestFile(_CommonFile):
|
|
785
|
+
class HtdigestFile(_CommonFile[tuple[bytes, bytes]]):
|
|
781
786
|
"""class for reading & writing Htdigest files.
|
|
782
787
|
|
|
783
788
|
The class constructor accepts the following arguments:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import re
|
|
2
4
|
from configparser import ConfigParser
|
|
3
5
|
from io import StringIO
|
|
@@ -30,7 +32,7 @@ __all__ = [
|
|
|
30
32
|
_UNSET = object()
|
|
31
33
|
|
|
32
34
|
|
|
33
|
-
def _coerce_vary_rounds(value):
|
|
35
|
+
def _coerce_vary_rounds(value: str) -> float | int:
|
|
34
36
|
"""parse vary_rounds string to percent as [0,1) float, or integer"""
|
|
35
37
|
if value.endswith("%"):
|
|
36
38
|
# XXX: deprecate this in favor of raw float?
|
|
@@ -251,8 +253,7 @@ class _CryptConfig:
|
|
|
251
253
|
# should do it in 1.8 at latest.
|
|
252
254
|
if len(value) > 1:
|
|
253
255
|
raise ValueError(
|
|
254
|
-
"cannot list other schemes if "
|
|
255
|
-
"``deprecated=['auto']`` is used"
|
|
256
|
+
"cannot list other schemes if ``deprecated=['auto']`` is used"
|
|
256
257
|
)
|
|
257
258
|
elif schemes:
|
|
258
259
|
# make sure list of deprecated schemes is subset of configured schemes
|
|
@@ -1191,8 +1192,7 @@ class CryptContext:
|
|
|
1191
1192
|
pass
|
|
1192
1193
|
if self._config.handlers:
|
|
1193
1194
|
raise KeyError(
|
|
1194
|
-
"crypt algorithm not found in this "
|
|
1195
|
-
f"CryptContext instance: {scheme!r}"
|
|
1195
|
+
f"crypt algorithm not found in this CryptContext instance: {scheme!r}"
|
|
1196
1196
|
)
|
|
1197
1197
|
raise KeyError("no crypt algorithms loaded in this CryptContext instance")
|
|
1198
1198
|
|
|
@@ -1280,17 +1280,17 @@ class CryptContext:
|
|
|
1280
1280
|
(render_key(key), value) for key, value in self._config.iter_config(resolve)
|
|
1281
1281
|
)
|
|
1282
1282
|
|
|
1283
|
-
def _write_to_parser(self, parser, section):
|
|
1283
|
+
def _write_to_parser(self, parser: ConfigParser, section: str) -> None:
|
|
1284
1284
|
"""helper to write to ConfigParser instance"""
|
|
1285
|
-
render_key = self._render_config_key
|
|
1286
|
-
render_value = self._render_ini_value
|
|
1287
1285
|
parser.add_section(section)
|
|
1288
|
-
for
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1286
|
+
for key, value in self._config.iter_config(): # type: ignore[attr-defined]
|
|
1287
|
+
parser.set(
|
|
1288
|
+
section=section,
|
|
1289
|
+
option=self._render_config_key(key),
|
|
1290
|
+
value=self._render_ini_value(key, value),
|
|
1291
|
+
)
|
|
1292
1292
|
|
|
1293
|
-
def to_string(self, section="passlib"):
|
|
1293
|
+
def to_string(self, section="passlib") -> str:
|
|
1294
1294
|
"""serialize to INI format and return as unicode string.
|
|
1295
1295
|
|
|
1296
1296
|
:param section:
|
|
@@ -15,7 +15,7 @@ BLOWFISH_P = BLOWFISH_S = None
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def _init_constants():
|
|
18
|
-
global BLOWFISH_P, BLOWFISH_S
|
|
18
|
+
global BLOWFISH_P, BLOWFISH_S # noqa: PLW0603
|
|
19
19
|
|
|
20
20
|
# NOTE: blowfish's spec states these numbers are the hex representation
|
|
21
21
|
# of the fractional portion of PI, in order.
|
|
@@ -72,7 +72,7 @@ PCXROT = IE3264 = SPE = CF6464 = None
|
|
|
72
72
|
|
|
73
73
|
def _load_tables():
|
|
74
74
|
"""delay loading tables until they are actually needed"""
|
|
75
|
-
global PCXROT, IE3264, SPE, CF6464
|
|
75
|
+
global PCXROT, IE3264, SPE, CF6464 # noqa: PLW0603
|
|
76
76
|
|
|
77
77
|
# ---------------------------------------------------------------
|
|
78
78
|
# Initial key schedule permutation
|
|
@@ -2160,7 +2160,6 @@ def des_encrypt_int_block(key, input, salt=0, rounds=1):
|
|
|
2160
2160
|
# DES setup
|
|
2161
2161
|
# ---------------------------------------------------------------
|
|
2162
2162
|
# load tables if not already done
|
|
2163
|
-
global SPE, PCXROT, IE3264, CF6464
|
|
2164
2163
|
if PCXROT is None:
|
|
2165
2164
|
_load_tables()
|
|
2166
2165
|
|