diff --git a/conf/ldapcherry.ini b/conf/ldapcherry.ini index fa5c1a4..4067ffe 100644 --- a/conf/ldapcherry.ini +++ b/conf/ldapcherry.ini @@ -115,6 +115,16 @@ ldap.dn_user_attr = 'uid' #ad.auth = 'Administrator' #ad.password = 'password' +[ppolicy] + +# password policy module +ppolicy.module = 'ldapcherry.ppolicy.simple' + +# parameters of the module +min_length = 8 +min_upper = 1 +min_digit = 1 + # authentification parameters [auth] diff --git a/ldapcherry/ppolicy/__init.py b/ldapcherry/ppolicy/__init.py new file mode 100644 index 0000000..911cb8c --- /dev/null +++ b/ldapcherry/ppolicy/__init.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + +class Ppolicy: + + def __init__(self, config, logger): + pass + + def check(self, password): + ret = {'match': True, 'reason': 'no password policy'} + + def info(self): + ret = "There is no password policy configured" diff --git a/ldapcherry/ppolicy/simple.py b/ldapcherry/ppolicy/simple.py new file mode 100644 index 0000000..baa706b --- /dev/null +++ b/ldapcherry/ppolicy/simple.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois +