2015-07-20 01:11:28 +02:00
|
|
|
Implementing password policy modules
|
|
|
|
====================================
|
2015-07-17 08:30:32 +02:00
|
|
|
|
2015-07-20 01:11:28 +02:00
|
|
|
API
|
|
|
|
---
|
|
|
|
|
|
|
|
The password policy modules must respect following API:
|
|
|
|
|
|
|
|
.. autoclass:: ldapcherry.ppolicy.PPolicy
|
|
|
|
:members: check, info, __init__
|
2015-07-20 01:30:12 +02:00
|
|
|
:undoc-members:
|
2015-07-17 08:30:32 +02:00
|
|
|
:show-inheritance:
|
2015-07-20 01:11:28 +02:00
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Parameters are declared in the main configuration file, inside the **ppolicy** section.
|
|
|
|
|
|
|
|
After having set **self.config** to **config** in the constructor, parameters can be recovered
|
|
|
|
by **self.get_param**:
|
|
|
|
|
|
|
|
.. autoclass:: ldapcherry.ppolicy.PPolicy
|
|
|
|
:members: get_param
|
|
|
|
:undoc-members: check
|
|
|
|
:show-inheritance:
|
|
|
|
|
|
|
|
Example
|
|
|
|
-------
|
|
|
|
|
|
|
|
Here is the simple default ppolicy module that comes with LdapCherry:
|
|
|
|
|
|
|
|
.. literalinclude:: ../ldapcherry/ppolicy/simple.py
|
|
|
|
:language: python
|
|
|
|
|