ldap-rest 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +48 -0
  3. package/bin/cleanup-external-users.mjs +219 -0
  4. package/bin/index.mjs +54 -0
  5. package/bin/sync-james.mjs +190 -0
  6. package/dist/abstract/ldapFlat.js +1 -0
  7. package/dist/abstract/plugin.js +1 -0
  8. package/dist/abstract/twakePlugin.js +1 -0
  9. package/dist/bin/index.js +1 -0
  10. package/dist/config/args.js +1 -0
  11. package/dist/lib/auth/base.js +1 -0
  12. package/dist/lib/authz/base.js +1 -0
  13. package/dist/lib/expressFormatedResponses.js +1 -0
  14. package/dist/lib/ldapActions.js +1 -0
  15. package/dist/lib/parseConfig.js +1 -0
  16. package/dist/lib/utils.js +1 -0
  17. package/dist/logger/winston.js +1 -0
  18. package/dist/plugins/auth/authzLinid1.js +1 -0
  19. package/dist/plugins/auth/authzPerBranch.js +1 -0
  20. package/dist/plugins/auth/crowdsec.js +1 -0
  21. package/dist/plugins/auth/llng.js +1 -0
  22. package/dist/plugins/auth/openidconnect.js +1 -0
  23. package/dist/plugins/auth/rateLimit.js +1 -0
  24. package/dist/plugins/auth/token.js +1 -0
  25. package/dist/plugins/configApi.js +1 -0
  26. package/dist/plugins/demo/helloworld.js +1 -0
  27. package/dist/plugins/ldap/bulkImport.js +1 -0
  28. package/dist/plugins/ldap/departmentSync.js +1 -0
  29. package/dist/plugins/ldap/externalUsersInGroups.js +1 -0
  30. package/dist/plugins/ldap/flatGeneric.js +1 -0
  31. package/dist/plugins/ldap/groups.js +1 -0
  32. package/dist/plugins/ldap/onChange.js +1 -0
  33. package/dist/plugins/ldap/organization.js +1 -0
  34. package/dist/plugins/ldap/trash.js +1 -0
  35. package/dist/plugins/priority.json.js +1 -0
  36. package/dist/plugins/static.js +1 -0
  37. package/dist/plugins/twake/calendarResources.js +1 -0
  38. package/dist/plugins/twake/james.js +1 -0
  39. package/dist/plugins/weblogs.js +1 -0
  40. package/dist/src/abstract/ldapFlat.d.ts +94 -0
  41. package/dist/src/abstract/plugin.d.ts +43 -0
  42. package/dist/src/abstract/twakePlugin.d.ts +90 -0
  43. package/dist/src/bin/index.d.ts +43 -0
  44. package/dist/src/browser/ldap-group-editor/LdapGroupEditor.d.ts +31 -0
  45. package/dist/src/browser/ldap-group-editor/api/GroupApiClient.d.ts +23 -0
  46. package/dist/src/browser/ldap-group-editor/components/CreateGroupModal.d.ts +19 -0
  47. package/dist/src/browser/ldap-group-editor/components/GroupPropertyEditor.d.ts +30 -0
  48. package/dist/src/browser/ldap-group-editor/components/GroupTree.d.ts +17 -0
  49. package/dist/src/browser/ldap-group-editor/components/MoveGroupModal.d.ts +20 -0
  50. package/dist/src/browser/ldap-group-editor/index.d.ts +6 -0
  51. package/dist/src/browser/ldap-group-editor/types.d.ts +58 -0
  52. package/dist/src/browser/ldap-resource-editor/api/ResourceApiClient.d.ts +53 -0
  53. package/dist/src/browser/ldap-resource-editor/cache/CacheManager.d.ts +65 -0
  54. package/dist/src/browser/ldap-resource-editor/index.d.ts +6 -0
  55. package/dist/src/browser/ldap-resource-editor/types.d.ts +78 -0
  56. package/dist/src/browser/ldap-tree-viewer/LdapTreeViewer.d.ts +26 -0
  57. package/dist/src/browser/ldap-tree-viewer/api/LdapApiClient.d.ts +30 -0
  58. package/dist/src/browser/ldap-tree-viewer/components/TreeNode.d.ts +17 -0
  59. package/dist/src/browser/ldap-tree-viewer/components/TreeRoot.d.ts +14 -0
  60. package/dist/src/browser/ldap-tree-viewer/index.d.ts +7 -0
  61. package/dist/src/browser/ldap-tree-viewer/store/Store.d.ts +18 -0
  62. package/dist/src/browser/ldap-tree-viewer/store/actions.d.ts +28 -0
  63. package/dist/src/browser/ldap-tree-viewer/store/reducers.d.ts +7 -0
  64. package/dist/src/browser/ldap-tree-viewer/types.d.ts +34 -0
  65. package/dist/src/browser/ldap-unit-editor/LdapUnitEditor.d.ts +27 -0
  66. package/dist/src/browser/ldap-unit-editor/api/UnitApiClient.d.ts +24 -0
  67. package/dist/src/browser/ldap-unit-editor/components/MoveUnitModal.d.ts +28 -0
  68. package/dist/src/browser/ldap-unit-editor/components/UnitPropertyEditor.d.ts +28 -0
  69. package/dist/src/browser/ldap-unit-editor/components/UnitTree.d.ts +18 -0
  70. package/dist/src/browser/ldap-unit-editor/index.d.ts +6 -0
  71. package/dist/src/browser/ldap-unit-editor/types.d.ts +55 -0
  72. package/dist/src/browser/ldap-user-editor/LdapUserEditor.d.ts +32 -0
  73. package/dist/src/browser/ldap-user-editor/api/UserApiClient.d.ts +55 -0
  74. package/dist/src/browser/ldap-user-editor/cache/CacheManager.d.ts +65 -0
  75. package/dist/src/browser/ldap-user-editor/components/MoveUserModal.d.ts +28 -0
  76. package/dist/src/browser/ldap-user-editor/components/PointerField.d.ts +22 -0
  77. package/dist/src/browser/ldap-user-editor/components/UserEditor.d.ts +46 -0
  78. package/dist/src/browser/ldap-user-editor/components/UserList.d.ts +24 -0
  79. package/dist/src/browser/ldap-user-editor/components/UserTree.d.ts +24 -0
  80. package/dist/src/browser/ldap-user-editor/index.d.ts +7 -0
  81. package/dist/src/browser/ldap-user-editor/types.d.ts +67 -0
  82. package/dist/src/browser/shared/components/Modal.d.ts +38 -0
  83. package/dist/src/browser/shared/components/StatusMessage.d.ts +48 -0
  84. package/dist/src/browser/shared/index.d.ts +10 -0
  85. package/dist/src/browser/shared/types/index.d.ts +65 -0
  86. package/dist/src/browser/shared/utils/dom.d.ts +33 -0
  87. package/dist/src/browser/shared/utils/form.d.ts +28 -0
  88. package/dist/src/browser/shared/utils/schema.d.ts +29 -0
  89. package/dist/src/config/args.d.ts +128 -0
  90. package/dist/src/config/schema.d.ts +18 -0
  91. package/dist/src/hooks.d.ts +76 -0
  92. package/dist/src/lib/auth/base.d.ts +9 -0
  93. package/dist/src/lib/authz/base.d.ts +63 -0
  94. package/dist/src/lib/expressFormatedResponses.d.ts +26 -0
  95. package/dist/src/lib/ldapActions.d.ts +91 -0
  96. package/dist/src/lib/parseConfig.d.ts +23 -0
  97. package/dist/src/lib/utils.d.ts +73 -0
  98. package/dist/src/logger/winston.d.ts +3 -0
  99. package/dist/src/plugins/auth/authzLinid1.d.ts +46 -0
  100. package/dist/src/plugins/auth/authzPerBranch.d.ts +59 -0
  101. package/dist/src/plugins/auth/crowdsec.d.ts +29 -0
  102. package/dist/src/plugins/auth/llng.d.ts +8 -0
  103. package/dist/src/plugins/auth/openidconnect.d.ts +11 -0
  104. package/dist/src/plugins/auth/rateLimit.d.ts +24 -0
  105. package/dist/src/plugins/auth/token.d.ts +17 -0
  106. package/dist/src/plugins/configApi.d.ts +24 -0
  107. package/dist/src/plugins/demo/helloworld.d.ts +12 -0
  108. package/dist/src/plugins/ldap/bulkImport.d.ts +48 -0
  109. package/dist/src/plugins/ldap/departmentSync.d.ts +35 -0
  110. package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +21 -0
  111. package/dist/src/plugins/ldap/flatGeneric.d.ts +31 -0
  112. package/dist/src/plugins/ldap/groups.d.ts +95 -0
  113. package/dist/src/plugins/ldap/onChange.d.ts +32 -0
  114. package/dist/src/plugins/ldap/organization.d.ts +65 -0
  115. package/dist/src/plugins/ldap/trash.d.ts +52 -0
  116. package/dist/src/plugins/static.d.ts +7 -0
  117. package/dist/src/plugins/twake/calendarResources.d.ts +31 -0
  118. package/dist/src/plugins/twake/james.d.ts +83 -0
  119. package/dist/src/plugins/weblogs.d.ts +8 -0
  120. package/docs/DEVELOPER_GUIDE.md +298 -0
  121. package/docs/OPENAPI.md +440 -0
  122. package/docs/PLUGIN_DEPENDENCIES.md +612 -0
  123. package/docs/README.md +466 -0
  124. package/docs/api/REFERENCE.md +983 -0
  125. package/docs/api/REST_API.md +1237 -0
  126. package/docs/authentication.md +469 -0
  127. package/docs/authzLinid1.md +521 -0
  128. package/docs/authzPerBranch.md +596 -0
  129. package/docs/browser/LIBRARIES.md +1196 -0
  130. package/docs/examples/EXAMPLES.md +1659 -0
  131. package/docs/examples/twake-mailbox-type-nomenclature.ldif +37 -0
  132. package/docs/examples/twake-mailbox-type-schema-amendment.ldif +30 -0
  133. package/docs/jamesTeamMailboxes.md +343 -0
  134. package/docs/ldapBulkImport.md +722 -0
  135. package/docs/ldapExternalUsersInGroups.md +325 -0
  136. package/docs/ldapFlatGeneric.md +444 -0
  137. package/docs/ldapGroups.md +589 -0
  138. package/docs/ldapOrganizations.md +659 -0
  139. package/docs/ldapTrash.md +260 -0
  140. package/docs/linagora.png +0 -0
  141. package/docs/onChange.md +318 -0
  142. package/docs/plugins/DEVELOPMENT.md +1219 -0
  143. package/docs/presenterm-fr.md +721 -0
  144. package/docs/presenterm.md +721 -0
  145. package/docs/schemas/SCHEMAS.md +1212 -0
  146. package/docs/static.md +410 -0
  147. package/docs/twakeCalendarResources.md +148 -0
  148. package/docs/twakeJames.md +661 -0
  149. package/docs/weblogs.md +399 -0
  150. package/examples/web/ldap-group-editor.html +113 -0
  151. package/examples/web/ldap-tree-viewer.html +368 -0
  152. package/examples/web/ldap-unit-editor.html +108 -0
  153. package/examples/web/ldap-user-editor.html +412 -0
  154. package/package.json +458 -0
  155. package/static/browser/common-demo.css +450 -0
  156. package/static/browser/ldap-group-editor/LdapGroupEditor.js +207 -0
  157. package/static/browser/ldap-group-editor/LdapGroupEditor.js.map +1 -0
  158. package/static/browser/ldap-group-editor/api/GroupApiClient.js +112 -0
  159. package/static/browser/ldap-group-editor/api/GroupApiClient.js.map +1 -0
  160. package/static/browser/ldap-group-editor/components/CreateGroupModal.js +212 -0
  161. package/static/browser/ldap-group-editor/components/CreateGroupModal.js.map +1 -0
  162. package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js +497 -0
  163. package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js.map +1 -0
  164. package/static/browser/ldap-group-editor/components/GroupTree.js +153 -0
  165. package/static/browser/ldap-group-editor/components/GroupTree.js.map +1 -0
  166. package/static/browser/ldap-group-editor/components/MoveGroupModal.js +235 -0
  167. package/static/browser/ldap-group-editor/components/MoveGroupModal.js.map +1 -0
  168. package/static/browser/ldap-group-editor/index.js +2 -0
  169. package/static/browser/ldap-group-editor/index.js.map +1 -0
  170. package/static/browser/ldap-group-editor/types.js +2 -0
  171. package/static/browser/ldap-group-editor/types.js.map +1 -0
  172. package/static/browser/ldap-group-editor.esm.js +1399 -0
  173. package/static/browser/ldap-group-editor.esm.js.map +1 -0
  174. package/static/browser/ldap-group-editor.js +1407 -0
  175. package/static/browser/ldap-group-editor.js.map +1 -0
  176. package/static/browser/ldap-group-editor.min.js +2 -0
  177. package/static/browser/ldap-group-editor.min.js.map +1 -0
  178. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +226 -0
  179. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -0
  180. package/static/browser/ldap-resource-editor/cache/CacheManager.js +123 -0
  181. package/static/browser/ldap-resource-editor/cache/CacheManager.js.map +1 -0
  182. package/static/browser/ldap-resource-editor/index.js +2 -0
  183. package/static/browser/ldap-resource-editor/index.js.map +1 -0
  184. package/static/browser/ldap-resource-editor/types.js +2 -0
  185. package/static/browser/ldap-resource-editor/types.js.map +1 -0
  186. package/static/browser/ldap-tree-viewer/LdapTreeViewer.js +187 -0
  187. package/static/browser/ldap-tree-viewer/LdapTreeViewer.js.map +1 -0
  188. package/static/browser/ldap-tree-viewer/api/LdapApiClient.js +50 -0
  189. package/static/browser/ldap-tree-viewer/api/LdapApiClient.js.map +1 -0
  190. package/static/browser/ldap-tree-viewer/components/TreeNode.js +140 -0
  191. package/static/browser/ldap-tree-viewer/components/TreeNode.js.map +1 -0
  192. package/static/browser/ldap-tree-viewer/components/TreeRoot.js +98 -0
  193. package/static/browser/ldap-tree-viewer/components/TreeRoot.js.map +1 -0
  194. package/static/browser/ldap-tree-viewer/index.js +2 -0
  195. package/static/browser/ldap-tree-viewer/index.js.map +1 -0
  196. package/static/browser/ldap-tree-viewer/store/Store.js +29 -0
  197. package/static/browser/ldap-tree-viewer/store/Store.js.map +1 -0
  198. package/static/browser/ldap-tree-viewer/store/actions.js +53 -0
  199. package/static/browser/ldap-tree-viewer/store/actions.js.map +1 -0
  200. package/static/browser/ldap-tree-viewer/store/reducers.js +79 -0
  201. package/static/browser/ldap-tree-viewer/store/reducers.js.map +1 -0
  202. package/static/browser/ldap-tree-viewer/types.js +2 -0
  203. package/static/browser/ldap-tree-viewer/types.js.map +1 -0
  204. package/static/browser/ldap-tree-viewer.css +2 -0
  205. package/static/browser/ldap-tree-viewer.css.map +1 -0
  206. package/static/browser/ldap-tree-viewer.esm.js +606 -0
  207. package/static/browser/ldap-tree-viewer.esm.js.map +1 -0
  208. package/static/browser/ldap-tree-viewer.js +614 -0
  209. package/static/browser/ldap-tree-viewer.js.map +1 -0
  210. package/static/browser/ldap-tree-viewer.min.js +2 -0
  211. package/static/browser/ldap-tree-viewer.min.js.map +1 -0
  212. package/static/browser/ldap-unit-editor/LdapUnitEditor.js +119 -0
  213. package/static/browser/ldap-unit-editor/LdapUnitEditor.js.map +1 -0
  214. package/static/browser/ldap-unit-editor/api/UnitApiClient.js +95 -0
  215. package/static/browser/ldap-unit-editor/api/UnitApiClient.js.map +1 -0
  216. package/static/browser/ldap-unit-editor/components/MoveUnitModal.js +295 -0
  217. package/static/browser/ldap-unit-editor/components/MoveUnitModal.js.map +1 -0
  218. package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js +321 -0
  219. package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js.map +1 -0
  220. package/static/browser/ldap-unit-editor/components/UnitTree.js +197 -0
  221. package/static/browser/ldap-unit-editor/components/UnitTree.js.map +1 -0
  222. package/static/browser/ldap-unit-editor/index.js +2 -0
  223. package/static/browser/ldap-unit-editor/index.js.map +1 -0
  224. package/static/browser/ldap-unit-editor/types.js +2 -0
  225. package/static/browser/ldap-unit-editor/types.js.map +1 -0
  226. package/static/browser/ldap-unit-editor.esm.js +1013 -0
  227. package/static/browser/ldap-unit-editor.esm.js.map +1 -0
  228. package/static/browser/ldap-unit-editor.js +1021 -0
  229. package/static/browser/ldap-unit-editor.js.map +1 -0
  230. package/static/browser/ldap-unit-editor.min.js +2 -0
  231. package/static/browser/ldap-unit-editor.min.js.map +1 -0
  232. package/static/browser/ldap-user-editor/LdapUserEditor.js +184 -0
  233. package/static/browser/ldap-user-editor/LdapUserEditor.js.map +1 -0
  234. package/static/browser/ldap-user-editor/api/UserApiClient.js +209 -0
  235. package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -0
  236. package/static/browser/ldap-user-editor/cache/CacheManager.js +123 -0
  237. package/static/browser/ldap-user-editor/cache/CacheManager.js.map +1 -0
  238. package/static/browser/ldap-user-editor/components/MoveUserModal.js +302 -0
  239. package/static/browser/ldap-user-editor/components/MoveUserModal.js.map +1 -0
  240. package/static/browser/ldap-user-editor/components/PointerField.js +152 -0
  241. package/static/browser/ldap-user-editor/components/PointerField.js.map +1 -0
  242. package/static/browser/ldap-user-editor/components/UserEditor.js +608 -0
  243. package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -0
  244. package/static/browser/ldap-user-editor/components/UserList.js +181 -0
  245. package/static/browser/ldap-user-editor/components/UserList.js.map +1 -0
  246. package/static/browser/ldap-user-editor/components/UserTree.js +164 -0
  247. package/static/browser/ldap-user-editor/components/UserTree.js.map +1 -0
  248. package/static/browser/ldap-user-editor/index.js +2 -0
  249. package/static/browser/ldap-user-editor/index.js.map +1 -0
  250. package/static/browser/ldap-user-editor/types.js +2 -0
  251. package/static/browser/ldap-user-editor/types.js.map +1 -0
  252. package/static/browser/ldap-user-editor.css +2 -0
  253. package/static/browser/ldap-user-editor.css.map +1 -0
  254. package/static/browser/ldap-user-editor.esm.js +1897 -0
  255. package/static/browser/ldap-user-editor.esm.js.map +1 -0
  256. package/static/browser/ldap-user-editor.js +1905 -0
  257. package/static/browser/ldap-user-editor.js.map +1 -0
  258. package/static/browser/ldap-user-editor.min.js +2 -0
  259. package/static/browser/ldap-user-editor.min.js.map +1 -0
  260. package/static/browser/shared/components/Modal.js +121 -0
  261. package/static/browser/shared/components/Modal.js.map +1 -0
  262. package/static/browser/shared/components/StatusMessage.js +119 -0
  263. package/static/browser/shared/components/StatusMessage.js.map +1 -0
  264. package/static/browser/shared/index.js +7 -0
  265. package/static/browser/shared/index.js.map +1 -0
  266. package/static/browser/shared/types/index.js +37 -0
  267. package/static/browser/shared/types/index.js.map +1 -0
  268. package/static/browser/shared/utils/dom.js +78 -0
  269. package/static/browser/shared/utils/dom.js.map +1 -0
  270. package/static/browser/shared/utils/form.js +234 -0
  271. package/static/browser/shared/utils/form.js.map +1 -0
  272. package/static/browser/shared/utils/schema.js +121 -0
  273. package/static/browser/shared/utils/schema.js.map +1 -0
  274. package/static/browser/shared.esm.js +694 -0
  275. package/static/browser/shared.esm.js.map +1 -0
  276. package/static/browser/shared.js +723 -0
  277. package/static/browser/shared.js.map +1 -0
  278. package/static/browser/shared.min.js +2 -0
  279. package/static/browser/shared.min.js.map +1 -0
  280. package/static/schemas/ad/computers.json +92 -0
  281. package/static/schemas/ad/groups.json +55 -0
  282. package/static/schemas/ad/organizations.json +66 -0
  283. package/static/schemas/ad/users.json +116 -0
  284. package/static/schemas/standard/devices.json +72 -0
  285. package/static/schemas/standard/groups.json +54 -0
  286. package/static/schemas/standard/organizations.json +49 -0
  287. package/static/schemas/standard/users.json +86 -0
  288. package/static/schemas/twake/groups.json +75 -0
  289. package/static/schemas/twake/nomenclature/twakeAccountStatus.json +31 -0
  290. package/static/schemas/twake/nomenclature/twakeDeliveryMode.json +31 -0
  291. package/static/schemas/twake/nomenclature/twakeListType.json +31 -0
  292. package/static/schemas/twake/nomenclature/twakeMailboxType.json +31 -0
  293. package/static/schemas/twake/nomenclature/twakeTitle.json +31 -0
  294. package/static/schemas/twake/organizations.json +52 -0
  295. package/static/schemas/twake/positions.json +32 -0
  296. package/static/schemas/twake/users.json +112 -0
