ldap-rest 0.1.3 → 0.1.5
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/README.md +31 -21
- package/dist/abstract/ldapFlat.js +1 -1
- package/dist/lib/ldapActions.js +1 -1
- package/dist/plugins/ldap/groups.js +1 -1
- package/dist/src/abstract/ldapFlat.d.ts +9 -0
- package/dist/src/browser/ldap-user-editor/components/UserTree.d.ts +2 -1
- package/dist/src/browser/shared/components/DisposableComponent.d.ts +29 -0
- package/dist/src/browser/shared/components/Modal.d.ts +6 -1
- package/dist/src/lib/ldapActions.d.ts +9 -0
- package/dist/src/plugins/ldap/groups.d.ts +9 -0
- package/docs/README.md +23 -486
- package/docs/{DEVELOPER_GUIDE.md → client-development/README.md} +24 -24
- package/docs/client-development/api/README.md +75 -0
- package/docs/client-development/browser/README.md +65 -0
- package/docs/{plugins/DEVELOPMENT.md → plugin-development/README.md} +4 -9
- package/docs/plugin-development/hooks.md +18 -0
- package/docs/usage/README.md +89 -0
- package/docs/usage/configuration.md +375 -0
- package/docs/usage/plugins/README.md +87 -0
- package/docs/usage/plugins/auth/README.md +65 -0
- package/docs/usage/plugins/auth/crowdsec.md +95 -0
- package/docs/usage/plugins/auth/hmac.md +293 -0
- package/docs/usage/plugins/auth/llng.md +99 -0
- package/docs/usage/plugins/auth/oidc.md +167 -0
- package/docs/usage/plugins/auth/rate-limit.md +62 -0
- package/docs/usage/plugins/auth/token.md +136 -0
- package/docs/usage/plugins/auth/totp.md +213 -0
- package/docs/usage/plugins/auth/trusted-proxy.md +127 -0
- package/docs/usage/plugins/integrations/README.md +42 -0
- package/docs/usage/plugins/ldap/README.md +79 -0
- package/docs/usage/troubleshooting.md +105 -0
- package/package.json +9 -1
- package/static/browser/ldap-user-editor/components/UserTree.js +6 -3
- package/static/browser/ldap-user-editor/components/UserTree.js.map +1 -1
- package/static/browser/ldap-user-editor.esm.js +62 -3
- package/static/browser/ldap-user-editor.esm.js.map +1 -1
- package/static/browser/ldap-user-editor.js +62 -3
- package/static/browser/ldap-user-editor.js.map +1 -1
- package/static/browser/ldap-user-editor.min.js +1 -1
- package/static/browser/ldap-user-editor.min.js.map +1 -1
- package/static/browser/shared/components/DisposableComponent.js +59 -0
- package/static/browser/shared/components/DisposableComponent.js.map +1 -0
- package/static/browser/shared/components/Modal.js +16 -6
- package/static/browser/shared/components/Modal.js.map +1 -1
- package/static/browser/shared.esm.js +72 -6
- package/static/browser/shared.esm.js.map +1 -1
- package/static/browser/shared.js +72 -6
- package/static/browser/shared.js.map +1 -1
- package/static/browser/shared.min.js +1 -1
- package/static/browser/shared.min.js.map +1 -1
- package/docs/authentication.md +0 -1194
- /package/docs/{OPENAPI.md → client-development/api/openapi.md} +0 -0
- /package/docs/{api/REFERENCE.md → client-development/api/reference.md} +0 -0
- /package/docs/{api/REST_API.md → client-development/api/rest-api.md} +0 -0
- /package/docs/{browser/LIBRARIES.md → client-development/browser/libraries.md} +0 -0
- /package/docs/{examples/EXAMPLES.md → client-development/examples/README.md} +0 -0
- /package/docs/{examples → client-development/examples/ldif}/twake-mailbox-type-nomenclature.ldif +0 -0
- /package/docs/{examples → client-development/examples/ldif}/twake-mailbox-type-schema-amendment.ldif +0 -0
- /package/docs/{schemas/SCHEMAS.md → client-development/schemas/README.md} +0 -0
- /package/docs/{PLUGIN_DEPENDENCIES.md → plugin-development/dependencies.md} +0 -0
- /package/docs/{testing-with-embedded-ldap.md → plugin-development/testing.md} +0 -0
- /package/docs/{presenterm.md → presentations/en.md} +0 -0
- /package/docs/{presenterm-fr.md → presentations/fr.md} +0 -0
- /package/docs/{authzLinid1.md → usage/plugins/auth/authz-linid1.md} +0 -0
- /package/docs/{authzPerBranch.md → usage/plugins/auth/authz-per-branch.md} +0 -0
- /package/docs/{twakeAppAccountsApi.md → usage/plugins/integrations/app-accounts.md} +0 -0
- /package/docs/{twakeCalendarResources.md → usage/plugins/integrations/calendar-resources.md} +0 -0
- /package/docs/{twakeJames.md → usage/plugins/integrations/james-mail.md} +0 -0
- /package/docs/{jamesTeamMailboxes.md → usage/plugins/integrations/james-mailboxes.md} +0 -0
- /package/docs/{ldapBulkImport.md → usage/plugins/ldap/bulk-import.md} +0 -0
- /package/docs/{ldapExternalUsersInGroups.md → usage/plugins/ldap/external-users.md} +0 -0
- /package/docs/{ldapFlatGeneric.md → usage/plugins/ldap/flat-generic.md} +0 -0
- /package/docs/{ldapGroups.md → usage/plugins/ldap/groups.md} +0 -0
- /package/docs/{onChange.md → usage/plugins/ldap/on-change.md} +0 -0
- /package/docs/{ldapOrganizations.md → usage/plugins/ldap/organizations.md} +0 -0
- /package/docs/{ldapTrash.md → usage/plugins/ldap/trash.md} +0 -0
- /package/docs/{static.md → usage/plugins/utilities/static.md} +0 -0
- /package/docs/{weblogs.md → usage/plugins/utilities/weblogs.md} +0 -0
package/docs/README.md
CHANGED
|
@@ -1,509 +1,46 @@
|
|
|
1
1
|
# LDAP-Rest Documentation
|
|
2
2
|
|
|
3
|
-
Complete documentation for
|
|
3
|
+
Complete documentation for LDAP-Rest, organized by use case.
|
|
4
4
|
|
|
5
|
-
##
|
|
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
|
-
- **[twakeAppAccountsApi](twakeAppAccountsApi.md)** - Applicative accounts API (device/app-specific accounts)
|
|
81
|
-
|
|
82
|
-
## Quick Start
|
|
83
|
-
|
|
84
|
-
### Basic LDAP Server
|
|
85
|
-
|
|
86
|
-
Minimal setup with user management:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
ldap-rest \
|
|
90
|
-
--plugin core/ldap/flatGeneric \
|
|
91
|
-
--ldap-url ldap://localhost:389 \
|
|
92
|
-
--ldap-dn "cn=admin,dc=example,dc=com" \
|
|
93
|
-
--ldap-pwd "password" \
|
|
94
|
-
--ldap-base "dc=example,dc=com" \
|
|
95
|
-
--ldap-flat-schema ./schemas/standard/users.json
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### With Authentication
|
|
99
|
-
|
|
100
|
-
Add token authentication:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
ldap-rest \
|
|
104
|
-
--plugin core/auth/token \
|
|
105
|
-
--plugin core/ldap/flatGeneric \
|
|
106
|
-
--auth-token "secret-token" \
|
|
107
|
-
--ldap-flat-schema ./schemas/standard/users.json \
|
|
108
|
-
...
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Complete Setup
|
|
112
|
-
|
|
113
|
-
Full-featured LDAP management with web UI:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
ldap-rest \
|
|
117
|
-
--plugin core/auth/token \
|
|
118
|
-
--plugin core/ldap/flatGeneric \
|
|
119
|
-
--plugin core/ldap/groups \
|
|
120
|
-
--plugin core/ldap/organization \
|
|
121
|
-
--plugin core/ldap/bulkImport \
|
|
122
|
-
--plugin core/ldap/externalUsersInGroups \
|
|
123
|
-
--plugin core/static \
|
|
124
|
-
--plugin core/weblogs \
|
|
125
|
-
--ldap-flat-schema ./schemas/standard/users.json \
|
|
126
|
-
--bulk-import-schemas "users:./schemas/standard/users.json" \
|
|
127
|
-
--auth-token "admin-token" \
|
|
128
|
-
--static-path ./static \
|
|
129
|
-
...
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Plugin Categories
|
|
133
|
-
|
|
134
|
-
### LDAP Entities
|
|
135
|
-
|
|
136
|
-
Plugins for managing different LDAP entity types:
|
|
137
|
-
|
|
138
|
-
| Plugin | Entity Type | Features |
|
|
139
|
-
| ---------------------- | ------------------------ | --------------------------------------------- |
|
|
140
|
-
| core/ldap/flatGeneric | Users, Positions, Custom | Schema-driven, Validation, Pointers |
|
|
141
|
-
| core/ldap/groups | Groups | Member validation, Nested groups |
|
|
142
|
-
| core/ldap/organization | Organizational Units | Tree navigation, Search |
|
|
143
|
-
| core/ldap/bulkImport | Any (bulk operations) | CSV import, Template generation, Multi-schema |
|
|
144
|
-
| core/ldap/trash | Any (soft delete) | Trash system, Recovery, Metadata |
|
|
145
|
-
|
|
146
|
-
### Authentication
|
|
147
|
-
|
|
148
|
-
Secure API access:
|
|
149
|
-
|
|
150
|
-
| Plugin | Type | Use Case |
|
|
151
|
-
| ------------------------ | ------------- | ---------------------------- |
|
|
152
|
-
| core/auth/token | Bearer tokens | Development, APIs, Scripts |
|
|
153
|
-
| core/auth/llng | LemonLDAP::NG | Enterprise SSO |
|
|
154
|
-
| core/auth/openidconnect | OAuth2/OIDC | Cloud identity, Social login |
|
|
155
|
-
| core/auth/authzPerBranch | Authorization | Branch-level access control |
|
|
156
|
-
| core/auth/authzLinid1 | Authorization | LinID 1.x integration |
|
|
157
|
-
|
|
158
|
-
### Security
|
|
159
|
-
|
|
160
|
-
Protection and rate limiting:
|
|
161
|
-
|
|
162
|
-
| Plugin | Type | Use Case |
|
|
163
|
-
| ------------------- | ------------- | ----------------------------- |
|
|
164
|
-
| core/auth/crowdsec | IP blocking | Block banned IPs via CrowdSec |
|
|
165
|
-
| core/auth/rateLimit | Rate limiting | Prevent brute-force attacks |
|
|
166
|
-
|
|
167
|
-
### Integration
|
|
168
|
-
|
|
169
|
-
Connect to external systems:
|
|
170
|
-
|
|
171
|
-
| Plugin | Integrates With | Purpose |
|
|
172
|
-
| ------------------------------- | --------------- | ------------------------ |
|
|
173
|
-
| core/ldap/onChange | Any | Detect LDAP changes |
|
|
174
|
-
| core/twake/james | Apache James | Mail server sync |
|
|
175
|
-
| core/twake/appAccountsApi | LDAP | App-specific account API |
|
|
176
|
-
| core/ldap/externalUsersInGroups | Groups | Auto-create contacts |
|
|
177
|
-
|
|
178
|
-
### Utilities
|
|
179
|
-
|
|
180
|
-
Support plugins:
|
|
181
|
-
|
|
182
|
-
| Plugin | Purpose |
|
|
183
|
-
| ------------ | --------------------- |
|
|
184
|
-
| core/static | Serve web UI, schemas |
|
|
185
|
-
| core/weblogs | Request logging |
|
|
186
|
-
|
|
187
|
-
## Plugin Dependencies
|
|
188
|
-
|
|
189
|
-
Some plugins require others:
|
|
190
|
-
|
|
191
|
-
```
|
|
192
|
-
core/twake/james
|
|
193
|
-
└─ requires: core/ldap/onChange
|
|
194
|
-
|
|
195
|
-
core/ldap/externalUsersInGroups
|
|
196
|
-
└─ requires: core/ldap/groups
|
|
197
|
-
|
|
198
|
-
core/auth/authzPerBranch
|
|
199
|
-
└─ requires: Any authentication plugin (core/auth/token, core/auth/llng, core/auth/openidconnect)
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Configuration
|
|
203
|
-
|
|
204
|
-
### Environment Variables
|
|
205
|
-
|
|
206
|
-
All CLI options can be set via environment variables:
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# LDAP connection
|
|
210
|
-
export DM_LDAP_URL="ldap://localhost:389" # or multiple URLs for failover
|
|
211
|
-
export DM_LDAP_DN="cn=admin,dc=example,dc=com"
|
|
212
|
-
export DM_LDAP_PWD="password"
|
|
213
|
-
export DM_LDAP_BASE="dc=example,dc=com"
|
|
214
|
-
|
|
215
|
-
# Plugins
|
|
216
|
-
export DM_PLUGIN="core/auth/token,core/ldap/flatGeneric"
|
|
217
|
-
export DM_AUTH_TOKENS="token1,token2"
|
|
218
|
-
export DM_LDAP_FLAT_SCHEMA="./schemas/users.json"
|
|
219
|
-
|
|
220
|
-
# Logging
|
|
221
|
-
export DM_LOG_LEVEL="notice" # error, warn, notice, info, debug
|
|
222
|
-
|
|
223
|
-
# Start server
|
|
224
|
-
ldap-rest
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### LDAP Failover
|
|
228
|
-
|
|
229
|
-
LDAP-Rest supports multiple LDAP servers for high availability. Provide multiple URLs separated by commas:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# Command line
|
|
233
|
-
--ldap-url ldap://ldap1.example.com,ldap://ldap2.example.com,ldap://ldap3.example.com
|
|
5
|
+
## Documentation Categories
|
|
234
6
|
|
|
235
|
-
|
|
236
|
-
export DM_LDAP_URL="ldap://ldap1.example.com,ldap://ldap2.example.com,ldap://ldap3.example.com"
|
|
237
|
-
```
|
|
7
|
+
### [Usage](usage/README.md)
|
|
238
8
|
|
|
239
|
-
|
|
9
|
+
Installation, configuration and plugin usage.
|
|
240
10
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
4. Log failover events for monitoring
|
|
11
|
+
- **[Getting Started](usage/README.md)** - Quick start guide
|
|
12
|
+
- **[Configuration](usage/configuration.md)** - CLI options and environment variables
|
|
13
|
+
- **[Plugins](usage/plugins/README.md)** - Documentation for all available plugins
|
|
245
14
|
|
|
246
|
-
###
|
|
15
|
+
### [Plugin Development](plugin-development/README.md)
|
|
247
16
|
|
|
248
|
-
LDAP-Rest
|
|
17
|
+
Create and extend LDAP-Rest with custom plugins.
|
|
249
18
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
--log-level info # General info + web logs + warnings + errors
|
|
255
|
-
--log-level debug # All messages including debug output
|
|
256
|
-
```
|
|
19
|
+
- **[Development Guide](plugin-development/README.md)** - Architecture and plugin creation
|
|
20
|
+
- **[Hooks](plugin-development/hooks.md)** - LDAP hooks system
|
|
21
|
+
- **[Testing](plugin-development/testing.md)** - Testing with embedded LDAP
|
|
22
|
+
- **[Dependencies](plugin-development/dependencies.md)** - Plugin dependencies matrix
|
|
257
23
|
|
|
258
|
-
|
|
24
|
+
### [Client Application Development](client-development/README.md)
|
|
259
25
|
|
|
260
|
-
|
|
26
|
+
Integrate LDAP-Rest into your web applications.
|
|
261
27
|
|
|
262
|
-
|
|
28
|
+
- **[REST API](client-development/api/rest-api.md)** - Complete API reference
|
|
29
|
+
- **[Browser Libraries](client-development/browser/libraries.md)** - Web components (LdapTreeViewer, LdapUserEditor, etc.)
|
|
30
|
+
- **[JSON Schemas](client-development/schemas/README.md)** - Schema structure and validation
|
|
31
|
+
- **[Examples](client-development/examples/README.md)** - React, Vue.js, Vanilla JS integration
|
|
263
32
|
|
|
264
|
-
|
|
265
|
-
# Load configuration
|
|
266
|
-
source ~/.ldap-rest-config
|
|
267
|
-
|
|
268
|
-
# Start server
|
|
269
|
-
ldap-rest
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
## Schemas
|
|
273
|
-
|
|
274
|
-
### Standard Schemas
|
|
275
|
-
|
|
276
|
-
Located in `./static/schemas/standard/`:
|
|
277
|
-
|
|
278
|
-
- `users.json` - Standard inetOrgPerson users
|
|
279
|
-
- `groups.json` - Standard groupOfNames groups
|
|
280
|
-
- `organizations.json` - Organizational units
|
|
281
|
-
|
|
282
|
-
### Twake Schemas
|
|
283
|
-
|
|
284
|
-
Located in `./static/schemas/twake/`:
|
|
285
|
-
|
|
286
|
-
- `users.json` - Twake users with custom attributes
|
|
287
|
-
- `groups.json` - Twake static groups
|
|
288
|
-
- `positions.json` - Twake positions/roles
|
|
289
|
-
- `organizations.json` - Twake organizations
|
|
290
|
-
- `nomenclature/*.json` - Reference data (status, delivery mode, etc.)
|
|
291
|
-
|
|
292
|
-
### Active Directory Schemas
|
|
293
|
-
|
|
294
|
-
Located in `./static/schemas/ad/`:
|
|
295
|
-
|
|
296
|
-
- `users.json` - AD user accounts
|
|
297
|
-
- `groups.json` - AD security groups
|
|
298
|
-
- `organizations.json` - AD organizational units
|
|
299
|
-
|
|
300
|
-
## API Endpoints
|
|
301
|
-
|
|
302
|
-
### Entity Management
|
|
303
|
-
|
|
304
|
-
Generated by `ldapFlatGeneric`:
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
GET /api/v1/ldap/{pluralName} # List entries
|
|
308
|
-
GET /api/v1/ldap/{pluralName}/{id} # Get entry
|
|
309
|
-
POST /api/v1/ldap/{pluralName} # Create entry
|
|
310
|
-
PUT /api/v1/ldap/{pluralName}/{id} # Modify entry
|
|
311
|
-
DELETE /api/v1/ldap/{pluralName}/{id} # Delete entry
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### Groups
|
|
315
|
-
|
|
316
|
-
Provided by `ldapGroups`:
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
GET /api/v1/ldap/groups # List groups
|
|
320
|
-
GET /api/v1/ldap/groups/{cn} # Get group
|
|
321
|
-
POST /api/v1/ldap/groups # Create group
|
|
322
|
-
PUT /api/v1/ldap/groups/{cn} # Modify group
|
|
323
|
-
POST /api/v1/ldap/groups/{cn}/rename # Rename group (change cn)
|
|
324
|
-
POST /api/v1/ldap/groups/{cn}/move # Move group to different organization
|
|
325
|
-
DELETE /api/v1/ldap/groups/{cn} # Delete group
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Organizations
|
|
329
|
-
|
|
330
|
-
Provided by `ldapOrganizations`:
|
|
331
|
-
|
|
332
|
-
```
|
|
333
|
-
GET /api/v1/ldap/organizations/top # Get top organization(s)
|
|
334
|
-
GET /api/v1/ldap/organizations/{dn}/subnodes # List sub-organizations and linked entities
|
|
335
|
-
GET /api/v1/ldap/organizations/{dn}/subnodes/search # Search in organization
|
|
336
|
-
POST /api/v1/ldap/organizations # Create organization
|
|
337
|
-
PUT /api/v1/ldap/organizations/{dn} # Modify organization
|
|
338
|
-
POST /api/v1/ldap/organizations/{dn}/move # Move organization to different parent
|
|
339
|
-
DELETE /api/v1/ldap/organizations/{dn} # Delete organization
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### Bulk Import
|
|
343
|
-
|
|
344
|
-
Provided by `ldapBulkImport`:
|
|
345
|
-
|
|
346
|
-
```
|
|
347
|
-
GET /api/v1/ldap/bulk-import/{resource}/template.csv # Generate CSV template from schema
|
|
348
|
-
POST /api/v1/ldap/bulk-import/{resource} # Import entries from CSV file
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
**Parameters for POST**:
|
|
352
|
-
|
|
353
|
-
- `file` (multipart): CSV file to import
|
|
354
|
-
- `dryRun` (optional): Validate without creating (true/false)
|
|
355
|
-
- `updateExisting` (optional): Update existing entries (true/false)
|
|
356
|
-
- `continueOnError` (optional): Continue on errors (true/false, default: true)
|
|
357
|
-
|
|
358
|
-
### Static Files
|
|
359
|
-
|
|
360
|
-
Provided by `static`:
|
|
361
|
-
|
|
362
|
-
```
|
|
363
|
-
GET /static/* # Serve static files
|
|
364
|
-
GET /static/schemas/*.json # Serve schemas (with config replacement)
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
## Command-Line Tools
|
|
368
|
-
|
|
369
|
-
### cleanup-external-users
|
|
370
|
-
|
|
371
|
-
Remove orphaned external contacts:
|
|
372
|
-
|
|
373
|
-
```bash
|
|
374
|
-
# Preview deletions
|
|
375
|
-
cleanup-external-users --dry-run
|
|
376
|
-
|
|
377
|
-
# Delete with verbose output
|
|
378
|
-
cleanup-external-users --verbose
|
|
379
|
-
|
|
380
|
-
# Delete silently (for cron)
|
|
381
|
-
cleanup-external-users --quiet
|
|
382
|
-
|
|
383
|
-
# Show help
|
|
384
|
-
cleanup-external-users --help
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
See also: [ldapExternalUsersInGroups.md](ldapExternalUsersInGroups.md)
|
|
388
|
-
|
|
389
|
-
## Hooks System
|
|
390
|
-
|
|
391
|
-
Plugins can register hooks to intercept and modify operations:
|
|
392
|
-
|
|
393
|
-
### Common Hooks
|
|
394
|
-
|
|
395
|
-
- `ldap{Entity}add` - Before adding entry
|
|
396
|
-
- `ldap{Entity}adddone` - After adding entry
|
|
397
|
-
- `ldap{Entity}modify` - Before modifying entry
|
|
398
|
-
- `ldap{Entity}modifydone` - After modifying entry
|
|
399
|
-
- `ldap{Entity}delete` - Before deleting entry
|
|
400
|
-
- `ldap{Entity}deletedone` - After deleting entry
|
|
401
|
-
- `onLdapChange` - Any LDAP change
|
|
402
|
-
- `onLdapMailChange` - Mail attribute changed
|
|
403
|
-
- `onLdapQuotaChange` - Quota attribute changed
|
|
404
|
-
- `ldapsearchrequest` - Before LDAP search
|
|
405
|
-
- `getOrganisationTop` - Before returning organization tree top
|
|
406
|
-
|
|
407
|
-
See individual plugin documentation for specific hooks.
|
|
408
|
-
|
|
409
|
-
## Development
|
|
410
|
-
|
|
411
|
-
### Creating Custom Plugins
|
|
412
|
-
|
|
413
|
-
1. Extend `DmPlugin` base class
|
|
414
|
-
2. Define plugin name and dependencies
|
|
415
|
-
3. Implement `api()` method for REST endpoints
|
|
416
|
-
4. Register hooks for LDAP operations
|
|
417
|
-
5. Load plugin via `--plugin path/to/plugin`
|
|
418
|
-
|
|
419
|
-
Example:
|
|
420
|
-
|
|
421
|
-
```typescript
|
|
422
|
-
import DmPlugin from '../abstract/plugin';
|
|
423
|
-
import type { Express } from 'express';
|
|
424
|
-
import type { Hooks } from '../hooks';
|
|
425
|
-
|
|
426
|
-
export default class MyPlugin extends DmPlugin {
|
|
427
|
-
name = 'myPlugin';
|
|
428
|
-
|
|
429
|
-
dependencies = {
|
|
430
|
-
onChange: 'core/ldap/onChange',
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
api(app: Express): void {
|
|
434
|
-
app.get('/api/v1/my-endpoint', async (req, res) => {
|
|
435
|
-
res.json({ message: 'Hello from MyPlugin' });
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
hooks: Hooks = {
|
|
440
|
-
onLdapChange: async (dn, changes) => {
|
|
441
|
-
this.logger.info(`LDAP change detected: ${dn}`);
|
|
442
|
-
},
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
### Plugin Priorities
|
|
448
|
-
|
|
449
|
-
Some plugins must load before others. See `src/plugins/priority.json`:
|
|
450
|
-
|
|
451
|
-
```json
|
|
452
|
-
[
|
|
453
|
-
"core/auth/token",
|
|
454
|
-
"core/auth/llng",
|
|
455
|
-
"core/auth/openidconnect",
|
|
456
|
-
"core/auth/authzPerBranch"
|
|
457
|
-
]
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
Authentication plugins load first to secure API endpoints.
|
|
461
|
-
|
|
462
|
-
## Troubleshooting
|
|
463
|
-
|
|
464
|
-
### Common Issues
|
|
465
|
-
|
|
466
|
-
1. **Plugin not found**: Check plugin name matches exactly
|
|
467
|
-
2. **LDAP connection failed**: Verify URL, DN, and password
|
|
468
|
-
3. **Schema validation failed**: Check schema syntax and required fields
|
|
469
|
-
4. **404 on API**: Ensure plugin providing endpoint is loaded
|
|
470
|
-
5. **Permission denied**: Check authentication and authorization config
|
|
471
|
-
|
|
472
|
-
### Debug Mode
|
|
473
|
-
|
|
474
|
-
Enable detailed logging:
|
|
475
|
-
|
|
476
|
-
```bash
|
|
477
|
-
ldap-rest --log-level debug ...
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
Available log levels (following syslog convention):
|
|
481
|
-
|
|
482
|
-
- `error` - Only errors
|
|
483
|
-
- `warn` - Warnings and errors
|
|
484
|
-
- `notice` - Web access logs, warnings and errors (recommended for production)
|
|
485
|
-
- `info` - General info messages, web logs, warnings and errors
|
|
486
|
-
- `debug` - All messages including debug output
|
|
487
|
-
|
|
488
|
-
### Testing
|
|
489
|
-
|
|
490
|
-
Run test suite:
|
|
491
|
-
|
|
492
|
-
```bash
|
|
493
|
-
# All tests
|
|
494
|
-
source ~/.test-env && npm run test:dev
|
|
33
|
+
## Presentations
|
|
495
34
|
|
|
496
|
-
|
|
497
|
-
source ~/.test-env && npm run test:one test/path/to/file.test.ts
|
|
498
|
-
```
|
|
35
|
+
Interactive presentations (using [presenterm](https://github.com/mfontanini/presenterm)):
|
|
499
36
|
|
|
500
|
-
|
|
37
|
+
- **[English](presentations/en.md)** - `presenterm docs/presentations/en.md`
|
|
38
|
+
- **[French](presentations/fr.md)** - `presenterm docs/presentations/fr.md`
|
|
501
39
|
|
|
502
40
|
## Support
|
|
503
41
|
|
|
504
42
|
- **Issues**: https://github.com/linagora/ldap-rest/issues
|
|
505
43
|
- **Documentation**: https://github.com/linagora/ldap-rest/tree/master/docs
|
|
506
|
-
- **Examples**: See `DEVELOPMENT.md` and plugin documentation
|
|
507
44
|
|
|
508
45
|
## License
|
|
509
46
|
|
|
@@ -11,17 +11,17 @@ Welcome to the LDAP-Rest Developer Guide! This guide helps you build web applica
|
|
|
11
11
|
|
|
12
12
|
### 📚 Core Documentation
|
|
13
13
|
|
|
14
|
-
- **[REST API Documentation](./api/
|
|
15
|
-
- **[Browser Libraries](./browser/
|
|
16
|
-
- **[JSON Schemas](./schemas/
|
|
17
|
-
- **[Integration Examples](./examples/
|
|
18
|
-
- **[Plugin Development](
|
|
14
|
+
- **[REST API Documentation](./api/rest-api.md)** - Complete API reference (Config, Users, Groups, Organizations)
|
|
15
|
+
- **[Browser Libraries](./browser/libraries.md)** - LdapTreeViewer and LdapUserEditor
|
|
16
|
+
- **[JSON Schemas](./schemas/README.md)** - Schema structure and validation
|
|
17
|
+
- **[Integration Examples](./examples/README.md)** - React, Vue.js, Vanilla JavaScript examples
|
|
18
|
+
- **[Plugin Development](../plugin-development/README.md)** - Create your own plugins
|
|
19
19
|
|
|
20
20
|
### 🔧 Reference
|
|
21
21
|
|
|
22
|
-
- **[API Reference](./api/
|
|
23
|
-
- [Authentication](./api/
|
|
24
|
-
- [Troubleshooting](./api/
|
|
22
|
+
- **[API Reference](./api/reference.md)** - Complete API reference with all endpoints
|
|
23
|
+
- [Authentication](./api/rest-api.md#authentication) - OpenID, Token, LemonLDAP::NG
|
|
24
|
+
- [Troubleshooting](./api/reference.md#troubleshooting) - Common issues and solutions
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -152,14 +152,14 @@ console.log(config);
|
|
|
152
152
|
|
|
153
153
|
### API Documentation
|
|
154
154
|
|
|
155
|
-
- **[REST API Guide](./api/
|
|
155
|
+
- **[REST API Guide](./api/rest-api.md)**
|
|
156
156
|
- Configuration API
|
|
157
157
|
- Organizations API
|
|
158
158
|
- Users API
|
|
159
159
|
- Groups API
|
|
160
160
|
- Authentication
|
|
161
161
|
|
|
162
|
-
- **[Complete API Reference](./api/
|
|
162
|
+
- **[Complete API Reference](./api/reference.md)**
|
|
163
163
|
- All endpoints with examples
|
|
164
164
|
- Request/response formats
|
|
165
165
|
- Error codes
|
|
@@ -167,7 +167,7 @@ console.log(config);
|
|
|
167
167
|
|
|
168
168
|
### Browser Libraries
|
|
169
169
|
|
|
170
|
-
- **[Browser Libraries Guide](./browser/
|
|
170
|
+
- **[Browser Libraries Guide](./browser/libraries.md)**
|
|
171
171
|
- LdapTreeViewer - Interactive LDAP tree
|
|
172
172
|
- LdapUserEditor - Complete user editor
|
|
173
173
|
- Configuration options
|
|
@@ -176,7 +176,7 @@ console.log(config);
|
|
|
176
176
|
|
|
177
177
|
### Schemas
|
|
178
178
|
|
|
179
|
-
- **[JSON Schemas Guide](./schemas/
|
|
179
|
+
- **[JSON Schemas Guide](./schemas/README.md)**
|
|
180
180
|
- Schema structure
|
|
181
181
|
- Entity metadata
|
|
182
182
|
- Attribute types
|
|
@@ -186,7 +186,7 @@ console.log(config);
|
|
|
186
186
|
|
|
187
187
|
### Integration
|
|
188
188
|
|
|
189
|
-
- **[Integration Examples](./examples/
|
|
189
|
+
- **[Integration Examples](./examples/README.md)**
|
|
190
190
|
- React application
|
|
191
191
|
- Vue.js application
|
|
192
192
|
- Vanilla JavaScript
|
|
@@ -195,7 +195,7 @@ console.log(config);
|
|
|
195
195
|
|
|
196
196
|
### Plugin Development
|
|
197
197
|
|
|
198
|
-
- **[Plugin Development Guide](
|
|
198
|
+
- **[Plugin Development Guide](../plugin-development/README.md)**
|
|
199
199
|
- Creating plugins
|
|
200
200
|
- Custom configuration
|
|
201
201
|
- Hooks system
|
|
@@ -234,7 +234,7 @@ LDAP-Rest uses JSON schemas to define LDAP entity structure:
|
|
|
234
234
|
}
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
See [JSON Schemas Guide](./schemas/
|
|
237
|
+
See [JSON Schemas Guide](./schemas/README.md) for details.
|
|
238
238
|
|
|
239
239
|
### Dynamic Configuration
|
|
240
240
|
|
|
@@ -252,7 +252,7 @@ const usersEndpoint = config.features.ldapFlatGeneric.flatResources.find(
|
|
|
252
252
|
const users = await fetch(usersEndpoint).then(r => r.json());
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
See [REST API Guide](./api/
|
|
255
|
+
See [REST API Guide](./api/rest-api.md) for details.
|
|
256
256
|
|
|
257
257
|
### Plugin-Based Extensibility
|
|
258
258
|
|
|
@@ -263,25 +263,25 @@ Extend LDAP-Rest with custom plugins that:
|
|
|
263
263
|
- Integrate external systems
|
|
264
264
|
- Implement custom logic
|
|
265
265
|
|
|
266
|
-
See [Plugin Development Guide](
|
|
266
|
+
See [Plugin Development Guide](../plugin-development/README.md) for details.
|
|
267
267
|
|
|
268
268
|
---
|
|
269
269
|
|
|
270
270
|
## Next Steps
|
|
271
271
|
|
|
272
|
-
1. **Learn the API** - Read the [REST API Guide](./api/
|
|
273
|
-
2. **Try the Libraries** - Check the [Browser Libraries Guide](./browser/
|
|
274
|
-
3. **See Examples** - Explore [Integration Examples](./examples/
|
|
275
|
-
4. **Build a Plugin** - Follow the [Plugin Development Guide](
|
|
272
|
+
1. **Learn the API** - Read the [REST API Guide](./api/rest-api.md)
|
|
273
|
+
2. **Try the Libraries** - Check the [Browser Libraries Guide](./browser/libraries.md)
|
|
274
|
+
3. **See Examples** - Explore [Integration Examples](./examples/README.md)
|
|
275
|
+
4. **Build a Plugin** - Follow the [Plugin Development Guide](../plugin-development/README.md)
|
|
276
276
|
|
|
277
277
|
---
|
|
278
278
|
|
|
279
279
|
## Resources
|
|
280
280
|
|
|
281
281
|
- [GitHub Repository](https://github.com/linagora/ldap-rest)
|
|
282
|
-
- [Contributing Guide](
|
|
283
|
-
- [Plugin Development](../
|
|
284
|
-
- [Hooks Reference](../
|
|
282
|
+
- [Contributing Guide](../../CONTRIBUTING.md)
|
|
283
|
+
- [Plugin Development](../plugin-development/README.md)
|
|
284
|
+
- [Hooks Reference](../plugin-development/hooks.md)
|
|
285
285
|
|
|
286
286
|
---
|
|
287
287
|
|