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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Nomenclature LDIF for twakeMailboxType
|
|
2
|
+
#
|
|
3
|
+
# This file contains the nomenclature entries for mailbox types:
|
|
4
|
+
# - group: Simple group without mail functionality
|
|
5
|
+
# - mailingList: Mailing list (email redistribution)
|
|
6
|
+
# - teamMailbox: Team mailbox (shared mailbox with IMAP access)
|
|
7
|
+
#
|
|
8
|
+
# Installation:
|
|
9
|
+
# 1. Replace {ldap_base} with your actual LDAP base (e.g., dc=example,dc=com)
|
|
10
|
+
# 2. ldapadd -x -D "cn=admin,{ldap_base}" -W -f twake-mailbox-type-nomenclature.ldif
|
|
11
|
+
|
|
12
|
+
# Create nomenclature base OU
|
|
13
|
+
dn: ou=twakeMailboxType,ou=nomenclature,{ldap_base}
|
|
14
|
+
objectClass: organizationalUnit
|
|
15
|
+
ou: twakeMailboxType
|
|
16
|
+
description: Mailbox type nomenclature
|
|
17
|
+
|
|
18
|
+
# Group (no mailbox)
|
|
19
|
+
dn: cn=group,ou=twakeMailboxType,ou=nomenclature,{ldap_base}
|
|
20
|
+
objectClass: top
|
|
21
|
+
objectClass: applicationProcess
|
|
22
|
+
cn: group
|
|
23
|
+
description: Simple group without mail functionality
|
|
24
|
+
|
|
25
|
+
# Mailing list
|
|
26
|
+
dn: cn=mailingList,ou=twakeMailboxType,ou=nomenclature,{ldap_base}
|
|
27
|
+
objectClass: top
|
|
28
|
+
objectClass: applicationProcess
|
|
29
|
+
cn: mailingList
|
|
30
|
+
description: Mailing list (email redistribution)
|
|
31
|
+
|
|
32
|
+
# Team mailbox
|
|
33
|
+
dn: cn=teamMailbox,ou=twakeMailboxType,ou=nomenclature,{ldap_base}
|
|
34
|
+
objectClass: top
|
|
35
|
+
objectClass: applicationProcess
|
|
36
|
+
cn: teamMailbox
|
|
37
|
+
description: Team mailbox (shared mailbox with IMAP access)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# LDAP Schema Amendment for twakeMailboxType
|
|
2
|
+
#
|
|
3
|
+
# This file contains the schema amendments needed to support mailbox type
|
|
4
|
+
# classification for groups (group, mailingList, teamMailbox).
|
|
5
|
+
#
|
|
6
|
+
# Installation:
|
|
7
|
+
# ldapmodify -Y EXTERNAL -H ldapi:/// -f twake-mailbox-type-schema-amendment.ldif
|
|
8
|
+
#
|
|
9
|
+
# Or add these lines to your existing twake.ldif schema file
|
|
10
|
+
|
|
11
|
+
# Add new attribute type for mailbox type
|
|
12
|
+
# Insert after line 18 (after twakeListType)
|
|
13
|
+
dn: cn={3}twake,cn=schema,cn=config
|
|
14
|
+
changetype: modify
|
|
15
|
+
add: olcAttributeTypes
|
|
16
|
+
olcAttributeTypes: {15} ( TwakeAttributType:14 NAME 'twakeMailboxType' DESC 'Type of mailbox for groups' SUP distinguishedName SINGLE-VALUE )
|
|
17
|
+
|
|
18
|
+
# Modify twakeStaticGroup to include twakeMailboxType
|
|
19
|
+
# Update line 27
|
|
20
|
+
dn: cn={3}twake,cn=schema,cn=config
|
|
21
|
+
changetype: modify
|
|
22
|
+
replace: olcObjectClasses
|
|
23
|
+
olcObjectClasses: {5}( TwakeObjectClass:5 NAME 'twakeStaticGroup' DESC 'Twake: static group' SUP groupOfNames STRUCTURAL MAY ( twakeDepartmentLink $ twakeDepartmentPath $ twakeListType $ mail $ twakeMailboxType ) )
|
|
24
|
+
|
|
25
|
+
# Modify twakeDynamicGroup to include twakeMailboxType
|
|
26
|
+
# Update line 28
|
|
27
|
+
dn: cn={3}twake,cn=schema,cn=config
|
|
28
|
+
changetype: modify
|
|
29
|
+
replace: olcObjectClasses
|
|
30
|
+
olcObjectClasses: {6}( TwakeObjectClass:6 NAME 'twakeDynamicGroup' DESC 'Twake: dynamic group' SUP groupOfURLs STRUCTURAL MAY ( twakeDepartmentLink $ twakeDepartmentPath $ mail $ twakeMailboxType ) )
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# James Team Mailboxes
|
|
2
|
+
|
|
3
|
+
This feature adds support for James/TMail team mailboxes in addition to existing mailing lists. Team mailboxes are shared mailboxes with IMAP access, as opposed to mailing lists which only distribute emails to members.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Groups in LDAP can now have three different mailbox types:
|
|
8
|
+
|
|
9
|
+
- **group**: Simple group without mail functionality (default if no mail attribute)
|
|
10
|
+
- **mailingList**: Traditional mailing list (email redistribution via James `/address/groups/` API)
|
|
11
|
+
- **teamMailbox**: Shared team mailbox (shared IMAP mailbox via James `/domains/{domain}/team-mailboxes/` API)
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
### LDAP Schema Amendment
|
|
16
|
+
|
|
17
|
+
First, apply the schema amendment to add the `twakeMailboxType` attribute:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ldapmodify -Y EXTERNAL -H ldapi:/// -f docs/examples/twake-mailbox-type-schema-amendment.ldif
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This adds:
|
|
24
|
+
|
|
25
|
+
- New attribute type: `twakeMailboxType`
|
|
26
|
+
- Updates `twakeStaticGroup` and `twakeDynamicGroup` to include the new attribute
|
|
27
|
+
|
|
28
|
+
### Nomenclature Setup
|
|
29
|
+
|
|
30
|
+
Create the nomenclature entries in your LDAP directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Replace {ldap_base} with your actual LDAP base (e.g., dc=example,dc=com)
|
|
34
|
+
sed 's/{ldap_base}/dc=example,dc=com/g' docs/examples/twake-mailbox-type-nomenclature.ldif > /tmp/nomenclature.ldif
|
|
35
|
+
ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f /tmp/nomenclature.ldif
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This creates three nomenclature entries:
|
|
39
|
+
|
|
40
|
+
- `cn=group,ou=twakeMailboxType,ou=nomenclature,{ldap_base}`
|
|
41
|
+
- `cn=mailingList,ou=twakeMailboxType,ou=nomenclature,{ldap_base}`
|
|
42
|
+
- `cn=teamMailbox,ou=twakeMailboxType,ou=nomenclature,{ldap_base}`
|
|
43
|
+
|
|
44
|
+
### LDAP-Rest Configuration
|
|
45
|
+
|
|
46
|
+
Add to your ldap-rest configuration:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Optional: Restrict mailing lists to specific branches
|
|
50
|
+
--james-mailing-list-branches "ou=lists,dc=example,dc=com"
|
|
51
|
+
|
|
52
|
+
# Optional: Custom mailbox type attribute (default: twakeMailboxType)
|
|
53
|
+
--james-mailbox-type-attribute "mailboxType"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or via environment variables:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
DM_JAMES_MAILING_LIST_BRANCHES="ou=lists,dc=example,dc=com"
|
|
60
|
+
DM_JAMES_MAILBOX_TYPE_ATTRIBUTE="mailboxType"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If `james-mailing-list-branches` is empty (default), mailing lists can be created anywhere.
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
### Creating a Team Mailbox
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
await dm.ldap.add('cn=sales-team,ou=groups,dc=example,dc=com', {
|
|
71
|
+
objectClass: ['top', 'groupOfNames', 'twakeStaticGroup'],
|
|
72
|
+
cn: 'sales-team',
|
|
73
|
+
mail: 'sales@example.com',
|
|
74
|
+
twakeMailboxType:
|
|
75
|
+
'cn=teamMailbox,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
76
|
+
member: [
|
|
77
|
+
'uid=alice,ou=users,dc=example,dc=com',
|
|
78
|
+
'uid=bob,ou=users,dc=example,dc=com',
|
|
79
|
+
],
|
|
80
|
+
twakeDepartmentLink: 'ou=groups,dc=example,dc=com',
|
|
81
|
+
twakeDepartmentPath: 'Sales',
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This will:
|
|
86
|
+
|
|
87
|
+
1. Create the team mailbox via `PUT /domains/example.com/team-mailboxes/sales@example.com`
|
|
88
|
+
2. Add each member via `PUT /domains/example.com/team-mailboxes/sales@example.com/members/{member-email}`
|
|
89
|
+
|
|
90
|
+
### Creating a Mailing List
|
|
91
|
+
|
|
92
|
+
```javascript
|
|
93
|
+
await dm.ldap.add('cn=announce,ou=lists,dc=example,dc=com', {
|
|
94
|
+
objectClass: ['top', 'groupOfNames', 'twakeStaticGroup'],
|
|
95
|
+
cn: 'announce',
|
|
96
|
+
mail: 'announce@example.com',
|
|
97
|
+
twakeMailboxType:
|
|
98
|
+
'cn=mailingList,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
99
|
+
member: [
|
|
100
|
+
'uid=alice,ou=users,dc=example,dc=com',
|
|
101
|
+
'uid=bob,ou=users,dc=example,dc=com',
|
|
102
|
+
],
|
|
103
|
+
twakeDepartmentLink: 'ou=lists,dc=example,dc=com',
|
|
104
|
+
twakeDepartmentPath: 'Lists',
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This will:
|
|
109
|
+
|
|
110
|
+
1. Validate the group is in an allowed branch (if `--james-mailing-list-branches` is configured)
|
|
111
|
+
2. Create the mailing list via `PUT /address/groups/announce@example.com/{member-email}` for each member
|
|
112
|
+
|
|
113
|
+
### Creating a Simple Group (no mailbox)
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
await dm.ldap.add('cn=developers,ou=groups,dc=example,dc=com', {
|
|
117
|
+
objectClass: ['top', 'groupOfNames', 'twakeStaticGroup'],
|
|
118
|
+
cn: 'developers',
|
|
119
|
+
twakeMailboxType:
|
|
120
|
+
'cn=group,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
121
|
+
member: ['uid=alice,ou=users,dc=example,dc=com'],
|
|
122
|
+
twakeDepartmentLink: 'ou=groups,dc=example,dc=com',
|
|
123
|
+
twakeDepartmentPath: 'Engineering',
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This creates a simple group without any James integration (no mail attribute, no mailbox).
|
|
128
|
+
|
|
129
|
+
## API Endpoints Used
|
|
130
|
+
|
|
131
|
+
### Team Mailboxes
|
|
132
|
+
|
|
133
|
+
- **Create**: `PUT /domains/{domain}/team-mailboxes/{teamMailbox}`
|
|
134
|
+
- **Add member**: `PUT /domains/{domain}/team-mailboxes/{teamMailbox}/members/{memberEmail}`
|
|
135
|
+
- **Delete member**: `DELETE /domains/{domain}/team-mailboxes/{teamMailbox}/members/{memberEmail}`
|
|
136
|
+
- **Delete**: `DELETE /domains/{domain}/team-mailboxes/{teamMailbox}`
|
|
137
|
+
|
|
138
|
+
### Mailing Lists
|
|
139
|
+
|
|
140
|
+
- **Add member**: `PUT /address/groups/{groupMail}/{memberEmail}`
|
|
141
|
+
- **Delete member**: `DELETE /address/groups/{groupMail}/{memberEmail}`
|
|
142
|
+
- **Delete**: `DELETE /address/groups/{groupMail}`
|
|
143
|
+
|
|
144
|
+
## Validation Rules
|
|
145
|
+
|
|
146
|
+
### Branch Restrictions
|
|
147
|
+
|
|
148
|
+
When `--james-mailing-list-branches` is configured, strict branch separation is enforced:
|
|
149
|
+
|
|
150
|
+
1. **Mailing Lists**:
|
|
151
|
+
- ✅ **MUST** be located within one of the specified branches
|
|
152
|
+
- ❌ **CANNOT** be created outside these branches
|
|
153
|
+
- If `--james-mailing-list-branches` is empty, no location restriction applies
|
|
154
|
+
|
|
155
|
+
2. **Team Mailboxes**:
|
|
156
|
+
- ✅ **MUST NOT** be located within mailing list branches
|
|
157
|
+
- ❌ **CANNOT** be created in branches reserved for mailing lists
|
|
158
|
+
- ✅ **CAN** be created anywhere else in the LDAP tree
|
|
159
|
+
|
|
160
|
+
**Example Configuration:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
--james-mailing-list-branches "ou=lists,dc=example,dc=com"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Allowed:**
|
|
167
|
+
|
|
168
|
+
- `cn=sales-list,ou=lists,dc=example,dc=com` with `twakeMailboxType=mailingList` ✅
|
|
169
|
+
- `cn=sales-team,ou=teams,dc=example,dc=com` with `twakeMailboxType=teamMailbox` ✅
|
|
170
|
+
- `cn=sales-team,ou=groups,dc=example,dc=com` with `twakeMailboxType=teamMailbox` ✅
|
|
171
|
+
|
|
172
|
+
**Rejected:**
|
|
173
|
+
|
|
174
|
+
- `cn=sales-list,ou=teams,dc=example,dc=com` with `twakeMailboxType=mailingList` ❌ (wrong branch)
|
|
175
|
+
- `cn=sales-team,ou=lists,dc=example,dc=com` with `twakeMailboxType=teamMailbox` ❌ (reserved for lists)
|
|
176
|
+
|
|
177
|
+
**Validation Points:**
|
|
178
|
+
|
|
179
|
+
- Group creation (`ldapgroupadddone`)
|
|
180
|
+
- Mailbox type transitions (`handleMailboxTypeTransition`)
|
|
181
|
+
|
|
182
|
+
**Error Handling:**
|
|
183
|
+
|
|
184
|
+
- Validation failures are logged as errors
|
|
185
|
+
- Group is created in LDAP but James mailbox is NOT created
|
|
186
|
+
- No exception thrown (silent failure with error log)
|
|
187
|
+
|
|
188
|
+
### Mailbox Type Defaults
|
|
189
|
+
|
|
190
|
+
3. **Mailbox Type**:
|
|
191
|
+
- If `twakeMailboxType` is not set and the group has a `mail` attribute, it defaults to `mailingList`
|
|
192
|
+
- If `twakeMailboxType` is not set and the group has no `mail` attribute, it's a simple group (no James integration)
|
|
193
|
+
- Default behavior is subject to branch validation rules
|
|
194
|
+
|
|
195
|
+
## Mailbox Type Transitions
|
|
196
|
+
|
|
197
|
+
You can transition groups between different mailbox types by modifying the `twakeMailboxType` attribute. The system automatically handles the cleanup of the old type and setup of the new type.
|
|
198
|
+
|
|
199
|
+
### Supported Transitions
|
|
200
|
+
|
|
201
|
+
#### mailingList → teamMailbox
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
await dm.ldap.modify('cn=sales,ou=groups,dc=example,dc=com', {
|
|
205
|
+
replace: {
|
|
206
|
+
twakeMailboxType:
|
|
207
|
+
'cn=teamMailbox,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**What happens:**
|
|
213
|
+
|
|
214
|
+
1. Deletes the mailing list from James (`DELETE /address/groups/{mail}`)
|
|
215
|
+
2. Creates the team mailbox (`PUT /domains/{domain}/team-mailboxes/{mail}`)
|
|
216
|
+
3. Adds all current members to the team mailbox
|
|
217
|
+
|
|
218
|
+
#### teamMailbox → mailingList
|
|
219
|
+
|
|
220
|
+
```javascript
|
|
221
|
+
await dm.ldap.modify('cn=sales,ou=groups,dc=example,dc=com', {
|
|
222
|
+
replace: {
|
|
223
|
+
twakeMailboxType:
|
|
224
|
+
'cn=mailingList,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**What happens:**
|
|
230
|
+
|
|
231
|
+
1. Removes all members from the team mailbox (`DELETE /domains/{domain}/team-mailboxes/{mail}/members/{member}`)
|
|
232
|
+
2. **Preserves the team mailbox** (does NOT delete it - can be recovered later)
|
|
233
|
+
3. Creates the mailing list (`PUT /address/groups/{mail}/{member}`)
|
|
234
|
+
4. Adds all current members to the mailing list
|
|
235
|
+
|
|
236
|
+
#### group → mailingList or teamMailbox
|
|
237
|
+
|
|
238
|
+
```javascript
|
|
239
|
+
// Add mail attribute and mailbox type
|
|
240
|
+
await dm.ldap.modify('cn=developers,ou=groups,dc=example,dc=com', {
|
|
241
|
+
add: {
|
|
242
|
+
mail: 'developers@example.com',
|
|
243
|
+
},
|
|
244
|
+
replace: {
|
|
245
|
+
twakeMailboxType:
|
|
246
|
+
'cn=teamMailbox,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**What happens:**
|
|
252
|
+
|
|
253
|
+
1. No cleanup needed (was a simple group)
|
|
254
|
+
2. Creates the specified mailbox type (mailing list or team mailbox)
|
|
255
|
+
3. Adds all current members
|
|
256
|
+
|
|
257
|
+
#### mailingList or teamMailbox → group
|
|
258
|
+
|
|
259
|
+
```javascript
|
|
260
|
+
await dm.ldap.modify('cn=sales,ou=groups,dc=example,dc=com', {
|
|
261
|
+
replace: {
|
|
262
|
+
twakeMailboxType:
|
|
263
|
+
'cn=group,ou=twakeMailboxType,ou=nomenclature,dc=example,dc=com',
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**What happens:**
|
|
269
|
+
|
|
270
|
+
1. If mailing list: deletes it from James
|
|
271
|
+
2. If team mailbox: removes all members (preserves mailbox)
|
|
272
|
+
3. Group becomes a simple group without mail functionality
|
|
273
|
+
|
|
274
|
+
### Deleting Groups with Team Mailboxes
|
|
275
|
+
|
|
276
|
+
When you delete a group that has `twakeMailboxType=teamMailbox`:
|
|
277
|
+
|
|
278
|
+
```javascript
|
|
279
|
+
await dm.ldap.delete('cn=sales,ou=groups,dc=example,dc=com');
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**What happens:**
|
|
283
|
+
|
|
284
|
+
1. Removes all members from the team mailbox
|
|
285
|
+
2. **Preserves the team mailbox** (does NOT delete it)
|
|
286
|
+
3. The mailbox can be recovered later if needed
|
|
287
|
+
|
|
288
|
+
**Rationale:** Team mailboxes may contain important emails and should not be automatically deleted. Administrators can manually delete them through James WebAdmin if needed.
|
|
289
|
+
|
|
290
|
+
## Backward Compatibility
|
|
291
|
+
|
|
292
|
+
Existing groups with `mail` attribute but no `twakeMailboxType` will continue to work as mailing lists (backward compatible behavior).
|
|
293
|
+
|
|
294
|
+
## Testing
|
|
295
|
+
|
|
296
|
+
Tests require the LDAP schema amendment to be applied first:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Apply schema amendment to your test LDAP server
|
|
300
|
+
ldapmodify -Y EXTERNAL -H ldapi:/// -f docs/examples/twake-mailbox-type-schema-amendment.ldif
|
|
301
|
+
|
|
302
|
+
# Load nomenclature
|
|
303
|
+
sed 's/{ldap_base}/dc=example,dc=com/g' docs/examples/twake-mailbox-type-nomenclature.ldif | \
|
|
304
|
+
ldapadd -x -D "cn=admin,dc=example,dc=com" -W
|
|
305
|
+
|
|
306
|
+
# Run team mailbox tests
|
|
307
|
+
npm run test:one test/plugins/twake/jamesTeamMailboxes.test.ts
|
|
308
|
+
|
|
309
|
+
# Run mailbox type transition tests
|
|
310
|
+
npm run test:one test/plugins/twake/jamesMailboxTypeTransitions.test.ts
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Test Coverage
|
|
314
|
+
|
|
315
|
+
- **jamesTeamMailboxes.test.ts** (4 tests):
|
|
316
|
+
- Create team mailbox
|
|
317
|
+
- Add member to team mailbox
|
|
318
|
+
- Remove member from team mailbox
|
|
319
|
+
- Delete team mailbox group (removes members, preserves mailbox)
|
|
320
|
+
|
|
321
|
+
- **jamesMailboxTypeTransitions.test.ts** (7 tests):
|
|
322
|
+
- Transition from mailingList to teamMailbox
|
|
323
|
+
- Transition from teamMailbox to mailingList
|
|
324
|
+
- Transition from group to teamMailbox
|
|
325
|
+
- Transition from teamMailbox to group
|
|
326
|
+
- Transition from group to mailingList
|
|
327
|
+
- Transition from mailingList to group
|
|
328
|
+
- Delete group with teamMailbox (removes members only)
|
|
329
|
+
|
|
330
|
+
- **jamesBranchValidation.test.ts** (8 tests):
|
|
331
|
+
- Allow mailing list in allowed branch
|
|
332
|
+
- Reject mailing list outside allowed branch
|
|
333
|
+
- Allow team mailbox outside mailing list branch
|
|
334
|
+
- Reject team mailbox inside mailing list branch
|
|
335
|
+
- Reject transition to mailing list outside allowed branch
|
|
336
|
+
- Reject transition to team mailbox inside mailing list branch
|
|
337
|
+
- Allow mailing lists anywhere when restrictions disabled
|
|
338
|
+
- Allow team mailboxes anywhere when restrictions disabled
|
|
339
|
+
|
|
340
|
+
## References
|
|
341
|
+
|
|
342
|
+
- [TMail Team Mailboxes Documentation](https://github.com/linagora/tmail-backend/blob/master/docs/modules/ROOT/pages/tmail-backend/webadmin.adoc#team-mailboxes)
|
|
343
|
+
- [GitHub Issue #5](https://github.com/linagora/ldap-rest/issues/5)
|