package/docs/README.md ADDED
@@ -0,0 +1,466 @@
1
+ # LDAP-Rest Documentation
2
+
3
+ Complete documentation for ldap-rest plugins and features.
4
+
5
+ ## Presentations
6
+
7
+ Interactive slide presentations about LDAP-Rest (using [presenterm](https://github.com/mfontanini/presenterm)):
8
+
9
+ - **[presenterm.md](./presenterm.md)** - English presentation
10
+ - **[presenterm-fr.md](./presenterm-fr.md)** - Présentation en français
11
+
12
+ To view:
13
+
14
+ ```bash
15
+ presenterm docs/presenterm.md # English
16
+ presenterm docs/presenterm-fr.md # French
17
+ ```
18
+
19
+ Topics covered:
20
+
21
+ - Architecture and plugin system
22
+ - LDAP consistency mechanisms
23
+ - Apache James integration
24
+ - REST API and JSON schemas
25
+ - Browser libraries
26
+ - Use cases and examples
27
+
28
+ ## For Application Developers
29
+
30
+ If you want to build a web application that uses LDAP-Rest's APIs and browser libraries:
31
+
32
+ 📖 **[Developer Guide](./DEVELOPER_GUIDE.md)** - Complete guide covering:
33
+
34
+ - REST API reference (Config, Users, Groups, Organizations)
35
+ - Browser libraries (LdapTreeViewer, LdapUserEditor)
36
+ - JSON schemas and roles
37
+ - Integration examples (React, Vue.js, Vanilla JavaScript)
38
+ - Authentication and security
39
+
40
+ ## For Plugin Developers
41
+
42
+ If you want to extend LDAP-Rest with custom plugins, see below:
43
+
44
+ ## Table of Contents
45
+
46
+ ### Core Plugins
47
+
48
+ #### LDAP Management
49
+
50
+ - **[ldapFlatGeneric](ldapFlatGeneric.md)** - Schema-driven LDAP entity management (users, positions, etc.)
51
+ - **[ldapGroups](ldapGroups.md)** - LDAP group management with member validation
52
+ - **[ldapOrganizations](ldapOrganizations.md)** - Hierarchical organization tree management
53
+ - **[ldapBulkImport](ldapBulkImport.md)** - CSV-based bulk import for LDAP resources
54
+ - **[ldapExternalUsersInGroups](ldapExternalUsersInGroups.md)** - Auto-create external contacts in groups
55
+ - **[ldapTrash](ldapTrash.md)** - Soft delete system - moves entries to trash instead of deleting
56
+ - **[onChange](onChange.md)** - Detect and react to LDAP attribute changes
57
+
58
+ #### Authentication & Authorization
59
+
60
+ - **[authentication](authentication.md)** - Complete authentication guide (Token, LLNG, OpenID Connect)
61
+ - **[authzPerBranch](authzPerBranch.md)** - Branch-level authorization and access control
62
+ - **[authzLinid1](authzLinid1.md)** - LinID 1.x authorization integration
63
+
64
+ #### Security
65
+
66
+ - **crowdsec** - CrowdSec integration to block banned IPs (must be loaded before auth plugins)
67
+ - **rateLimit** - Rate limiting to prevent brute-force attacks (must be loaded before auth plugins)
68
+
69
+ #### Utilities
70
+
71
+ - **[static](static.md)** - Serve static files and JSON schemas with config replacement
72
+ - **[weblogs](weblogs.md)** - HTTP request logging and monitoring
73
+
74
+ ### Integration Plugins
75
+
76
+ #### Twake
77
+
78
+ - **[twakeJames](twakeJames.md)** - Apache James mail server synchronization
79
+ - **[twakeCalendarResources](twakeCalendarResources.md)** - Twake Calendar resources synchronization
80
+
81
+ ## Quick Start
82
+
83
+ ### Basic LDAP Server
84
+
85
+ Minimal setup with user management:
86
+
87
+ ```bash
88
+ ldap-rest \
89
+ --plugin core/ldap/flatGeneric \
90
+ --ldap-url ldap://localhost:389 \
91
+ --ldap-dn "cn=admin,dc=example,dc=com" \
92
+ --ldap-pwd "password" \
93
+ --ldap-base "dc=example,dc=com" \
94
+ --ldap-flat-schema ./schemas/standard/users.json
95
+ ```
96
+
97
+ ### With Authentication
98
+
99
+ Add token authentication:
100
+
101
+ ```bash
102
+ ldap-rest \
103
+ --plugin core/auth/token \
104
+ --plugin core/ldap/flatGeneric \
105
+ --auth-token "secret-token" \
106
+ --ldap-flat-schema ./schemas/standard/users.json \
107
+ ...
108
+ ```
109
+
110
+ ### Complete Setup
111
+
112
+ Full-featured LDAP management with web UI:
113
+
114
+ ```bash
115
+ ldap-rest \
116
+ --plugin core/auth/token \
117
+ --plugin core/ldap/flatGeneric \
118
+ --plugin core/ldap/groups \
119
+ --plugin core/ldap/organization \
120
+ --plugin core/ldap/bulkImport \
121
+ --plugin core/ldap/externalUsersInGroups \
122
+ --plugin core/static \
123
+ --plugin core/weblogs \
124
+ --ldap-flat-schema ./schemas/standard/users.json \
125
+ --bulk-import-schemas "users:./schemas/standard/users.json" \
126
+ --auth-token "admin-token" \
127
+ --static-path ./static \
128
+ ...
129
+ ```
130
+
131
+ ## Plugin Categories
132
+
133
+ ### LDAP Entities
134
+
135
+ Plugins for managing different LDAP entity types:
136
+
137
+ | Plugin | Entity Type | Features |
138
+ | ----------------- | ------------------------ | --------------------------------------------- |
139
+ | ldapFlatGeneric | Users, Positions, Custom | Schema-driven, Validation, Pointers |
140
+ | ldapGroups | Groups | Member validation, Nested groups |
141
+ | ldapOrganizations | Organizational Units | Tree navigation, Search |
142
+ | ldapBulkImport | Any (bulk operations) | CSV import, Template generation, Multi-schema |
143
+ | ldapTrash | Any (soft delete) | Trash system, Recovery, Metadata |
144
+
145
+ ### Authentication
146
+
147
+ Secure API access:
148
+
149
+ | Plugin | Type | Use Case |
150
+ | -------------- | ------------- | ---------------------------- |
151
+ | token | Bearer tokens | Development, APIs, Scripts |
152
+ | llng | LemonLDAP::NG | Enterprise SSO |
153
+ | openidconnect | OAuth2/OIDC | Cloud identity, Social login |
154
+ | authzPerBranch | Authorization | Branch-level access control |
155
+ | authzLinid1 | Authorization | LinID 1.x integration |
156
+
157
+ ### Security
158
+
159
+ Protection and rate limiting:
160
+
161
+ | Plugin | Type | Use Case |
162
+ | --------- | ------------- | ----------------------------- |
163
+ | crowdsec | IP blocking | Block banned IPs via CrowdSec |
164
+ | rateLimit | Rate limiting | Prevent brute-force attacks |
165
+
166
+ ### Integration
167
+
168
+ Connect to external systems:
169
+
170
+ | Plugin | Integrates With | Purpose |
171
+ | --------------------- | --------------- | -------------------- |
172
+ | onChange | Any | Detect LDAP changes |
173
+ | twake/james | Apache James | Mail server sync |
174
+ | externalUsersInGroups | Groups | Auto-create contacts |
175
+
176
+ ### Utilities
177
+
178
+ Support plugins:
179
+
180
+ | Plugin | Purpose |
181
+ | ------- | --------------------- |
182
+ | static | Serve web UI, schemas |
183
+ | weblogs | Request logging |
184
+
185
+ ## Plugin Dependencies
186
+
187
+ Some plugins require others:
188
+
189
+ ```
190
+ twake/james
191
+ └─ requires: core/ldap/onChange
192
+
193
+ core/ldap/externalUsersInGroups
194
+ └─ requires: core/ldap/groups
195
+
196
+ core/auth/authzPerBranch
197
+ └─ requires: Any authentication plugin (token, llng, openidconnect)
198
+ ```
199
+
200
+ ## Configuration
201
+
202
+ ### Environment Variables
203
+
204
+ All CLI options can be set via environment variables:
205
+
206
+ ```bash
207
+ # LDAP connection
208
+ export DM_LDAP_URL="ldap://localhost:389"
209
+ export DM_LDAP_DN="cn=admin,dc=example,dc=com"
210
+ export DM_LDAP_PWD="password"
211
+ export DM_LDAP_BASE="dc=example,dc=com"
212
+
213
+ # Plugins
214
+ export DM_PLUGIN="core/auth/token,core/ldap/flatGeneric"
215
+ export DM_AUTH_TOKENS="token1,token2"
216
+ export DM_LDAP_FLAT_SCHEMA="./schemas/users.json"
217
+
218
+ # Start server
219
+ ldap-rest
220
+ ```
221
+
222
+ ### Configuration Files
223
+
224
+ Use `.env` files or shell scripts:
225
+
226
+ ```bash
227
+ # Load configuration
228
+ source ~/.ldap-rest-config
229
+
230
+ # Start server
231
+ ldap-rest
232
+ ```
233
+
234
+ ## Schemas
235
+
236
+ ### Standard Schemas
237
+
238
+ Located in `./static/schemas/standard/`:
239
+
240
+ - `users.json` - Standard inetOrgPerson users
241
+ - `groups.json` - Standard groupOfNames groups
242
+ - `organizations.json` - Organizational units
243
+
244
+ ### Twake Schemas
245
+
246
+ Located in `./static/schemas/twake/`:
247
+
248
+ - `users.json` - Twake users with custom attributes
249
+ - `groups.json` - Twake static groups
250
+ - `positions.json` - Twake positions/roles
251
+ - `organizations.json` - Twake organizations
252
+ - `nomenclature/*.json` - Reference data (status, delivery mode, etc.)
253
+
254
+ ### Active Directory Schemas
255
+
256
+ Located in `./static/schemas/ad/`:
257
+
258
+ - `users.json` - AD user accounts
259
+ - `groups.json` - AD security groups
260
+ - `organizations.json` - AD organizational units
261
+
262
+ ## API Endpoints
263
+
264
+ ### Entity Management
265
+
266
+ Generated by `ldapFlatGeneric`:
267
+
268
+ ```
269
+ GET /api/v1/ldap/{pluralName} # List entries
270
+ GET /api/v1/ldap/{pluralName}/{id} # Get entry
271
+ POST /api/v1/ldap/{pluralName} # Create entry
272
+ PUT /api/v1/ldap/{pluralName}/{id} # Modify entry
273
+ DELETE /api/v1/ldap/{pluralName}/{id} # Delete entry
274
+ ```
275
+
276
+ ### Groups
277
+
278
+ Provided by `ldapGroups`:
279
+
280
+ ```
281
+ GET /api/v1/ldap/groups # List groups
282
+ GET /api/v1/ldap/groups/{cn} # Get group
283
+ POST /api/v1/ldap/groups # Create group
284
+ PUT /api/v1/ldap/groups/{cn} # Modify group
285
+ POST /api/v1/ldap/groups/{cn}/rename # Rename group (change cn)
286
+ POST /api/v1/ldap/groups/{cn}/move # Move group to different organization
287
+ DELETE /api/v1/ldap/groups/{cn} # Delete group
288
+ ```
289
+
290
+ ### Organizations
291
+
292
+ Provided by `ldapOrganizations`:
293
+
294
+ ```
295
+ GET /api/v1/ldap/organizations/top # Get top organization(s)
296
+ GET /api/v1/ldap/organizations/{dn}/subnodes # List sub-organizations and linked entities
297
+ GET /api/v1/ldap/organizations/{dn}/subnodes/search # Search in organization
298
+ POST /api/v1/ldap/organizations # Create organization
299
+ PUT /api/v1/ldap/organizations/{dn} # Modify organization
300
+ POST /api/v1/ldap/organizations/{dn}/move # Move organization to different parent
301
+ DELETE /api/v1/ldap/organizations/{dn} # Delete organization
302
+ ```
303
+
304
+ ### Bulk Import
305
+
306
+ Provided by `ldapBulkImport`:
307
+
308
+ ```
309
+ GET /api/v1/ldap/bulk-import/{resource}/template.csv # Generate CSV template from schema
310
+ POST /api/v1/ldap/bulk-import/{resource} # Import entries from CSV file
311
+ ```
312
+
313
+ **Parameters for POST**:
314
+
315
+ - `file` (multipart): CSV file to import
316
+ - `dryRun` (optional): Validate without creating (true/false)
317
+ - `updateExisting` (optional): Update existing entries (true/false)
318
+ - `continueOnError` (optional): Continue on errors (true/false, default: true)
319
+
320
+ ### Static Files
321
+
322
+ Provided by `static`:
323
+
324
+ ```
325
+ GET /static/* # Serve static files
326
+ GET /static/schemas/*.json # Serve schemas (with config replacement)
327
+ ```
328
+
329
+ ## Command-Line Tools
330
+
331
+ ### cleanup-external-users
332
+
333
+ Remove orphaned external contacts:
334
+
335
+ ```bash
336
+ # Preview deletions
337
+ cleanup-external-users --dry-run
338
+
339
+ # Delete with verbose output
340
+ cleanup-external-users --verbose
341
+
342
+ # Delete silently (for cron)
343
+ cleanup-external-users --quiet
344
+
345
+ # Show help
346
+ cleanup-external-users --help
347
+ ```
348
+
349
+ See also: [ldapExternalUsersInGroups.md](ldapExternalUsersInGroups.md)
350
+
351
+ ## Hooks System
352
+
353
+ Plugins can register hooks to intercept and modify operations:
354
+
355
+ ### Common Hooks
356
+
357
+ - `ldap{Entity}add` - Before adding entry
358
+ - `ldap{Entity}adddone` - After adding entry
359
+ - `ldap{Entity}modify` - Before modifying entry
360
+ - `ldap{Entity}modifydone` - After modifying entry
361
+ - `ldap{Entity}delete` - Before deleting entry
362
+ - `ldap{Entity}deletedone` - After deleting entry
363
+ - `onLdapChange` - Any LDAP change
364
+ - `onLdapMailChange` - Mail attribute changed
365
+ - `onLdapQuotaChange` - Quota attribute changed
366
+ - `ldapsearchrequest` - Before LDAP search
367
+ - `getOrganisationTop` - Before returning organization tree top
368
+
369
+ See individual plugin documentation for specific hooks.
370
+
371
+ ## Development
372
+
373
+ ### Creating Custom Plugins
374
+
375
+ 1. Extend `DmPlugin` base class
376
+ 2. Define plugin name and dependencies
377
+ 3. Implement `api()` method for REST endpoints
378
+ 4. Register hooks for LDAP operations
379
+ 5. Load plugin via `--plugin path/to/plugin`
380
+
381
+ Example:
382
+
383
+ ```typescript
384
+ import DmPlugin from '../abstract/plugin';
385
+ import type { Express } from 'express';
386
+ import type { Hooks } from '../hooks';
387
+
388
+ export default class MyPlugin extends DmPlugin {
389
+ name = 'myPlugin';
390
+
391
+ dependencies = {
392
+ onChange: 'core/ldap/onChange',
393
+ };
394
+
395
+ api(app: Express): void {
396
+ app.get('/api/v1/my-endpoint', async (req, res) => {
397
+ res.json({ message: 'Hello from MyPlugin' });
398
+ });
399
+ }
400
+
401
+ hooks: Hooks = {
402
+ onLdapChange: async (dn, changes) => {
403
+ this.logger.info(`LDAP change detected: ${dn}`);
404
+ },
405
+ };
406
+ }
407
+ ```
408
+
409
+ ### Plugin Priorities
410
+
411
+ Some plugins must load before others. See `src/plugins/priority.json`:
412
+
413
+ ```json
414
+ [
415
+ "core/auth/token",
416
+ "core/auth/llng",
417
+ "core/auth/openidconnect",
418
+ "core/auth/authzPerBranch"
419
+ ]
420
+ ```
421
+
422
+ Authentication plugins load first to secure API endpoints.
423
+
424
+ ## Troubleshooting
425
+
426
+ ### Common Issues
427
+
428
+ 1. **Plugin not found**: Check plugin name matches exactly
429
+ 2. **LDAP connection failed**: Verify URL, DN, and password
430
+ 3. **Schema validation failed**: Check schema syntax and required fields
431
+ 4. **404 on API**: Ensure plugin providing endpoint is loaded
432
+ 5. **Permission denied**: Check authentication and authorization config
433
+
434
+ ### Debug Mode
435
+
436
+ Enable detailed logging:
437
+
438
+ ```bash
439
+ ldap-rest --log-level debug ...
440
+ ```
441
+
442
+ ### Testing
443
+
444
+ Run test suite:
445
+
446
+ ```bash
447
+ # All tests
448
+ source ~/.test-env && npm run test:dev
449
+
450
+ # Single test file
451
+ source ~/.test-env && npm run test:one test/path/to/file.test.ts
452
+ ```
453
+
454
+ See `DEVELOPMENT.md` for more testing information.
455
+
456
+ ## Support
457
+
458
+ - **Issues**: https://github.com/linagora/ldap-rest/issues
459
+ - **Documentation**: https://github.com/linagora/ldap-rest/tree/master/docs
460
+ - **Examples**: See `DEVELOPMENT.md` and plugin documentation
461
+
462
+ ## License
463
+
464
+ [![Powered by LINAGORA](./linagora.png)](https://linagora.com)
465
+
466
+ License: [AGPL-3.0](../LICENSE), copyright 2025-present LINAGORA.