diff --git a/ldapcherry/ppolicy/__init__.py b/ldapcherry/ppolicy/__init__.py index 4332615..5b4f066 100644 --- a/ldapcherry/ppolicy/__init__.py +++ b/ldapcherry/ppolicy/__init__.py @@ -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). """