diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2016-11-22 16:10:12 -0500 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2016-11-22 16:10:12 -0500 |
| commit | 359fdd3cbb88326bbf76aeea6f48bffbcf305f51 (patch) | |
| tree | 72387bd43c02a5095108540ca6a9649cf7c6baee /docs | |
| parent | 5d26ffc04d36740a1c695023e36b1ee8114dffa8 (diff) | |
| download | passlib-359fdd3cbb88326bbf76aeea6f48bffbcf305f51.tar.gz | |
passlib.ext.django: large refactor to make things more isolated & testable.
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.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/lib/passlib.ext.django.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/lib/passlib.ext.django.rst b/docs/lib/passlib.ext.django.rst index 8fd4e83..51097cc 100644 --- a/docs/lib/passlib.ext.django.rst +++ b/docs/lib/passlib.ext.django.rst @@ -12,6 +12,15 @@ As of Passlib 1.7, this module requires Django 1.8 or newer. +.. rst-class:: float-center without-title + +.. warning:: + + This extension is a high maintenance, with an uncertain number of users. + The current plan is to split this out as a separate package concurrent + with Passlib 1.8, and then judge whether it should continue to be maintained + in it's own right. See :issue:`81`. + This module contains a `Django <http://www.djangoproject.com>`_ plugin which overrides all of Django's password hashing functions, replacing them with wrappers around a Passlib :ref:`CryptContext <context-reference>` object @@ -126,6 +135,13 @@ Module Contents It can be imported and examined to inspect the current configuration, changes made to it will immediately alter how Django hashes passwords. + (Do not replace the reference with another CryptContext, it will break things; + just update the context in-place). + +.. function:: context_changed + + If the context is modified after loading, call this function to clear internal caches. + .. module:: passlib.ext.django.utils .. autofunction:: get_preset_config |
