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.
- package/LICENSE +661 -0
- package/README.md +48 -0
- package/bin/cleanup-external-users.mjs +219 -0
- package/bin/index.mjs +54 -0
- package/bin/sync-james.mjs +190 -0
- package/dist/abstract/ldapFlat.js +1 -0
- package/dist/abstract/plugin.js +1 -0
- package/dist/abstract/twakePlugin.js +1 -0
- package/dist/bin/index.js +1 -0
- package/dist/config/args.js +1 -0
- package/dist/lib/auth/base.js +1 -0
- package/dist/lib/authz/base.js +1 -0
- package/dist/lib/expressFormatedResponses.js +1 -0
- package/dist/lib/ldapActions.js +1 -0
- package/dist/lib/parseConfig.js +1 -0
- package/dist/lib/utils.js +1 -0
- package/dist/logger/winston.js +1 -0
- package/dist/plugins/auth/authzLinid1.js +1 -0
- package/dist/plugins/auth/authzPerBranch.js +1 -0
- package/dist/plugins/auth/crowdsec.js +1 -0
- package/dist/plugins/auth/llng.js +1 -0
- package/dist/plugins/auth/openidconnect.js +1 -0
- package/dist/plugins/auth/rateLimit.js +1 -0
- package/dist/plugins/auth/token.js +1 -0
- package/dist/plugins/configApi.js +1 -0
- package/dist/plugins/demo/helloworld.js +1 -0
- package/dist/plugins/ldap/bulkImport.js +1 -0
- package/dist/plugins/ldap/departmentSync.js +1 -0
- package/dist/plugins/ldap/externalUsersInGroups.js +1 -0
- package/dist/plugins/ldap/flatGeneric.js +1 -0
- package/dist/plugins/ldap/groups.js +1 -0
- package/dist/plugins/ldap/onChange.js +1 -0
- package/dist/plugins/ldap/organization.js +1 -0
- package/dist/plugins/ldap/trash.js +1 -0
- package/dist/plugins/priority.json.js +1 -0
- package/dist/plugins/static.js +1 -0
- package/dist/plugins/twake/calendarResources.js +1 -0
- package/dist/plugins/twake/james.js +1 -0
- package/dist/plugins/weblogs.js +1 -0
- package/dist/src/abstract/ldapFlat.d.ts +94 -0
- package/dist/src/abstract/plugin.d.ts +43 -0
- package/dist/src/abstract/twakePlugin.d.ts +90 -0
- package/dist/src/bin/index.d.ts +43 -0
- package/dist/src/browser/ldap-group-editor/LdapGroupEditor.d.ts +31 -0
- package/dist/src/browser/ldap-group-editor/api/GroupApiClient.d.ts +23 -0
- package/dist/src/browser/ldap-group-editor/components/CreateGroupModal.d.ts +19 -0
- package/dist/src/browser/ldap-group-editor/components/GroupPropertyEditor.d.ts +30 -0
- package/dist/src/browser/ldap-group-editor/components/GroupTree.d.ts +17 -0
- package/dist/src/browser/ldap-group-editor/components/MoveGroupModal.d.ts +20 -0
- package/dist/src/browser/ldap-group-editor/index.d.ts +6 -0
- package/dist/src/browser/ldap-group-editor/types.d.ts +58 -0
- package/dist/src/browser/ldap-resource-editor/api/ResourceApiClient.d.ts +53 -0
- package/dist/src/browser/ldap-resource-editor/cache/CacheManager.d.ts +65 -0
- package/dist/src/browser/ldap-resource-editor/index.d.ts +6 -0
- package/dist/src/browser/ldap-resource-editor/types.d.ts +78 -0
- package/dist/src/browser/ldap-tree-viewer/LdapTreeViewer.d.ts +26 -0
- package/dist/src/browser/ldap-tree-viewer/api/LdapApiClient.d.ts +30 -0
- package/dist/src/browser/ldap-tree-viewer/components/TreeNode.d.ts +17 -0
- package/dist/src/browser/ldap-tree-viewer/components/TreeRoot.d.ts +14 -0
- package/dist/src/browser/ldap-tree-viewer/index.d.ts +7 -0
- package/dist/src/browser/ldap-tree-viewer/store/Store.d.ts +18 -0
- package/dist/src/browser/ldap-tree-viewer/store/actions.d.ts +28 -0
- package/dist/src/browser/ldap-tree-viewer/store/reducers.d.ts +7 -0
- package/dist/src/browser/ldap-tree-viewer/types.d.ts +34 -0
- package/dist/src/browser/ldap-unit-editor/LdapUnitEditor.d.ts +27 -0
- package/dist/src/browser/ldap-unit-editor/api/UnitApiClient.d.ts +24 -0
- package/dist/src/browser/ldap-unit-editor/components/MoveUnitModal.d.ts +28 -0
- package/dist/src/browser/ldap-unit-editor/components/UnitPropertyEditor.d.ts +28 -0
- package/dist/src/browser/ldap-unit-editor/components/UnitTree.d.ts +18 -0
- package/dist/src/browser/ldap-unit-editor/index.d.ts +6 -0
- package/dist/src/browser/ldap-unit-editor/types.d.ts +55 -0
- package/dist/src/browser/ldap-user-editor/LdapUserEditor.d.ts +32 -0
- package/dist/src/browser/ldap-user-editor/api/UserApiClient.d.ts +55 -0
- package/dist/src/browser/ldap-user-editor/cache/CacheManager.d.ts +65 -0
- package/dist/src/browser/ldap-user-editor/components/MoveUserModal.d.ts +28 -0
- package/dist/src/browser/ldap-user-editor/components/PointerField.d.ts +22 -0
- package/dist/src/browser/ldap-user-editor/components/UserEditor.d.ts +46 -0
- package/dist/src/browser/ldap-user-editor/components/UserList.d.ts +24 -0
- package/dist/src/browser/ldap-user-editor/components/UserTree.d.ts +24 -0
- package/dist/src/browser/ldap-user-editor/index.d.ts +7 -0
- package/dist/src/browser/ldap-user-editor/types.d.ts +67 -0
- package/dist/src/browser/shared/components/Modal.d.ts +38 -0
- package/dist/src/browser/shared/components/StatusMessage.d.ts +48 -0
- package/dist/src/browser/shared/index.d.ts +10 -0
- package/dist/src/browser/shared/types/index.d.ts +65 -0
- package/dist/src/browser/shared/utils/dom.d.ts +33 -0
- package/dist/src/browser/shared/utils/form.d.ts +28 -0
- package/dist/src/browser/shared/utils/schema.d.ts +29 -0
- package/dist/src/config/args.d.ts +128 -0
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/hooks.d.ts +76 -0
- package/dist/src/lib/auth/base.d.ts +9 -0
- package/dist/src/lib/authz/base.d.ts +63 -0
- package/dist/src/lib/expressFormatedResponses.d.ts +26 -0
- package/dist/src/lib/ldapActions.d.ts +91 -0
- package/dist/src/lib/parseConfig.d.ts +23 -0
- package/dist/src/lib/utils.d.ts +73 -0
- package/dist/src/logger/winston.d.ts +3 -0
- package/dist/src/plugins/auth/authzLinid1.d.ts +46 -0
- package/dist/src/plugins/auth/authzPerBranch.d.ts +59 -0
- package/dist/src/plugins/auth/crowdsec.d.ts +29 -0
- package/dist/src/plugins/auth/llng.d.ts +8 -0
- package/dist/src/plugins/auth/openidconnect.d.ts +11 -0
- package/dist/src/plugins/auth/rateLimit.d.ts +24 -0
- package/dist/src/plugins/auth/token.d.ts +17 -0
- package/dist/src/plugins/configApi.d.ts +24 -0
- package/dist/src/plugins/demo/helloworld.d.ts +12 -0
- package/dist/src/plugins/ldap/bulkImport.d.ts +48 -0
- package/dist/src/plugins/ldap/departmentSync.d.ts +35 -0
- package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +21 -0
- package/dist/src/plugins/ldap/flatGeneric.d.ts +31 -0
- package/dist/src/plugins/ldap/groups.d.ts +95 -0
- package/dist/src/plugins/ldap/onChange.d.ts +32 -0
- package/dist/src/plugins/ldap/organization.d.ts +65 -0
- package/dist/src/plugins/ldap/trash.d.ts +52 -0
- package/dist/src/plugins/static.d.ts +7 -0
- package/dist/src/plugins/twake/calendarResources.d.ts +31 -0
- package/dist/src/plugins/twake/james.d.ts +83 -0
- package/dist/src/plugins/weblogs.d.ts +8 -0
- package/docs/DEVELOPER_GUIDE.md +298 -0
- package/docs/OPENAPI.md +440 -0
- package/docs/PLUGIN_DEPENDENCIES.md +612 -0
- package/docs/README.md +466 -0
- package/docs/api/REFERENCE.md +983 -0
- package/docs/api/REST_API.md +1237 -0
- package/docs/authentication.md +469 -0
- package/docs/authzLinid1.md +521 -0
- package/docs/authzPerBranch.md +596 -0
- package/docs/browser/LIBRARIES.md +1196 -0
- package/docs/examples/EXAMPLES.md +1659 -0
- package/docs/examples/twake-mailbox-type-nomenclature.ldif +37 -0
- package/docs/examples/twake-mailbox-type-schema-amendment.ldif +30 -0
- package/docs/jamesTeamMailboxes.md +343 -0
- package/docs/ldapBulkImport.md +722 -0
- package/docs/ldapExternalUsersInGroups.md +325 -0
- package/docs/ldapFlatGeneric.md +444 -0
- package/docs/ldapGroups.md +589 -0
- package/docs/ldapOrganizations.md +659 -0
- package/docs/ldapTrash.md +260 -0
- package/docs/linagora.png +0 -0
- package/docs/onChange.md +318 -0
- package/docs/plugins/DEVELOPMENT.md +1219 -0
- package/docs/presenterm-fr.md +721 -0
- package/docs/presenterm.md +721 -0
- package/docs/schemas/SCHEMAS.md +1212 -0
- package/docs/static.md +410 -0
- package/docs/twakeCalendarResources.md +148 -0
- package/docs/twakeJames.md +661 -0
- package/docs/weblogs.md +399 -0
- package/examples/web/ldap-group-editor.html +113 -0
- package/examples/web/ldap-tree-viewer.html +368 -0
- package/examples/web/ldap-unit-editor.html +108 -0
- package/examples/web/ldap-user-editor.html +412 -0
- package/package.json +458 -0
- package/static/browser/common-demo.css +450 -0
- package/static/browser/ldap-group-editor/LdapGroupEditor.js +207 -0
- package/static/browser/ldap-group-editor/LdapGroupEditor.js.map +1 -0
- package/static/browser/ldap-group-editor/api/GroupApiClient.js +112 -0
- package/static/browser/ldap-group-editor/api/GroupApiClient.js.map +1 -0
- package/static/browser/ldap-group-editor/components/CreateGroupModal.js +212 -0
- package/static/browser/ldap-group-editor/components/CreateGroupModal.js.map +1 -0
- package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js +497 -0
- package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js.map +1 -0
- package/static/browser/ldap-group-editor/components/GroupTree.js +153 -0
- package/static/browser/ldap-group-editor/components/GroupTree.js.map +1 -0
- package/static/browser/ldap-group-editor/components/MoveGroupModal.js +235 -0
- package/static/browser/ldap-group-editor/components/MoveGroupModal.js.map +1 -0
- package/static/browser/ldap-group-editor/index.js +2 -0
- package/static/browser/ldap-group-editor/index.js.map +1 -0
- package/static/browser/ldap-group-editor/types.js +2 -0
- package/static/browser/ldap-group-editor/types.js.map +1 -0
- package/static/browser/ldap-group-editor.esm.js +1399 -0
- package/static/browser/ldap-group-editor.esm.js.map +1 -0
- package/static/browser/ldap-group-editor.js +1407 -0
- package/static/browser/ldap-group-editor.js.map +1 -0
- package/static/browser/ldap-group-editor.min.js +2 -0
- package/static/browser/ldap-group-editor.min.js.map +1 -0
- package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +226 -0
- package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -0
- package/static/browser/ldap-resource-editor/cache/CacheManager.js +123 -0
- package/static/browser/ldap-resource-editor/cache/CacheManager.js.map +1 -0
- package/static/browser/ldap-resource-editor/index.js +2 -0
- package/static/browser/ldap-resource-editor/index.js.map +1 -0
- package/static/browser/ldap-resource-editor/types.js +2 -0
- package/static/browser/ldap-resource-editor/types.js.map +1 -0
- package/static/browser/ldap-tree-viewer/LdapTreeViewer.js +187 -0
- package/static/browser/ldap-tree-viewer/LdapTreeViewer.js.map +1 -0
- package/static/browser/ldap-tree-viewer/api/LdapApiClient.js +50 -0
- package/static/browser/ldap-tree-viewer/api/LdapApiClient.js.map +1 -0
- package/static/browser/ldap-tree-viewer/components/TreeNode.js +140 -0
- package/static/browser/ldap-tree-viewer/components/TreeNode.js.map +1 -0
- package/static/browser/ldap-tree-viewer/components/TreeRoot.js +98 -0
- package/static/browser/ldap-tree-viewer/components/TreeRoot.js.map +1 -0
- package/static/browser/ldap-tree-viewer/index.js +2 -0
- package/static/browser/ldap-tree-viewer/index.js.map +1 -0
- package/static/browser/ldap-tree-viewer/store/Store.js +29 -0
- package/static/browser/ldap-tree-viewer/store/Store.js.map +1 -0
- package/static/browser/ldap-tree-viewer/store/actions.js +53 -0
- package/static/browser/ldap-tree-viewer/store/actions.js.map +1 -0
- package/static/browser/ldap-tree-viewer/store/reducers.js +79 -0
- package/static/browser/ldap-tree-viewer/store/reducers.js.map +1 -0
- package/static/browser/ldap-tree-viewer/types.js +2 -0
- package/static/browser/ldap-tree-viewer/types.js.map +1 -0
- package/static/browser/ldap-tree-viewer.css +2 -0
- package/static/browser/ldap-tree-viewer.css.map +1 -0
- package/static/browser/ldap-tree-viewer.esm.js +606 -0
- package/static/browser/ldap-tree-viewer.esm.js.map +1 -0
- package/static/browser/ldap-tree-viewer.js +614 -0
- package/static/browser/ldap-tree-viewer.js.map +1 -0
- package/static/browser/ldap-tree-viewer.min.js +2 -0
- package/static/browser/ldap-tree-viewer.min.js.map +1 -0
- package/static/browser/ldap-unit-editor/LdapUnitEditor.js +119 -0
- package/static/browser/ldap-unit-editor/LdapUnitEditor.js.map +1 -0
- package/static/browser/ldap-unit-editor/api/UnitApiClient.js +95 -0
- package/static/browser/ldap-unit-editor/api/UnitApiClient.js.map +1 -0
- package/static/browser/ldap-unit-editor/components/MoveUnitModal.js +295 -0
- package/static/browser/ldap-unit-editor/components/MoveUnitModal.js.map +1 -0
- package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js +321 -0
- package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js.map +1 -0
- package/static/browser/ldap-unit-editor/components/UnitTree.js +197 -0
- package/static/browser/ldap-unit-editor/components/UnitTree.js.map +1 -0
- package/static/browser/ldap-unit-editor/index.js +2 -0
- package/static/browser/ldap-unit-editor/index.js.map +1 -0
- package/static/browser/ldap-unit-editor/types.js +2 -0
- package/static/browser/ldap-unit-editor/types.js.map +1 -0
- package/static/browser/ldap-unit-editor.esm.js +1013 -0
- package/static/browser/ldap-unit-editor.esm.js.map +1 -0
- package/static/browser/ldap-unit-editor.js +1021 -0
- package/static/browser/ldap-unit-editor.js.map +1 -0
- package/static/browser/ldap-unit-editor.min.js +2 -0
- package/static/browser/ldap-unit-editor.min.js.map +1 -0
- package/static/browser/ldap-user-editor/LdapUserEditor.js +184 -0
- package/static/browser/ldap-user-editor/LdapUserEditor.js.map +1 -0
- package/static/browser/ldap-user-editor/api/UserApiClient.js +209 -0
- package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -0
- package/static/browser/ldap-user-editor/cache/CacheManager.js +123 -0
- package/static/browser/ldap-user-editor/cache/CacheManager.js.map +1 -0
- package/static/browser/ldap-user-editor/components/MoveUserModal.js +302 -0
- package/static/browser/ldap-user-editor/components/MoveUserModal.js.map +1 -0
- package/static/browser/ldap-user-editor/components/PointerField.js +152 -0
- package/static/browser/ldap-user-editor/components/PointerField.js.map +1 -0
- package/static/browser/ldap-user-editor/components/UserEditor.js +608 -0
- package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -0
- package/static/browser/ldap-user-editor/components/UserList.js +181 -0
- package/static/browser/ldap-user-editor/components/UserList.js.map +1 -0
- package/static/browser/ldap-user-editor/components/UserTree.js +164 -0
- package/static/browser/ldap-user-editor/components/UserTree.js.map +1 -0
- package/static/browser/ldap-user-editor/index.js +2 -0
- package/static/browser/ldap-user-editor/index.js.map +1 -0
- package/static/browser/ldap-user-editor/types.js +2 -0
- package/static/browser/ldap-user-editor/types.js.map +1 -0
- package/static/browser/ldap-user-editor.css +2 -0
- package/static/browser/ldap-user-editor.css.map +1 -0
- package/static/browser/ldap-user-editor.esm.js +1897 -0
- package/static/browser/ldap-user-editor.esm.js.map +1 -0
- package/static/browser/ldap-user-editor.js +1905 -0
- package/static/browser/ldap-user-editor.js.map +1 -0
- package/static/browser/ldap-user-editor.min.js +2 -0
- package/static/browser/ldap-user-editor.min.js.map +1 -0
- package/static/browser/shared/components/Modal.js +121 -0
- package/static/browser/shared/components/Modal.js.map +1 -0
- package/static/browser/shared/components/StatusMessage.js +119 -0
- package/static/browser/shared/components/StatusMessage.js.map +1 -0
- package/static/browser/shared/index.js +7 -0
- package/static/browser/shared/index.js.map +1 -0
- package/static/browser/shared/types/index.js +37 -0
- package/static/browser/shared/types/index.js.map +1 -0
- package/static/browser/shared/utils/dom.js +78 -0
- package/static/browser/shared/utils/dom.js.map +1 -0
- package/static/browser/shared/utils/form.js +234 -0
- package/static/browser/shared/utils/form.js.map +1 -0
- package/static/browser/shared/utils/schema.js +121 -0
- package/static/browser/shared/utils/schema.js.map +1 -0
- package/static/browser/shared.esm.js +694 -0
- package/static/browser/shared.esm.js.map +1 -0
- package/static/browser/shared.js +723 -0
- package/static/browser/shared.js.map +1 -0
- package/static/browser/shared.min.js +2 -0
- package/static/browser/shared.min.js.map +1 -0
- package/static/schemas/ad/computers.json +92 -0
- package/static/schemas/ad/groups.json +55 -0
- package/static/schemas/ad/organizations.json +66 -0
- package/static/schemas/ad/users.json +116 -0
- package/static/schemas/standard/devices.json +72 -0
- package/static/schemas/standard/groups.json +54 -0
- package/static/schemas/standard/organizations.json +49 -0
- package/static/schemas/standard/users.json +86 -0
- package/static/schemas/twake/groups.json +75 -0
- package/static/schemas/twake/nomenclature/twakeAccountStatus.json +31 -0
- package/static/schemas/twake/nomenclature/twakeDeliveryMode.json +31 -0
- package/static/schemas/twake/nomenclature/twakeListType.json +31 -0
- package/static/schemas/twake/nomenclature/twakeMailboxType.json +31 -0
- package/static/schemas/twake/nomenclature/twakeTitle.json +31 -0
- package/static/schemas/twake/organizations.json +52 -0
- package/static/schemas/twake/positions.json +32 -0
- 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
|
+
[](https://linagora.com)
|
|
465
|
+
|
|
466
|
+
License: [AGPL-3.0](../LICENSE), copyright 2025-present LINAGORA.
|