Skip to content
Snippets Groups Projects
  1. Nov 23, 2016
  2. Nov 22, 2016
    • Eli Collins's avatar
    • Eli Collins's avatar
    • Eli Collins's avatar
      passlib.context: formalized how CryptContext stores deprecation info. · 0716705b6a2f
      Eli Collins authored
      now stored in public Hash.deprecated attr of returned hashers,
      instead of monkeypatching Hash.needs_update().
      this removes some cruft from a bunch of places.
      0716705b6a2f
    • Eli Collins's avatar
      passlib.ext.django: large refactor to make things more isolated & testable. · c0730e11a297
      Eli Collins authored
      passlib.ext.django
      ------------------
      * everything in .models relocated to the DjangoContextAdapter() class in .utils.
        all that's left in models is a couple of hooks. This consolidates all
        the model state into a single object, making it a lot easier to inspect
        and optimize.
      
      * consolidated a bunch of (undocumented) helper functions into DjangoTranslator()
        class, which now acts as based for DjangoContextAdapter.  Translator instances
        handle converted passlib <-> django hashers, including caching speed-critical bits.
      
      * wrapper class now has guards against wrong type of hasher being passed in
      
      * wrapper class uses .using() instead of deprecated .hash(**kwds) format.
      
      * updated and confirmed passing tests w/ django 1.10.3
      
      passlib.ext.django tests
      ------------------------
      * split test wrapper for django's internal tests (HashersTest) into separate file,
        test_ext_django_source.py, to make it easier to run independantly.
      
        reworked to use patchAttr(wraps=True) rather than less flexible ContextHook() hack
      
      * tries to clean up HashersTest - adapts to django settings,
        fixed code syncing .iteration settings back to passlib hashers,
      
      * blocked out some django tests that we can't / won't pass,
        documented reasons why.
      
      other
      -----
      * CryptContext: added temporary hack to access unpatched Hasher.needs_update() method.
      
      * PrefixWrapper: now proxies attr writes if it owns the wrapped hasher.
      
      * test utils: added wrap=True support to patchAttr(), for wrapping arbitrary functions.
      c0730e11a297
    • Eli Collins's avatar
      passlib.handlers.django: added support for django_argon2 · 52a1e3e0a5fb
      Eli Collins authored
      * added django_argon2 wrapper & docs
      
      * added method for PrefixWrapper to generically preserve custom attrs  when
        creating variants, so .django_name attr is persisted across .using() calls.
      52a1e3e0a5fb
  3. Nov 21, 2016
  4. Nov 20, 2016
  5. Nov 19, 2016
  6. Nov 11, 2016
    • Eli Collins's avatar
      hash: fix PyCharm autocompletion of passlib.hash · 72ea7cbf1bc2
      Eli Collins authored
      Issue for a while has been that IDEs such as PyCharm can't detect
      autocompletion in 'passlib.hash', because the module is replaced
      w/ a lazy-loading object, that breaks it's source inspection.
      
      As workaround, that module now contains a block listing all the imports
      explicitly.  This block is trapped in a "if False:" block so it will do nothing,
      but that seems sufficient for PyCharm to autocomplete with.
      
      Script "admin/regen.py" can be used to autogenerate this list when registry.py changes.
      72ea7cbf1bc2
Loading