Python Pam Versions Save

Python pam module supporting py3 (py2 support still exists but is deprecated)

v2.0.2

2 years ago

Surface fixes

  • Fixed #31 whereby I changed the boolean response in 2.0.0 to a PAM constant. This reverts to the boolean response as existed in v1.8.5. The result code is still stored in the obj.code attribute
  • Added the PamAuthenticate.authenticate() method signature and docstring to both of the new and legacy interfaces
  • Changed the PamAuthenticate.authenticate() type hinting so it didn't interfere with the docstring
  • update the version to 2.0.2

Under the hood changes

  • Start mocking the libpam methods so we can wholly disassociate ourselves from the underlying system. This lets us test more of the actual python code and lets us start injecting errors to test for

v2.0.0

2 years ago

Release 2.0.0

The surface functionality hasn't changed much but a few bugs have been fixed. Under the hood, a lot has changed. Functionality has now been moved into a class that helped with value tracking. I planned on removing Python 2 support but was convinced to leave it in for now as apparently there are still a lot of python2 users. :confused: :man_shrugging:

Most testing has moved to occur underneath tox, this is superior as it provides for testing in a clean environment and an installed environment.

Merges

  • #22, #24, #25 by @abompard
  • #21 by @spaceone and @lauriereeves
  • #16 by @okin
  • #14 by @codypiersall
  • #11 by @e4r7hbug and @hugovk
  • #5 by @willmo
  • #4 by @skylize
  • #3 by @fatlotus

Bugs fixed

  • Documentation in the README.md is updated, the new method of authentication is pam.authenticate(...) vs. pam.pam(...) (but it's still supported). Thank you @gkmcd. Some by-hand pam_unix.so and unix_chkpwd examples provided for testing
  • @leewi9 pointed out that TTY handling was less than optimal in some situations in #18
  • #12 resolved by @okin and #8 was also solved by this patch

Features & Changes

  • Unit testing and code coverage is 100% for all automated methods. Some methods require a valid TEST_USERNAME and TEST_PASSWORD to function and those are marked SKIP if not found in the environment. Sorry :-} -- mocking the internals of libc and libpam are far too hairy for the trivial bit of testing that can be verified by hand
    Testing summary
    Name Stmts Miss Excluded Branch BrPart Cover
    pam/__init__.py 59 0 2 2 0 100%
    pam/__internals.py 281 0 14 76 0 100%
    TOTAL 340 0 16 78 0 100%
  • bandit added for security checks
  • flake8 added for linting
  • mypy for type hinting
  • coverage added (generated reports go in htmlcov/
  • Multi-factor authentication is supported now from #25 @abompard
  • All of the constants are now exposed such as pam.PAM_SUCCESS or pam.PAM_PERM_DENIED
  • pam.authenticate(..., print_failure_messages=False) parameter was added to help your debugging