diff --git a/AGENTS.md b/AGENTS.md index 6c5cb81..e551a09 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3966,19 +3966,20 @@ cargo test -p markbase-core --lib --features async-vfs # 303 passed, 0 failed --- **最后更新**:2026-06-22 -**版本**:1.52(LDAP Provider Phase 2.1 完成) +**版本**:1.53(LDAP Provider Phase 2.1-2.2 完成) ## LDAP Provider 完成(2026-06-22)⭐⭐⭐⭐⭐ -**完成時間**:约 2 小时 -**新增代碼量**:约 380 行 -**Git commit**:待提交 +**完成時間**:约 3 小时 +**新增代碼量**:约 465 行 +**Git commits**:2 commits (912bc21, 88590d3) -### Phase 2.1 完成明細 ⭐⭐⭐⭐⭐ +### Phase 2.1-2.2 完成明細 ⭐⭐⭐⭐⭐ | Phase | 模組 | 狀態 | 代碼量 | |-------|------|------|--------| | **Phase 2.1** | provider/ldap.rs | ✅ 完成 | ~380 行 | +| **Phase 2.2** | cli/tools/smb_server.rs | ✅ 完成 | ~85 行 | --- @@ -4006,11 +4007,14 @@ cargo test -p markbase-core --lib --features async-vfs # 303 passed, 0 failed **OpenLDAP defaults**: ```rust ldap_url: "ldap://localhost:389" +base_dn: "dc=example,dc=com" bind_dn: "cn=admin,dc=example,dc=com" -bind_password: "admin" +bind_password: "" user_search_base: "ou=users,dc=example,dc=com" -user_id_attr: "uid" +group_search_base: "ou=groups,dc=example,dc=com" user_filter: "(objectClass=person)" +group_filter: "(objectClass=group)" +user_id_attr: "uid" home_dir_attr: "homeDirectory" home_dir_prefix: "/home" user_groups_attr: "memberOf" @@ -4019,7 +4023,7 @@ user_groups_attr: "memberOf" **Active Directory configuration**: ```rust ldap_url: "ldap://ad.example.com:389" -bind_dn: "cn=admin,dc=example,dc=com" +base_dn: "dc=example,dc=com" user_search_base: "cn=users,dc=example,dc=com" user_id_attr: "sAMAccountName" user_filter: "(objectClass=user)" @@ -4029,6 +4033,31 @@ user_groups_attr: "memberOf" --- +### LDAP CLI Parameters ⭐⭐⭐⭐⭐ + +**SMB server CLI新增参数**: +```bash +cargo run --features smb-server,ldap -- smb-start \ + --ldap \ + --ldap-url ldap://localhost:389 \ + --ldap-base-dn dc=example,dc=com \ + --ldap-bind-dn cn=admin,dc=example,dc=com \ + --ldap-bind-password admin \ + --ldap-user-search-base ou=users,dc=example,dc=com \ + --ldap-group-search-base ou=groups,dc=example,dc=com \ + --ldap-user-id-attr uid \ + --ldap-user-filter "(objectClass=person)" \ + --ldap-group-filter "(objectClass=group)" \ + --ldap-home-dir-attr homeDirectory \ + --ldap-home-dir-prefix /home \ + --ldap-user-groups-attr memberOf \ + --port 4445 \ + --share-name markbase \ + --root /path/to/data +``` + +--- + ### ldap3 crate integration ⭐⭐⭐⭐⭐ **关键技术**: @@ -4042,7 +4071,7 @@ user_groups_attr: "memberOf" ### 測試結果 ⭐⭐⭐⭐⭐ ```bash -cargo test -p markbase-core --lib --features ldap # 301 passed, 0 failed +cargo test -p markbase-core --lib --features smb-server,ldap # 355 passed, 0 failed ``` --- @@ -4051,17 +4080,16 @@ cargo test -p markbase-core --lib --features ldap # 301 passed, 0 failed | 指標 | 值 | |------|-----| -| Commits | 27 (Phase 1 + Phase 2.1) | -| 新增代碼 | ~380 行 (ldap.rs) | -| 測試 | 301 passed ✅ | -| 時間 | ~2 小時 | +| Commits | 28 (Phase 1 + Phase 2.1-2.2) | +| 新增代碼 | ~465 行 (ldap.rs + smb_server.rs) | +| 測試 | 355 passed ✅ | +| 時間 | ~3 小時 | --- ### 下一步 ⭐⭐⭐⭐⭐ -**Phase 2.2**:SMB server LDAP integration -**Phase 2.3**:CLI parameters for LDAP configuration +**Phase 2.3**:smb-server session_setup LDAP authentication integration(修改 session_setup.rs lookup function) **Phase 3**:Write/Read Cache (~150 lines) ---