LDAP测试工具使用教程
ldap-test-tool项目地址:https://gitcode.com/gh_mirrors/ld/ldap-test-tool
1. 项目的目录结构及介绍
ldap-test-tool/
├── README.md
├── bin/
│ └── ldap-test-tool.sh
├── conf/
│ └── config.yaml
├── src/
│ ├── main.go
│ └── utils/
│ └── helper.go
└── test/
└── integration_test.go
- README.md: 项目说明文档。
- bin/: 存放可执行文件的目录。
- conf/: 存放配置文件的目录。
- src/: 源代码目录,包含主程序和工具函数。
- test/: 测试代码目录。
2. 项目的启动文件介绍
bin/ldap-test-tool.sh
是项目的启动脚本。该脚本负责初始化环境并启动主程序。
#!/bin/bash
# 设置环境变量
export CONFIG_PATH=conf/config.yaml
# 启动主程序
go run src/main.go
3. 项目的配置文件介绍
conf/config.yaml
是项目的配置文件,包含LDAP服务器的连接信息和其他配置选项。
ldap:
host: "ldap.example.com"
port: 389
baseDN: "dc=example,dc=com"
bindDN: "cn=admin,dc=example,dc=com"
bindPassword: "password"
userFilter: "(uid=%s)"
attributes:
- "cn"
- "mail"
- "uid"
- host: LDAP服务器地址。
- port: LDAP服务器端口。
- baseDN: 基础DN。
- bindDN: 绑定DN。
- bindPassword: 绑定密码。
- userFilter: 用户过滤器。
- attributes: 需要检索的用户属性。
ldap-test-tool项目地址:https://gitcode.com/gh_mirrors/ld/ldap-test-tool