LDAPoToo工具
ldaptools的Python项目详细描述
ldaptools
帮助器模块使用LDAP目录,并针对OpenLDAP测试LDAP工具。
- ldaptools.ldif实用程序:ldif文件的简单解析器
- ldaptools.ldap_source:从ldap url生成ldap条目流
- ldaptools.synchronize:同步类将LDAP记录的源与目标同步
- ldaptools.paged:实现分页搜索请求的ldapobject
- ldaptools.ldapsync:同步类的命令行客户机
- ldaptools.slapd:启动一个独立的slapd服务器,操作其配置,它有助于 在编写针对openldap的测试时。
ldapsync
- usage: ldapsync [-h] –object-class-pivot OBJECT_CLASS_PIVOT
- [–attributes-file ATTRIBUTES_FILE] [–attributes ATTRIBUTES] –source-uri SOURCE_URI –source-base-dn SOURCE_BASE_DN [–source-bind-dn SOURCE_BIND_DN] [–source-bind-password SOURCE_BIND_PASSWORD] –target-uri TARGET_URI –target-base-dn TARGET_BASE_DN [–target-bind-dn TARGET_BIND_DN] [–target-bind-password TARGET_BIND_PASSWORD] [–fake] [–verbose]
Synchronize an LDIF file or a source LDAP directory to another directory Base DN of the source is remapped to another DN in the target directory
- optional arguments:
-h, --help show this help message and exit --object-class-pivot OBJECT_CLASS_PIVOT an objectClass and an attribute name which is the unique identifier for this class --attributes-file ATTRIBUTES_FILE a file containing the list of attributes to synchronize --attributes ATTRIBUTES a list of attribute names separated by spaces --source-uri SOURCE_URI URL of an LDAP directory (ldapi://, ldap:// or ldaps://) or path of and LDIF file --source-base-dn SOURCE_BASE_DN base DN of the source --source-bind-dn SOURCE_BIND_DN bind DN for a source LDAP directory --source-bind-password SOURCE_BIND_PASSWORD bind password for a source LDAP directory --target-uri TARGET_URI URL of the target LDAP directory --target-base-dn TARGET_BASE_DN base DN of the target LDAP directory --target-bind-dn TARGET_BIND_DN bind DN for a target LDAP directory --target-bind-password TARGET_BIND_PASSWORD bind password for a target LDAP directory --fake compute synchronization actions but do not apply --verbose print all actions to stdout
例如
在ldif文件和本地openldap目录之间同步组织单元和人员的树:
ldapsync --attributes 'uid cn givenName sn dc ou o description mail member' \ --object-class-pivot 'inetOrgPerson uid' \ --object-class-pivot 'organizationalUnit ou' \ --object-class-pivot 'dcobject dc' \ --source-uri dump.ldif \ --source-base-dn dc=myorganization,dc=fr \ --target-uri ldapi:// \ --target-base-dn o=myorganization,dc=otherorganization,dc=fr \ --verbose
在两个LDAP目录之间同步组织单位和人员的树:
ldapsync --attributes 'uid cn givenName sn dc ou o description mail member' \ --object-class-pivot 'inetOrgPerson uid' \ --object-class-pivot 'organizationalUnit ou' \ --object-class-pivot 'dcobject dc' \ --source-uri ldap://ldap.myorganization.fr \ --source-bind-dn uid=admin,ou=people,dc=myorganization,dc=fr --source-bind-password password --source-base-dn dc=myorganization,dc=fr \ --target-uri ldap://ldap.otherorganization.fr --target-bind-dn uid=admin,o=myorganization,dc=otherorganization,dc=fr --target-bind-password password --target-base-dn o=myorganization,dc=otherorganization,dc=fr \ --verbose
更改日志
0.18
- 修复ldif解析器中文本到字节的转换
0.17
- python3兼容性
- 修复测试证书
0.16
- 添加测试证书
0.15
- 使用TLS添加支持测试
- 从源中筛选objectClass,只保留已知的类
0.14
- 修复创建slapd服务器时的默认acl
- 修复ldif配置的语法
0.13
- 在ldapsync中,不要删除不属于 –对象类轴
0.12
- 停止时等待守护进程完全停止
0.11
- 删除调试语句
0.10
- 修复slapd中标准文件描述符的泄漏
0.9
- paged:修复响应中不包含分页结果扩展控件时的分页搜索
- tox脚本的改进
0.8
- 改进操作和错误的显示
- ldif源dn中的小写属性
- 修复从允许属性之外的源中删除属性时出现的错误
- 允许为比较指定不区分大小写的属性
0.7
- ldapsync:add a–source filter参数
0.6
- 如果目标条目中存在属性,则向新条目添加空属性
- 从源项中删除指定属性之外的属性
- 将属性名转换为ISTR
- 修复输入错误
0.5
- setup.py:添加详细说明
0.4
- 删除调试打印
0.3
- setup.py:添加对setuptools的依赖关系
0.2
- tox脚本的改进
0.1
- 初始版本