1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 09:24:21 +01:00
This commit is contained in:
kakwa 2015-07-18 00:35:28 +02:00
commit 1456d1674a
6 changed files with 64 additions and 17 deletions

8
docs/backend_api.rst Normal file
View File

@ -0,0 +1,8 @@
Package ldapcherry.backend
==========================
.. automodule:: ldapcherry.backend
:members:
:undoc-members:
:show-inheritance:

View File

@ -26,7 +26,7 @@ sys.path.insert(0, os.path.abspath('..'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.viewcode']
extensions = ['sphinx.ext.viewcode', 'sphinx.ext.todo', 'sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']

View File

@ -1,6 +1,13 @@
Deploy
======
LdapCherry aims at being as simple as possible to deploy.
The Application is constituted of:
* ldapcherryd: the daemon to lauch LdapCherry
* one ini file (ldapcherry.ini by default): the entry point for the configuration, containing all the "technical" attributes
* two yaml files (roles.yml and attributes by default): the files containing the roles and attributes definition
Launch
------
@ -21,8 +28,27 @@ LdapCherry is launched using the internal cherrypy server:
Roles and Attributes Configuration
----------------------------------
General Configuration
---------------------
Entry point in main configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The main configuration file (ldapcherry.ini by default) contains two parameters locating the roles and attributes configuration files:
+-----------------+------------+-------------------------------+-------------------+---------+
| Parameter | Section | Description | Values | Comment |
+=================+============+===============================+===================+=========+
| attributes.file | attributes | Attributes configuration file | Path to conf file | |
+-----------------+------------+-------------------------------+-------------------+---------+
| roles.file | roles | Roles configuration file | Path to conf file | |
+-----------------+------------+-------------------------------+-------------------+---------+
Attributes Configuration
~~~~~~~~~~~~~~~~~~~~~~~~
Roles Configuration
~~~~~~~~~~~~~~~~~~~
Main Configuration
------------------
Webserver
~~~~~~~~~
@ -72,6 +98,9 @@ example:
tools.staticdir.on = True
tools.staticdir.dir = '/usr/share/ldapcherry/static/'
Backends
~~~~~~~~
Authentication and sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -182,5 +211,3 @@ Sample init script for Debian:
:language: bash
This init script is available in **goodies/init-debian**.

View File

@ -7,7 +7,8 @@
install
deploy
backend_api
ppolicy_api
changelog
.. include:: ../README.rst

7
docs/ppolicy_api.rst Normal file
View File

@ -0,0 +1,7 @@
Package ldapcherry.ppolicy
==========================
.. automodule:: ldapcherry.ppolicy
:members:
:undoc-members:
:show-inheritance:

View File

@ -11,16 +11,18 @@ from ldapcherry.exceptions import MissingParameter
class PPolicy:
def __init__(self, config, logger):
""" password policy constructor
@dict config: the configuration of the ppolicy
@logger logger: a python logger
""" Password policy constructor
:dict config: the configuration of the ppolicy
:logger logger: a python logger
"""
pass
def check(self, password):
""" check that a password match the ppolicy
@str password: the password to check
@rtype: dict with keys 'match' a boolean
""" Check if a password match the ppolicy
:str password: the password to check
:rtype: dict with keys 'match' a boolean
(True if ppolicy matches, False otherwise)
and 'reason', an explaination string
"""
@ -28,15 +30,17 @@ class PPolicy:
return ret
def info(self):
""" gives information about the ppolicy
@rtype: a string describing the ppolicy
""" Gives information about the ppolicy
:rtype: a string describing the ppolicy
"""
ret = "There is no password policy configured"
def get_param(self, param, default=None):
"""
@str param: name of the paramter to recover
default: the default value, raises an exception
""" Get a parameter in config (handle default value)
:str param: name of the paramter to recover
:str default: the default value, raises an exception
if param is not in configuration and default
is None (which is the default value).
"""