diff --git a/mandaye_vincennes/config.py b/mandaye_vincennes/config.py index 6652452..7a988d1 100644 --- a/mandaye_vincennes/config.py +++ b/mandaye_vincennes/config.py @@ -30,6 +30,12 @@ config.read(SETTINGS_INI) # dialect+driver://username:password@host:port/database db_url = config.get('database', 'url') +## LDAP Backend config +ldap_url = config.get('ldap', 'url') +ldap_bind_dn = config.get('ldap', 'base_dn') +ldap_bind_password = config.get('ldap', 'bind_password') +ldap_base_dn = config.get('ldap', 'base_dn') + debug = config.getboolean('debug', 'debug') # Log configuration @@ -140,12 +146,14 @@ mandaye_offline_toolbar = config.getboolean('mandaye', 'offline_toolbar') # Authentic 2 auto connection a2_auto_connection = config.getboolean('mandaye', 'a2_auto_connection') -# Choose storage -# Only mandaye.backends.sql at the moment +# Choose storage (sql or ldap) if config.get('mandaye', 'storage_backend') == 'sql': storage_backend = "mandaye.backends.sql" +elif config.get('mandaye', 'storage_backend') == 'ldap': + storage_backend = "mandaye.backends.ldap_back" else: - ImproperlyConfigured('Storage backend must be sql') + ImproperlyConfigured('Storage backend must be sql or ldap') + # Encrypt service provider passwords with a secret # You should install pycypto to use this feature diff --git a/mandaye_vincennes/default-config.ini b/mandaye_vincennes/default-config.ini index d5a2702..e8f9919 100644 --- a/mandaye_vincennes/default-config.ini +++ b/mandaye_vincennes/default-config.ini @@ -5,6 +5,13 @@ base_dir: . ; http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html url: sqlite:///%(base_dir)s/mandaye_vincennes.db +[ldap] +; use by ldap backend +url: ldap://127.0.0.1 +bind_dn: cn=admin,dc=acompany,dc=org +bind_password: AdminPassword +base_dn: ou=mandaye,dc=acompany,dc=org + [dirs] config_root: %(base_dir)s/conf.d data_dir: %(base_dir)s/data @@ -23,8 +30,8 @@ sentry_dsn: toolbar: true offline_toolbar: false a2_auto_connection: true -; only sql at the moment -storage_backend: sql +; sql or ldap +storage_backend: ldap auto_decompress: true ; if you want to encypt password set to true ; you need to install pycrypto for this feature