From 77357a2c265a901947ce8b2ba898d5aed91770fb Mon Sep 17 00:00:00 2001 From: William Brown Date: Apr 11 2018 04:23:48 +0000 Subject: Ticket 49477 - Missing pbkdf python Bug Description: When I wrote the tests for the pbkdf2 regression I missed adding a file. Fix Description: Recreate and add the file as required. https://pagure.io/389-ds-base/issue/49447 Author: firstyear Review by: mreynolds (Thank you!) --- diff --git a/src/lib389/lib389/password_plugins.py b/src/lib389/lib389/password_plugins.py new file mode 100644 index 0000000..c79036e --- /dev/null +++ b/src/lib389/lib389/password_plugins.py @@ -0,0 +1,34 @@ +# --- BEGIN COPYRIGHT BLOCK --- +# Copyright (C) 2018 William Brown +# All rights reserved. +# +# License: GPL (version 3 or any later version). +# See LICENSE for details. +# --- END COPYRIGHT BLOCK --- + +from lib389.plugins import Plugin + +class PasswordPlugin(Plugin): + _plugin_properties = { + 'nsslapd-pluginpath': 'libpwdstorage-plugin', + 'nsslapd-plugintype': 'pwdstoragescheme', + 'nsslapd-pluginEnabled' : 'on' + } + + def __init__(self, instance, dn=None): + super(PasswordPlugin, self).__init__(instance, dn) + self._rdn_attribute = 'cn' + self._must_attributes = [ + 'nsslapd-pluginEnabled', + 'nsslapd-pluginPath', + 'nsslapd-pluginInitfunc', + 'nsslapd-pluginType', + ] + self._create_objectclasses = ['top', 'nsslapdplugin'] + # We'll mark this protected, and people can just disable the plugins. + self._protected = True + +class PBKDF2Plugin(PasswordPlugin): + def __init__(self, instance, dn="cn=PBKDF2_SHA256,cn=Password Storage Schemes,cn=plugins,cn=config"): + super(PBKDF2Plugin, self).__init__(instance, dn) +