ldap-rest 1.2.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/bin/sync-james.mjs +13 -2
  2. package/dist/abstract/ldapFlat.js +1 -1
  3. package/dist/abstract/plugin.js +1 -1
  4. package/dist/abstract/twakePlugin.js +1 -1
  5. package/dist/bin/index.js +1 -1
  6. package/dist/config/args.js +1 -1
  7. package/dist/config/options.js +1 -0
  8. package/dist/config/schema.js +1 -1
  9. package/dist/lib/auth/base.js +1 -1
  10. package/dist/lib/authz/base.js +1 -1
  11. package/dist/lib/entitySchema/validator.js +1 -1
  12. package/dist/lib/errors.js +1 -1
  13. package/dist/lib/expressFormatedResponses.js +1 -1
  14. package/dist/lib/health.js +1 -1
  15. package/dist/lib/hookBus.js +1 -0
  16. package/dist/lib/instanceProviders.js +1 -1
  17. package/dist/lib/ldap/callerView.js +1 -0
  18. package/dist/lib/ldap/pool.js +1 -0
  19. package/dist/lib/ldap/schema.js +1 -0
  20. package/dist/lib/ldap/searchCache.js +1 -0
  21. package/dist/lib/ldapActions.js +1 -1
  22. package/dist/lib/ldapSchema.js +1 -1
  23. package/dist/lib/parseConfig.js +1 -1
  24. package/dist/lib/route.js +1 -0
  25. package/dist/lib/schemaFile.js +1 -1
  26. package/dist/lib/services/index.js +1 -0
  27. package/dist/lib/storage/store.js +1 -1
  28. package/dist/lib/utils.js +1 -1
  29. package/dist/lib/version.js +1 -0
  30. package/dist/logger/winston.js +1 -1
  31. package/dist/plugins/auth/auth.options.js +1 -0
  32. package/dist/plugins/auth/authzDynamic.js +1 -1
  33. package/dist/plugins/auth/authzLinid1.js +1 -1
  34. package/dist/plugins/auth/authzPerBranch.js +1 -1
  35. package/dist/plugins/auth/authzPerRoute.js +1 -1
  36. package/dist/plugins/auth/authzScope.js +1 -1
  37. package/dist/plugins/auth/crowdsec.js +1 -1
  38. package/dist/plugins/auth/fake.js +1 -1
  39. package/dist/plugins/auth/hmac.js +1 -1
  40. package/dist/plugins/auth/llng.js +1 -1
  41. package/dist/plugins/auth/openidconnect.js +1 -1
  42. package/dist/plugins/auth/rateLimit.js +1 -1
  43. package/dist/plugins/auth/token.js +1 -1
  44. package/dist/plugins/auth/totp.js +1 -1
  45. package/dist/plugins/auth/trustedProxy.js +1 -1
  46. package/dist/plugins/bcl.js +1 -1
  47. package/dist/plugins/bcl.options.js +1 -0
  48. package/dist/plugins/configApi.js +1 -1
  49. package/dist/plugins/demo/helloworld.js +1 -1
  50. package/dist/plugins/ldap/accountLifecycle.js +1 -1
  51. package/dist/plugins/ldap/bulkImport.js +1 -1
  52. package/dist/plugins/ldap/departmentSync.js +1 -1
  53. package/dist/plugins/ldap/enterpriseRules.js +1 -1
  54. package/dist/plugins/ldap/externalUsersInGroups.js +1 -1
  55. package/dist/plugins/ldap/flatGeneric.js +1 -1
  56. package/dist/plugins/ldap/groups.js +1 -1
  57. package/dist/plugins/ldap/ldap.options.js +1 -0
  58. package/dist/plugins/ldap/onChange.js +1 -1
  59. package/dist/plugins/ldap/organizations.js +1 -1
  60. package/dist/plugins/ldap/passwordPolicy.js +1 -1
  61. package/dist/plugins/ldap/raw.js +1 -1
  62. package/dist/plugins/ldap/trash.js +1 -1
  63. package/dist/plugins/metrics.js +1 -1
  64. package/dist/plugins/metrics.options.js +1 -0
  65. package/dist/plugins/rabbitmq.js +1 -1
  66. package/dist/plugins/rabbitmq.options.js +1 -0
  67. package/dist/plugins/scim/baseResolver.js +1 -1
  68. package/dist/plugins/scim/bulk.js +1 -1
  69. package/dist/plugins/scim/discovery.js +1 -1
  70. package/dist/plugins/scim/errors.js +1 -1
  71. package/dist/plugins/scim/filter.js +1 -1
  72. package/dist/plugins/scim/groups.js +1 -1
  73. package/dist/plugins/scim/mapping.js +1 -1
  74. package/dist/plugins/scim/patch.js +1 -1
  75. package/dist/plugins/scim/scim.js +1 -1
  76. package/dist/plugins/scim/scim.options.js +1 -0
  77. package/dist/plugins/scim/users.js +1 -1
  78. package/dist/plugins/static.js +1 -1
  79. package/dist/plugins/static.options.js +1 -0
  80. package/dist/plugins/storage/file.js +1 -1
  81. package/dist/plugins/storage/ldap.js +1 -1
  82. package/dist/plugins/storage/postgres.js +1 -1
  83. package/dist/plugins/storage/valkey.js +1 -1
  84. package/dist/plugins/storage.js +1 -1
  85. package/dist/plugins/storage.options.js +1 -0
  86. package/dist/plugins/twake/appAccounts.options.js +1 -0
  87. package/dist/plugins/twake/appAccountsApi.js +1 -1
  88. package/dist/plugins/twake/appAccountsConsistency.js +1 -1
  89. package/dist/plugins/twake/calendar.js +1 -1
  90. package/dist/plugins/twake/calendar.options.js +1 -0
  91. package/dist/plugins/twake/calendarResources.js +1 -1
  92. package/dist/plugins/twake/cloudery.options.js +1 -0
  93. package/dist/plugins/twake/clouderyProvision.js +1 -1
  94. package/dist/plugins/twake/cozy.options.js +1 -0
  95. package/dist/plugins/twake/cozyProvision.js +1 -1
  96. package/dist/plugins/twake/drive.js +1 -1
  97. package/dist/plugins/twake/drive.options.js +1 -0
  98. package/dist/plugins/twake/groups.js +1 -1
  99. package/dist/plugins/twake/instances.js +1 -1
  100. package/dist/plugins/twake/james.js +1 -1
  101. package/dist/plugins/twake/james.options.js +1 -0
  102. package/dist/plugins/twake/lifecycleAttributes.js +1 -1
  103. package/dist/plugins/twake/lifecycleEvents.js +1 -1
  104. package/dist/plugins/twake/migrationProxy.js +1 -1
  105. package/dist/plugins/twake/migrationProxy.options.js +1 -0
  106. package/dist/plugins/twake/spaces.js +1 -1
  107. package/dist/plugins/twake/tombstone.js +1 -1
  108. package/dist/plugins/twake/twakeGroups.options.js +1 -0
  109. package/dist/plugins/twake/twakeInstances.options.js +1 -0
  110. package/dist/plugins/twake/twakeLifecycle.options.js +1 -0
  111. package/dist/plugins/twake/twakeSpaces.options.js +1 -0
  112. package/dist/plugins/twake/twakeTombstone.options.js +1 -0
  113. package/dist/plugins/weblogs.js +1 -1
  114. package/dist/src/abstract/ldapFlat.d.ts +41 -10
  115. package/dist/src/abstract/plugin.d.ts +31 -5
  116. package/dist/src/abstract/twakePlugin.d.ts +14 -4
  117. package/dist/src/bin/index.d.ts +35 -4
  118. package/dist/src/config/args.d.ts +2 -4
  119. package/dist/src/config/options.d.ts +104 -0
  120. package/dist/src/config/schema.d.ts +50 -1
  121. package/dist/src/hooks.d.ts +60 -22
  122. package/dist/src/lib/authz/base.d.ts +4 -51
  123. package/dist/src/lib/authz/composition.d.ts +2 -2
  124. package/dist/src/lib/entitySchema/validator.d.ts +63 -6
  125. package/dist/src/lib/errors.d.ts +57 -1
  126. package/dist/src/lib/expressFormatedResponses.d.ts +49 -7
  127. package/dist/src/lib/hookBus.d.ts +226 -0
  128. package/dist/src/lib/instanceProviders.d.ts +0 -8
  129. package/dist/src/lib/ldap/callerView.d.ts +45 -0
  130. package/dist/src/lib/ldap/pool.d.ts +108 -0
  131. package/dist/src/lib/ldap/schema.d.ts +157 -0
  132. package/dist/src/lib/ldap/searchCache.d.ts +112 -0
  133. package/dist/src/lib/ldapActions.d.ts +26 -256
  134. package/dist/src/lib/parseConfig.d.ts +31 -2
  135. package/dist/src/lib/route.d.ts +99 -0
  136. package/dist/src/lib/services/index.d.ts +56 -0
  137. package/dist/src/lib/utils.d.ts +100 -36
  138. package/dist/src/lib/version.d.ts +12 -0
  139. package/dist/src/plugins/auth/auth.options.d.ts +88 -0
  140. package/dist/src/plugins/auth/authzDynamic.d.ts +10 -1
  141. package/dist/src/plugins/auth/authzLinid1.d.ts +6 -0
  142. package/dist/src/plugins/auth/authzPerBranch.d.ts +9 -0
  143. package/dist/src/plugins/auth/authzPerRoute.d.ts +3 -0
  144. package/dist/src/plugins/auth/authzScope.d.ts +23 -14
  145. package/dist/src/plugins/auth/crowdsec.d.ts +5 -0
  146. package/dist/src/plugins/auth/fake.d.ts +3 -0
  147. package/dist/src/plugins/auth/hmac.d.ts +4 -0
  148. package/dist/src/plugins/auth/llng.d.ts +4 -0
  149. package/dist/src/plugins/auth/openidconnect.d.ts +7 -0
  150. package/dist/src/plugins/auth/rateLimit.d.ts +4 -0
  151. package/dist/src/plugins/auth/token.d.ts +3 -0
  152. package/dist/src/plugins/auth/totp.d.ts +5 -0
  153. package/dist/src/plugins/auth/trustedProxy.d.ts +4 -0
  154. package/dist/src/plugins/bcl.d.ts +3 -0
  155. package/dist/src/plugins/bcl.options.d.ts +8 -0
  156. package/dist/src/plugins/configApi.d.ts +24 -5
  157. package/dist/src/plugins/demo/helloworld.d.ts +8 -19
  158. package/dist/src/plugins/ldap/accountLifecycle.d.ts +17 -0
  159. package/dist/src/plugins/ldap/bulkImport.d.ts +6 -76
  160. package/dist/src/plugins/ldap/departmentSync.d.ts +1 -0
  161. package/dist/src/plugins/ldap/enterpriseRules.d.ts +8 -15
  162. package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +4 -0
  163. package/dist/src/plugins/ldap/flatGeneric.d.ts +4 -0
  164. package/dist/src/plugins/ldap/groups.d.ts +27 -11
  165. package/dist/src/plugins/ldap/ldap.options.d.ts +75 -0
  166. package/dist/src/plugins/ldap/onChange.d.ts +10 -2
  167. package/dist/src/plugins/ldap/organizations.d.ts +16 -0
  168. package/dist/src/plugins/ldap/passwordPolicy.d.ts +35 -3
  169. package/dist/src/plugins/ldap/raw.d.ts +50 -19
  170. package/dist/src/plugins/ldap/trash.d.ts +6 -0
  171. package/dist/src/plugins/metrics.d.ts +3 -0
  172. package/dist/src/plugins/metrics.options.d.ts +8 -0
  173. package/dist/src/plugins/rabbitmq.d.ts +3 -0
  174. package/dist/src/plugins/rabbitmq.options.d.ts +8 -0
  175. package/dist/src/plugins/scim/baseResolver.d.ts +2 -1
  176. package/dist/src/plugins/scim/bulk.d.ts +6 -7
  177. package/dist/src/plugins/scim/discovery.d.ts +3 -0
  178. package/dist/src/plugins/scim/errors.d.ts +2 -1
  179. package/dist/src/plugins/scim/groups.d.ts +6 -4
  180. package/dist/src/plugins/scim/mapping.d.ts +16 -3
  181. package/dist/src/plugins/scim/scim.d.ts +37 -3
  182. package/dist/src/plugins/scim/scim.options.d.ts +35 -0
  183. package/dist/src/plugins/scim/types.d.ts +2 -0
  184. package/dist/src/plugins/scim/users.d.ts +6 -7
  185. package/dist/src/plugins/static.d.ts +9 -0
  186. package/dist/src/plugins/static.options.d.ts +13 -0
  187. package/dist/src/plugins/storage.d.ts +12 -1
  188. package/dist/src/plugins/storage.options.d.ts +16 -0
  189. package/dist/src/plugins/twake/appAccounts.options.d.ts +13 -0
  190. package/dist/src/plugins/twake/appAccountsApi.d.ts +18 -0
  191. package/dist/src/plugins/twake/appAccountsConsistency.d.ts +8 -0
  192. package/dist/src/plugins/twake/calendar.d.ts +25 -2
  193. package/dist/src/plugins/twake/calendar.options.d.ts +19 -0
  194. package/dist/src/plugins/twake/cloudery.options.d.ts +26 -0
  195. package/dist/src/plugins/twake/clouderyProvision.d.ts +18 -0
  196. package/dist/src/plugins/twake/cozy.options.d.ts +23 -0
  197. package/dist/src/plugins/twake/cozyProvision.d.ts +14 -0
  198. package/dist/src/plugins/twake/drive.d.ts +7 -0
  199. package/dist/src/plugins/twake/drive.options.d.ts +15 -0
  200. package/dist/src/plugins/twake/groups.d.ts +29 -1
  201. package/dist/src/plugins/twake/instances.d.ts +74 -10
  202. package/dist/src/plugins/twake/james.d.ts +17 -0
  203. package/dist/src/plugins/twake/james.options.d.ts +21 -0
  204. package/dist/src/plugins/twake/lifecycleAttributes.d.ts +13 -2
  205. package/dist/src/plugins/twake/lifecycleEvents.d.ts +12 -0
  206. package/dist/src/plugins/twake/migrationProxy.d.ts +11 -11
  207. package/dist/src/plugins/twake/migrationProxy.options.d.ts +16 -0
  208. package/dist/src/plugins/twake/spaces.d.ts +30 -0
  209. package/dist/src/plugins/twake/tombstone.d.ts +25 -16
  210. package/dist/src/plugins/twake/twakeGroups.options.d.ts +20 -0
  211. package/dist/src/plugins/twake/twakeInstances.options.d.ts +43 -0
  212. package/dist/src/plugins/twake/twakeLifecycle.options.d.ts +21 -0
  213. package/dist/src/plugins/twake/twakeSpaces.options.d.ts +19 -0
  214. package/dist/src/plugins/twake/twakeTombstone.options.d.ts +17 -0
  215. package/docs/README.md +17 -2
  216. package/docs/client-development/api/rest-api.md +13 -3
  217. package/docs/client-development/schemas/README.md +96 -32
  218. package/docs/development/contracts.md +109 -0
  219. package/docs/plugin-development/README.md +53 -95
  220. package/docs/plugin-development/dependencies.md +24 -8
  221. package/docs/plugin-development/hooks.md +143 -23
  222. package/docs/plugin-development/openapi.md +14 -1
  223. package/docs/plugin-development/options.md +136 -0
  224. package/docs/plugin-development/routes.md +152 -0
  225. package/docs/plugin-development/services.md +95 -0
  226. package/docs/plugin-development/testing.md +3 -3
  227. package/docs/usage/configuration.md +18 -11
  228. package/docs/usage/operations.md +28 -4
  229. package/docs/usage/plugins/integrations/instances.md +11 -3
  230. package/docs/usage/plugins/integrations/lifecycle-events.md +4 -1
  231. package/docs/usage/plugins/integrations/scim.md +20 -18
  232. package/docs/usage/plugins/integrations/tombstone.md +10 -6
  233. package/docs/usage/plugins/ldap/enterprise-rules.md +10 -1
  234. package/docs/usage/plugins/ldap/flat-generic.md +11 -0
  235. package/docs/usage/plugins/ldap/groups.md +4 -1
  236. package/docs/usage/plugins/ldap/password-policy.md +7 -0
  237. package/docs/usage/plugins/ldap/raw.md +17 -1
  238. package/docs/usage/upgrading.md +253 -0
  239. package/package.json +372 -286
  240. package/static/browser/ldap-browser/LdapBrowser.js +8 -6
  241. package/static/browser/ldap-browser/LdapBrowser.js.map +1 -1
  242. package/static/browser/ldap-browser/api/RawApiClient.js +2 -0
  243. package/static/browser/ldap-browser/api/RawApiClient.js.map +1 -1
  244. package/static/browser/ldap-browser/components/EntryTree.js +9 -5
  245. package/static/browser/ldap-browser/components/EntryTree.js.map +1 -1
  246. package/static/browser/ldap-browser/components/EntryView.js +2 -0
  247. package/static/browser/ldap-browser/components/EntryView.js.map +1 -1
  248. package/static/browser/ldap-browser/schema.js +3 -2
  249. package/static/browser/ldap-browser/schema.js.map +1 -1
  250. package/static/browser/ldap-browser.esm.js +27 -18
  251. package/static/browser/ldap-browser.esm.js.map +1 -1
  252. package/static/browser/ldap-browser.js +27 -18
  253. package/static/browser/ldap-browser.js.map +1 -1
  254. package/static/browser/ldap-browser.min.js +1 -1
  255. package/static/browser/ldap-browser.min.js.map +1 -1
  256. package/static/browser/ldap-group-editor/LdapGroupEditor.js +8 -6
  257. package/static/browser/ldap-group-editor/LdapGroupEditor.js.map +1 -1
  258. package/static/browser/ldap-group-editor/api/GroupApiClient.js +1 -0
  259. package/static/browser/ldap-group-editor/api/GroupApiClient.js.map +1 -1
  260. package/static/browser/ldap-group-editor/components/CreateGroupModal.js +5 -1
  261. package/static/browser/ldap-group-editor/components/CreateGroupModal.js.map +1 -1
  262. package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js +6 -3
  263. package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js.map +1 -1
  264. package/static/browser/ldap-group-editor/components/GroupTree.js +6 -3
  265. package/static/browser/ldap-group-editor/components/GroupTree.js.map +1 -1
  266. package/static/browser/ldap-group-editor/components/MoveGroupModal.js +6 -3
  267. package/static/browser/ldap-group-editor/components/MoveGroupModal.js.map +1 -1
  268. package/static/browser/ldap-group-editor.esm.js +32 -16
  269. package/static/browser/ldap-group-editor.esm.js.map +1 -1
  270. package/static/browser/ldap-group-editor.js +32 -16
  271. package/static/browser/ldap-group-editor.js.map +1 -1
  272. package/static/browser/ldap-group-editor.min.js +1 -1
  273. package/static/browser/ldap-group-editor.min.js.map +1 -1
  274. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +3 -0
  275. package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -1
  276. package/static/browser/ldap-resource-editor/cache/CacheManager.js +3 -1
  277. package/static/browser/ldap-resource-editor/cache/CacheManager.js.map +1 -1
  278. package/static/browser/ldap-tree-viewer/LdapTreeViewer.js +6 -1
  279. package/static/browser/ldap-tree-viewer/LdapTreeViewer.js.map +1 -1
  280. package/static/browser/ldap-tree-viewer/api/LdapApiClient.js +2 -0
  281. package/static/browser/ldap-tree-viewer/api/LdapApiClient.js.map +1 -1
  282. package/static/browser/ldap-tree-viewer/components/TreeNode.js +4 -0
  283. package/static/browser/ldap-tree-viewer/components/TreeNode.js.map +1 -1
  284. package/static/browser/ldap-tree-viewer/components/TreeRoot.js +3 -0
  285. package/static/browser/ldap-tree-viewer/components/TreeRoot.js.map +1 -1
  286. package/static/browser/ldap-tree-viewer/store/Store.js +3 -1
  287. package/static/browser/ldap-tree-viewer/store/Store.js.map +1 -1
  288. package/static/browser/ldap-tree-viewer.esm.js +18 -2
  289. package/static/browser/ldap-tree-viewer.esm.js.map +1 -1
  290. package/static/browser/ldap-tree-viewer.js +18 -2
  291. package/static/browser/ldap-tree-viewer.js.map +1 -1
  292. package/static/browser/ldap-tree-viewer.min.js +1 -1
  293. package/static/browser/ldap-tree-viewer.min.js.map +1 -1
  294. package/static/browser/ldap-unit-editor/LdapUnitEditor.js +7 -5
  295. package/static/browser/ldap-unit-editor/LdapUnitEditor.js.map +1 -1
  296. package/static/browser/ldap-unit-editor/api/UnitApiClient.js +1 -0
  297. package/static/browser/ldap-unit-editor/api/UnitApiClient.js.map +1 -1
  298. package/static/browser/ldap-unit-editor/components/MoveUnitModal.js +7 -4
  299. package/static/browser/ldap-unit-editor/components/MoveUnitModal.js.map +1 -1
  300. package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js +7 -4
  301. package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js.map +1 -1
  302. package/static/browser/ldap-unit-editor/components/UnitTree.js +6 -3
  303. package/static/browser/ldap-unit-editor/components/UnitTree.js.map +1 -1
  304. package/static/browser/ldap-unit-editor.esm.js +28 -16
  305. package/static/browser/ldap-unit-editor.esm.js.map +1 -1
  306. package/static/browser/ldap-unit-editor.js +28 -16
  307. package/static/browser/ldap-unit-editor.js.map +1 -1
  308. package/static/browser/ldap-unit-editor.min.js +1 -1
  309. package/static/browser/ldap-unit-editor.min.js.map +1 -1
  310. package/static/browser/ldap-user-editor/LdapUserEditor.js +9 -7
  311. package/static/browser/ldap-user-editor/LdapUserEditor.js.map +1 -1
  312. package/static/browser/ldap-user-editor/api/UserApiClient.js +2 -0
  313. package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -1
  314. package/static/browser/ldap-user-editor/cache/CacheManager.js +3 -1
  315. package/static/browser/ldap-user-editor/cache/CacheManager.js.map +1 -1
  316. package/static/browser/ldap-user-editor/components/MoveUserModal.js +7 -4
  317. package/static/browser/ldap-user-editor/components/MoveUserModal.js.map +1 -1
  318. package/static/browser/ldap-user-editor/components/PointerField.js +6 -1
  319. package/static/browser/ldap-user-editor/components/PointerField.js.map +1 -1
  320. package/static/browser/ldap-user-editor/components/UserEditor.js +10 -5
  321. package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -1
  322. package/static/browser/ldap-user-editor/components/UserList.js +8 -4
  323. package/static/browser/ldap-user-editor/components/UserList.js.map +1 -1
  324. package/static/browser/ldap-user-editor/components/UserTree.js +7 -3
  325. package/static/browser/ldap-user-editor/components/UserTree.js.map +1 -1
  326. package/static/browser/ldap-user-editor.esm.js +55 -30
  327. package/static/browser/ldap-user-editor.esm.js.map +1 -1
  328. package/static/browser/ldap-user-editor.js +55 -30
  329. package/static/browser/ldap-user-editor.js.map +1 -1
  330. package/static/browser/ldap-user-editor.min.js +1 -1
  331. package/static/browser/ldap-user-editor.min.js.map +1 -1
  332. package/static/browser/shared/components/DisposableComponent.js +3 -5
  333. package/static/browser/shared/components/DisposableComponent.js.map +1 -1
  334. package/static/browser/shared/components/Modal.js +2 -1
  335. package/static/browser/shared/components/Modal.js.map +1 -1
  336. package/static/browser/shared/components/StatusMessage.js +3 -2
  337. package/static/browser/shared/components/StatusMessage.js.map +1 -1
  338. package/static/browser/shared/utils/form.js.map +1 -1
  339. package/static/browser/shared/utils/hmac.js +1 -0
  340. package/static/browser/shared/utils/hmac.js.map +1 -1
  341. package/static/browser/shared/utils/totp.js +1 -0
  342. package/static/browser/shared/utils/totp.js.map +1 -1
  343. package/static/browser/shared.esm.js +9 -8
  344. package/static/browser/shared.esm.js.map +1 -1
  345. package/static/browser/shared.js +9 -8
  346. package/static/browser/shared.js.map +1 -1
  347. package/static/browser/shared.min.js +1 -1
  348. package/static/browser/shared.min.js.map +1 -1
  349. package/static/schemas/ad/groups.json +1 -1
  350. package/static/schemas/ad/users.json +3 -3
  351. package/static/schemas/example/organizations.json +2 -2
  352. package/static/schemas/example/users.json +2 -2
  353. package/static/schemas/obm/users.json +2 -2
  354. package/static/schemas/standard/groups.json +1 -1
  355. package/static/schemas/standard/users.json +2 -2
  356. package/static/schemas/twake/groups.json +4 -4
  357. package/static/schemas/twake/teamMailboxes.json +3 -3
  358. package/static/schemas/twake/users.json +7 -7
@@ -22,42 +22,7 @@ export declare function getCompiledRegex(pattern: string, flags?: string): RegEx
22
22
  * @returns The escaped string safe for use in RegExp
23
23
  */
24
24
  export declare function escapeRegex(str: string): string;
25
- /**
26
- * Run a hook under its plugin's name and its own, for the lines it logs:
27
- * what `launchHooks` does, for a caller walking the hooks itself.
28
- *
29
- * @param hook the registered function
30
- * @param fn its run
31
- * @returns what `fn` returns
32
- */
33
- export declare const runAsHookOwner: <T>(hook: Function, fn: () => T) => T;
34
- export declare const launchHooks: (hooks: Function[] | undefined, ...args: unknown[]) => Promise<void>;
35
- /**
36
- * Record the plugin a hook function belongs to.
37
- *
38
- * @param fn the registered function
39
- * @param plugin the plugin's instance name
40
- * @param hook the hook it is registered under
41
- */
42
- export declare const recordHookOwner: (fn: Function, plugin: string, hook: string) => void;
43
- /**
44
- * The plugin a hook function belongs to, and the hook it is registered
45
- * under, when `registerPlugin` registered it.
46
- *
47
- * @param fn a hook function
48
- * @returns its plugin's instance name and hook name, or undefined
49
- */
50
- export declare const hookOwner: (fn: Function) => {
51
- plugin: string;
52
- hook: string;
53
- } | undefined;
54
- /**
55
- * Whether an error is an authorization plugin's refusal, by the marker its
56
- * message carries: a plain `Error` wrapping it keeps the message only. Its
57
- * message names the branch, so the client is told `AUTHZ_REFUSED` instead.
58
- */
59
- export declare const isAuthzRefusal: (err: unknown) => boolean;
60
- export declare const launchHooksChained: <T>(hooks: Function[] | undefined, args: T) => Promise<T>;
25
+ export { hookOwner, recordHookOwner, runAsHookOwner } from './hookBus';
61
26
  export declare const transformSchemas: (schemas: string | Buffer, config: Config) => string;
62
27
  /**
63
28
  * Escape special characters in LDAP filter values according to RFC 4515
@@ -190,6 +155,30 @@ export declare function parseDn(dn: string): string[];
190
155
  * @returns whether it reads as a DN
191
156
  */
192
157
  export declare function isDnSyntax(dn: string): boolean;
158
+ /**
159
+ * Whether every escape in `dn` is one RFC 4514 §3 defines: an escaped
160
+ * special (`" + , ; < > \ # =` or a space) or a pair of hex digits.
161
+ *
162
+ * {@link parseDn} and {@link unescapeDnValue} read a DN permissively, as a
163
+ * directory may answer one; a DN a caller writes is held to the grammar.
164
+ *
165
+ * @param dn - The DN to check
166
+ * @returns whether its escapes are RFC 4514 escapes
167
+ */
168
+ export declare function hasOnlyRfc4514Escapes(dn: string): boolean;
169
+ /**
170
+ * Refuse a DN a client wrote when it holds an escape RFC 4514 does not
171
+ * define.
172
+ *
173
+ * The readers here are permissive on purpose, because they also read what a
174
+ * directory answers. A DN a caller sends is held to the grammar instead, so
175
+ * the server only ever writes a spelling the directory would produce itself.
176
+ *
177
+ * @param dn - The DN the client wrote
178
+ * @param what - What to name in the refusal
179
+ * @throws BadRequestError when an escape is not one RFC 4514 defines
180
+ */
181
+ export declare function assertRfc4514Escapes(dn: string, what: string): void;
193
182
  /**
194
183
  * Extract the parent DN from a DN
195
184
  * Removes the first RDN component to get the parent branch
@@ -237,6 +226,38 @@ export declare function getRdn(dn: string): string;
237
226
  * ```
238
227
  */
239
228
  export declare function rdnValue(dn: string): string;
229
+ /**
230
+ * Read the name of an entry written as a DN: the value of its first RDN when
231
+ * that RDN asserts `attribute` alone, under `base` when one is given.
232
+ *
233
+ * The value is decoded as {@link rdnValue} decodes it, then folded as the
234
+ * directory folds it ({@link foldRdnValue}): it is the naming attribute's
235
+ * value, the one a write puts back in `attribute=…,base`, and a caller
236
+ * spelling it in a way the directory considers the same name gets that name,
237
+ * not a second one.
238
+ *
239
+ * @param dn - The DN to read
240
+ * @param attribute - The attribute the first RDN must assert
241
+ * @param base - The branch the entry belongs to, when the DN names it whole
242
+ * @returns The name, or `null` when the RDN asserts another attribute, names
243
+ * another branch, or is no DN
244
+ *
245
+ * @example
246
+ * ```typescript
247
+ * assertedRdnValue('uid=Smith\\,John,ou=users,dc=example,dc=com', 'uid')
248
+ * // => 'Smith,John'
249
+ * ```
250
+ */
251
+ export declare function assertedRdnValue(dn: string, attribute: string, base?: string): string | null;
252
+ /**
253
+ * Whether `attribute=` starts `id`: the caller sent a DN rather than a bare
254
+ * naming value.
255
+ *
256
+ * Deciding this before `assertedRdnValue` matters: a string it refuses — a
257
+ * multi-valued RDN, another branch — is still a DN, and read as a bare value
258
+ * it would be written whole.
259
+ */
260
+ export declare function namesByDn(id: string, attribute: string): boolean;
240
261
  /**
241
262
  * Check if a DN is a child of another DN
242
263
  *
@@ -254,6 +275,26 @@ export declare function rdnValue(dn: string): string;
254
275
  * ```
255
276
  */
256
277
  export declare function isChildOf(dn: string, parentDn: string): boolean;
278
+ /**
279
+ * Whether `dn` names a direct child of `base`: its parent is `base`, compared
280
+ * as the directory compares DNs.
281
+ *
282
+ * `isChildOf` answers ancestry; this answers parent equality, which is what a
283
+ * route that only serves one branch requires of a DN a client writes. The
284
+ * comparison folds case, spacing and the escapes the directory reads, so a
285
+ * DN created under one spelling is addressed under another.
286
+ *
287
+ * @param dn - The DN to check
288
+ * @param base - The branch its parent has to be
289
+ * @returns True when the DN has a parent and that parent is `base`
290
+ *
291
+ * @example
292
+ * ```typescript
293
+ * isDirectChildOf('uid=x,OU=Users , dc=example,dc=com', 'ou=users,dc=example,dc=com')
294
+ * // => true
295
+ * ```
296
+ */
297
+ export declare function isDirectChildOf(dn: string, base: string): boolean;
257
298
  /**
258
299
  * Teach {@link normalizeDn} the names and OIDs of attribute types: each is
259
300
  * read as the type's first name.
@@ -304,6 +345,15 @@ export declare function rdnTypes(dn: string): string[];
304
345
  * ```
305
346
  */
306
347
  export declare function normalizeDn(dn: string): string;
348
+ /**
349
+ * A DN's structure normalized as {@link normalizeDn} does, with the case of
350
+ * its values kept.
351
+ *
352
+ * A configured expression compiled to ignore case reads a DN through this
353
+ * form: its values are folded as the directory folds them, but a value it
354
+ * captures keeps the spelling the caller wrote.
355
+ */
356
+ export declare function canonicalDn(dn: string): string;
307
357
  /**
308
358
  * Whether a member DN is the placeholder a `groupOfNames` holds so it stays
309
359
  * valid with no real member (`--group-dummy-user`).
@@ -379,6 +429,20 @@ export declare function isDnInBranch(dn: string, base: string): boolean;
379
429
  * @returns true when the entry entered the trash branch
380
430
  */
381
431
  export declare function movedToTrash(trashBase: string | undefined, oldDn: string, newDn: string): boolean;
432
+ /**
433
+ * Parse a directory date: an LDAP generalized time or anything `Date`
434
+ * understands.
435
+ *
436
+ * A generalized time (RFC 4517 section 3.3.13) is `yyyyMMddHH`, then optional
437
+ * minutes and seconds, an optional fraction of the last unit given, and a zone:
438
+ * `Z` or an offset of hours with optional minutes (`+02`, `-0530`). `Date` reads
439
+ * none of the shorter forms, and not an offset of bare hours, so they are
440
+ * computed here rather than rewritten into an ISO string it might refuse.
441
+ *
442
+ * @param raw value as stored or submitted
443
+ * @returns the date, or null when it cannot be read
444
+ */
445
+ export declare function parseDirectoryDate(raw: AttributeValue): Date | null;
382
446
  /**
383
447
  * Wrapper for async Express route handlers to catch errors and pass them to error middleware
384
448
  * This ensures that errors in async routes are properly handled and don't crash the server
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The version of this package, read from the `package.json` that ships with
3
+ * it: the repository root when run from the sources, the installed package
4
+ * when run from the bundle. A build that moved the file elsewhere leaves it
5
+ * unknown rather than guessing.
6
+ *
7
+ * `start` is the directory the walk begins from; it defaults to this
8
+ * module's own and exists so the walk can be exercised on a fixture.
9
+ */
10
+ export declare function readVersion(start?: string): string | undefined;
11
+ /** The server's version, as its package declares it */
12
+ export declare const SERVER_VERSION: string | undefined;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Authentication and authorization plugin options, see
3
+ * `docs/plugin-development/options.md`.
4
+ */
5
+ import type { AuthConfig, Config } from '../../config/args';
6
+ import { type OptionsOf } from '../../config/options';
7
+ export declare const tokenOptions: {
8
+ auth_token: import("../../config/options").ArrayOption;
9
+ };
10
+ export type TokenOptions = OptionsOf<typeof tokenOptions>;
11
+ export declare const fakeOptions: {
12
+ auth_fake_user: import("../../config/options").StringOption;
13
+ };
14
+ export type FakeOptions = OptionsOf<typeof fakeOptions>;
15
+ export declare const totpOptions: {
16
+ auth_totp: import("../../config/options").ArrayOption;
17
+ auth_totp_window: import("../../config/options").NumberOption;
18
+ auth_totp_step: import("../../config/options").NumberOption;
19
+ };
20
+ export type TotpOptions = OptionsOf<typeof totpOptions>;
21
+ export declare const hmacOptions: {
22
+ auth_hmac: import("../../config/options").ArrayOption;
23
+ auth_hmac_window: import("../../config/options").NumberOption;
24
+ };
25
+ export type HmacOptions = OptionsOf<typeof hmacOptions>;
26
+ export declare const llngOptions: {
27
+ llng_ini: import("../../config/options").StringOption;
28
+ llng_username_header: import("../../config/options").StringOption;
29
+ };
30
+ export type LlngOptions = OptionsOf<typeof llngOptions>;
31
+ export declare const perRouteOptions: {
32
+ authz_per_route: import("../../config/options").ArrayOption;
33
+ };
34
+ export type PerRouteOptions = OptionsOf<typeof perRouteOptions>;
35
+ export declare const perBranchOptions: {
36
+ authz_per_branch_config: import("../../config/options").JsonOption<AuthConfig>;
37
+ authz_per_branch_cache_ttl: import("../../config/options").NumberOption;
38
+ ldap_group_member_attribute: import("../../config/options").StringOption;
39
+ };
40
+ export type PerBranchOptions = OptionsOf<typeof perBranchOptions>;
41
+ export declare const dynamicOptions: {
42
+ authz_dynamic_bypass: import("../../config/options").ArrayOption;
43
+ authz_dynamic_base: import("../../config/options").StringOption;
44
+ authz_dynamic_cache_ttl: import("../../config/options").NumberOption;
45
+ authz_dynamic_token_attribute: import("../../config/options").StringOption;
46
+ authz_dynamic_config_attribute: import("../../config/options").StringOption;
47
+ authz_dynamic_tenant_attribute: import("../../config/options").StringOption;
48
+ authz_dynamic_reload_endpoint: import("../../config/options").BooleanOption;
49
+ };
50
+ export type DynamicOptions = OptionsOf<typeof dynamicOptions>;
51
+ export declare const linid1Options: {
52
+ authz_local_admin_attribute: import("../../config/options").StringOption;
53
+ authz_global_branch: import("../../config/options").ArrayOption;
54
+ authz_global_write_branch: import("../../config/options").ArrayOption;
55
+ authz_global_organization: import("../../config/options").StringOption;
56
+ };
57
+ export type Linid1Options = OptionsOf<typeof linid1Options>;
58
+ export declare const openidconnectOptions: {
59
+ oidc_server: import("../../config/options").StringOption;
60
+ oidc_username_claim: import("../../config/options").StringOption;
61
+ oidc_client_id: import("../../config/options").StringOption;
62
+ oidc_client_secret: import("../../config/options").StringOption;
63
+ base_url: import("../../config/options").StringOption;
64
+ };
65
+ export type OpenidconnectOptions = OptionsOf<typeof openidconnectOptions>;
66
+ export declare const rateLimitOptions: {
67
+ rate_limit_window_ms: import("../../config/options").NumberOption;
68
+ rate_limit_max: import("../../config/options").NumberOption;
69
+ };
70
+ export type RateLimitOptions = OptionsOf<typeof rateLimitOptions>;
71
+ export declare const crowdsecOptions: {
72
+ crowdsec_url: import("../../config/options").StringOption;
73
+ crowdsec_api_key: import("../../config/options").StringOption;
74
+ crowdsec_cache_ttl: import("../../config/options").NumberOption;
75
+ };
76
+ export type CrowdsecOptions = OptionsOf<typeof crowdsecOptions>;
77
+ export declare const trustedProxyOptions: {
78
+ trusted_proxy: import("../../config/options").ArrayOption;
79
+ trusted_proxy_auth_header: import("../../config/options").StringOption;
80
+ };
81
+ export type TrustedProxyOptions = OptionsOf<typeof trustedProxyOptions>;
82
+ /** The checked values for a caller that holds a Config instead of the plugin */
83
+ export declare function totpOptionsOf(config: Config): TotpOptions;
84
+ export declare function hmacOptionsOf(config: Config): HmacOptions;
85
+ export declare function perBranchOptionsOf(config: Config): PerBranchOptions;
86
+ export declare function dynamicOptionsOf(config: Config): DynamicOptions;
87
+ export declare function rateLimitOptionsOf(config: Config): RateLimitOptions;
88
+ export declare function crowdsecOptionsOf(config: Config): CrowdsecOptions;
@@ -51,6 +51,15 @@ export interface AuthzDynamicRequest extends DmRequest {
51
51
  authzToken?: TokenEntry;
52
52
  }
53
53
  export default class AuthzDynamic extends AuthBase {
54
+ static optionDefinitions: {
55
+ authz_dynamic_bypass: import("../../config/options").ArrayOption;
56
+ authz_dynamic_base: import("../../config/options").StringOption;
57
+ authz_dynamic_cache_ttl: import("../../config/options").NumberOption;
58
+ authz_dynamic_token_attribute: import("../../config/options").StringOption;
59
+ authz_dynamic_config_attribute: import("../../config/options").StringOption;
60
+ authz_dynamic_tenant_attribute: import("../../config/options").StringOption;
61
+ authz_dynamic_reload_endpoint: import("../../config/options").BooleanOption;
62
+ };
54
63
  name: string;
55
64
  roles: Role[];
56
65
  private tokens;
@@ -171,7 +180,7 @@ export default class AuthzDynamic extends AuthBase {
171
180
  */
172
181
  private activeToken;
173
182
  /**
174
- * Throw a ForbiddenError (403) if the token cannot perform `permission` on
183
+ * Throw an AuthzRefusedError (403) if the token cannot perform `permission` on
175
184
  * the branch containing `branchOrDn`. Any ACL entry that is `branchOrDn`
176
185
  * itself or a parent of it (sub-branch match) qualifies.
177
186
  *
@@ -14,6 +14,12 @@ interface CachedPermissions {
14
14
  timestamp: number;
15
15
  }
16
16
  export default class AuthzLinid1 extends AuthzBase {
17
+ static optionDefinitions: {
18
+ authz_local_admin_attribute: import("../../config/options").StringOption;
19
+ authz_global_branch: import("../../config/options").ArrayOption;
20
+ authz_global_write_branch: import("../../config/options").ArrayOption;
21
+ authz_global_organization: import("../../config/options").StringOption;
22
+ };
17
23
  name: string;
18
24
  permissionsCache: Map<string, CachedPermissions>;
19
25
  constructor(server: DM);
@@ -16,6 +16,11 @@ interface CachedGroups {
16
16
  timestamp: number;
17
17
  }
18
18
  export default class AuthzPerBranch extends AuthzBase {
19
+ static optionDefinitions: {
20
+ authz_per_branch_config: import("../../config/options").JsonOption<AuthConfig>;
21
+ authz_per_branch_cache_ttl: import("../../config/options").NumberOption;
22
+ ldap_group_member_attribute: import("../../config/options").StringOption;
23
+ };
19
24
  name: string;
20
25
  authConfig?: AuthConfig;
21
26
  groupCache: Map<string, CachedGroups>;
@@ -30,7 +35,11 @@ export default class AuthzPerBranch extends AuthzBase {
30
35
  /** `authConfig.groups` keyed by normalized DN, and the object it was built from. */
31
36
  private groupRulesIndex?;
32
37
  hooks: AuthzBase['hooks'] & Pick<Hooks, 'ldapadddone' | 'ldapmodifydone' | 'ldapdeletedone'>;
38
+ /** What the classes above declared, read once this one is constructed */
39
+ private readonly declaredByBase;
33
40
  constructor(server: DM);
41
+ /** The attribute a group lists its members in */
42
+ private get memberAttribute();
34
43
  /**
35
44
  * Whether a modify can change which groups a uid belongs to: it touches
36
45
  * the member attribute, or the attribute a uid is resolved by.
@@ -11,6 +11,9 @@ import type { Express } from 'express';
11
11
  import DmPlugin, { type Role } from '../../abstract/plugin';
12
12
  export declare function globToRegex(glob: string): RegExp;
13
13
  export default class AuthzPerRoute extends DmPlugin {
14
+ static optionDefinitions: {
15
+ authz_per_route: import("../../config/options").ArrayOption;
16
+ };
14
17
  name: string;
15
18
  roles: Role[];
16
19
  private rules;
@@ -1,19 +1,28 @@
1
- /**
2
- * @module plugins/auth/authzScope
3
- * @author Xavier Guimard <xguimard@linagora.com>
4
- *
5
- * Tells a client what the signed-in administrator may actually do, before it
6
- * offers them a button that will fail.
7
- *
8
- * In a local-administration model the scope *is* the interface: a manager
9
- * administers a few branches of the tree and nothing else, and an application
10
- * that cannot name those branches leaves them guessing. This endpoint answers
11
- * both halves — which branches, and which entities can be created in them —
12
- * by asking the authorization plugin in force, whichever one that is.
13
- * @group Plugins
14
- */
15
1
  import type { Express } from 'express';
16
2
  import DmPlugin, { type Role } from '../../abstract/plugin';
3
+ export declare const ScopeResponse: import("@sinclair/typebox").TObject<{
4
+ user: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
5
+ unrestricted: import("@sinclair/typebox").TBoolean;
6
+ described: import("@sinclair/typebox").TBoolean;
7
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
8
+ sources: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
9
+ branches: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
10
+ dn: import("@sinclair/typebox").TString;
11
+ read: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
12
+ write: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
13
+ delete: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
14
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
15
+ path: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
16
+ }>>;
17
+ transit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
18
+ linksAnyDomain: import("@sinclair/typebox").TBoolean;
19
+ passwordPolicies: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
20
+ entities: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
21
+ name: import("@sinclair/typebox").TString;
22
+ base: import("@sinclair/typebox").TString;
23
+ create: import("@sinclair/typebox").TBoolean;
24
+ }>>;
25
+ }>;
17
26
  export default class AuthzScope extends DmPlugin {
18
27
  name: string;
19
28
  roles: Role[];
@@ -16,6 +16,11 @@
16
16
  import type { Express } from 'express';
17
17
  import DmPlugin, { Role } from '../../abstract/plugin';
18
18
  export default class CrowdSec extends DmPlugin {
19
+ static optionDefinitions: {
20
+ crowdsec_url: import("../../config/options").StringOption;
21
+ crowdsec_api_key: import("../../config/options").StringOption;
22
+ crowdsec_cache_ttl: import("../../config/options").NumberOption;
23
+ };
19
24
  name: string;
20
25
  roles: Role[];
21
26
  private apiUrl;
@@ -10,6 +10,9 @@ import type { Response } from 'express';
10
10
  import AuthBase, { type DmRequest } from '../../lib/auth/base';
11
11
  import type { Role } from '../../abstract/plugin';
12
12
  export default class AuthFake extends AuthBase {
13
+ static optionDefinitions: {
14
+ auth_fake_user: import("../../config/options").StringOption;
15
+ };
13
16
  name: string;
14
17
  roles: Role[];
15
18
  private readonly user;
@@ -2,6 +2,10 @@ import type { Response } from 'express';
2
2
  import AuthBase, { type DmRequest } from '../../lib/auth/base';
3
3
  import type { Role } from '../../abstract/plugin';
4
4
  export default class AuthHmac extends AuthBase {
5
+ static optionDefinitions: {
6
+ auth_hmac: import("../../config/options").ArrayOption;
7
+ auth_hmac_window: import("../../config/options").NumberOption;
8
+ };
5
9
  protected knownIdentities(): string[];
6
10
  protected identitySource(): string;
7
11
  name: string;
@@ -11,6 +11,10 @@ import AuthBase, { DmRequest } from '../../lib/auth/base';
11
11
  import type { Role } from '../../abstract/plugin';
12
12
  type LlngHandler = typeof import('lemonldap-ng-handler');
13
13
  export default class AuthLLNG extends AuthBase {
14
+ static optionDefinitions: {
15
+ llng_ini: import("../../config/options").StringOption;
16
+ llng_username_header: import("../../config/options").StringOption;
17
+ };
14
18
  name: string;
15
19
  roles: Role[];
16
20
  private handler?;
@@ -4,6 +4,13 @@ import AuthBase, { DmRequest } from '../../lib/auth/base';
4
4
  import { type Role } from '../../abstract/plugin';
5
5
  import { DM } from '../../bin';
6
6
  export default class OpenIDConnect extends AuthBase {
7
+ static optionDefinitions: {
8
+ oidc_server: import("../../config/options").StringOption;
9
+ oidc_username_claim: import("../../config/options").StringOption;
10
+ oidc_client_id: import("../../config/options").StringOption;
11
+ oidc_client_secret: import("../../config/options").StringOption;
12
+ base_url: import("../../config/options").StringOption;
13
+ };
7
14
  name: string;
8
15
  configApiKey: string;
9
16
  roles: Role[];
@@ -15,6 +15,10 @@
15
15
  import type { Express } from 'express';
16
16
  import DmPlugin, { type Role } from '../../abstract/plugin';
17
17
  export default class RateLimit extends DmPlugin {
18
+ static optionDefinitions: {
19
+ rate_limit_window_ms: import("../../config/options").NumberOption;
20
+ rate_limit_max: import("../../config/options").NumberOption;
21
+ };
18
22
  name: string;
19
23
  roles: Role[];
20
24
  private store;
@@ -9,6 +9,9 @@ import type { Response } from 'express';
9
9
  import AuthBase, { type DmRequest } from '../../lib/auth/base';
10
10
  import type { Role } from '../../abstract/plugin';
11
11
  export default class AuthToken extends AuthBase {
12
+ static optionDefinitions: {
13
+ auth_token: import("../../config/options").ArrayOption;
14
+ };
12
15
  protected knownIdentities(): string[];
13
16
  protected identitySource(): string;
14
17
  name: string;
@@ -2,6 +2,11 @@ import type { Response } from 'express';
2
2
  import AuthBase, { type DmRequest } from '../../lib/auth/base';
3
3
  import type { Role } from '../../abstract/plugin';
4
4
  export default class AuthTotp extends AuthBase {
5
+ static optionDefinitions: {
6
+ auth_totp: import("../../config/options").ArrayOption;
7
+ auth_totp_window: import("../../config/options").NumberOption;
8
+ auth_totp_step: import("../../config/options").NumberOption;
9
+ };
5
10
  protected knownIdentities(): string[];
6
11
  protected identitySource(): string;
7
12
  name: string;
@@ -34,6 +34,10 @@ declare global {
34
34
  }
35
35
  }
36
36
  export default class TrustedProxy extends DmPlugin {
37
+ static optionDefinitions: {
38
+ trusted_proxy: import("../../config/options").ArrayOption;
39
+ trusted_proxy_auth_header: import("../../config/options").StringOption;
40
+ };
37
41
  name: string;
38
42
  roles: Role[];
39
43
  private trustedNetworks;
@@ -20,6 +20,9 @@ import DmPlugin from '../abstract/plugin';
20
20
  import type { DM } from '../bin';
21
21
  import type { OidcLogoutToken, OidcSessionClaims } from '../hooks';
22
22
  export default class Bcl extends DmPlugin {
23
+ static optionDefinitions: {
24
+ bcl_retention: import("../config/options").NumberOption;
25
+ };
23
26
  name: string;
24
27
  dependencies: {
25
28
  storage: string;
@@ -0,0 +1,8 @@
1
+ /** Back-Channel Logout plugin options. */
2
+ import type { Config } from '../config/args';
3
+ import { type OptionsOf } from '../config/options';
4
+ export declare const bclOptions: {
5
+ bcl_retention: import("../config/options").NumberOption;
6
+ };
7
+ export type BclOptions = OptionsOf<typeof bclOptions>;
8
+ export declare function bclOptionsOf(config: Config): BclOptions;
@@ -10,16 +10,26 @@
10
10
  */
11
11
  import type { Express } from 'express';
12
12
  import DmPlugin, { type Role } from '../abstract/plugin';
13
+ interface ConfigApiResponse {
14
+ apiPrefix: string;
15
+ ldapBase: string;
16
+ features: Record<string, unknown>;
17
+ /** Absent when the version could not be read at start-up */
18
+ version?: string;
19
+ }
20
+ /** The body of `GET /v1/config`, `version` left out when it is unknown. */
21
+ export declare function configApiResponse(apiPrefix: string, ldapBase: string, features: Record<string, unknown>, version: string | undefined): ConfigApiResponse;
13
22
  /**
14
23
  * @openapi-component
15
24
  * Config:
16
25
  * type: object
17
26
  * description: |
18
- * Aggregated server configuration. The top-level fields are always
19
- * present; `features` is a dynamic map whose keys are the names of
20
- * loaded plugins that declare the `configurable` role. Each plugin
21
- * contributes an arbitrary sub-object — consult the individual plugin
22
- * documentation for its exact shape.
27
+ * Aggregated server configuration. `apiPrefix`, `ldapBase` and
28
+ * `features` are always present; `version` is present unless the server
29
+ * could not read it at start-up; `features` is a dynamic map whose keys
30
+ * are the names of loaded plugins that declare the `configurable` role.
31
+ * Each plugin contributes an arbitrary sub-object — consult the
32
+ * individual plugin documentation for its exact shape.
23
33
  * additionalProperties: true
24
34
  * properties:
25
35
  * apiPrefix:
@@ -30,6 +40,13 @@ import DmPlugin, { type Role } from '../abstract/plugin';
30
40
  * type: string
31
41
  * description: The root LDAP suffix used by this server.
32
42
  * example: dc=example,dc=com
43
+ * version:
44
+ * type: string
45
+ * description: |
46
+ * The server's version, as its package declares it. A client reads it
47
+ * to tell an administrator the server is older than it supports; a
48
+ * server that cannot tell its version leaves the field out.
49
+ * example: 1.2.1
33
50
  * features:
34
51
  * type: object
35
52
  * description: |
@@ -52,6 +69,7 @@ import DmPlugin, { type Role } from '../abstract/plugin';
52
69
  * example:
53
70
  * apiPrefix: /api
54
71
  * ldapBase: dc=example,dc=com
72
+ * version: 1.2.1
55
73
  * features:
56
74
  * ldapGroups:
57
75
  * enabled: true
@@ -73,3 +91,4 @@ export default class ConfigApi extends DmPlugin {
73
91
  */
74
92
  private collectPluginConfigs;
75
93
  }
94
+ export {};
@@ -6,26 +6,15 @@
6
6
  import type { Express } from 'express';
7
7
  import DmPlugin, { type Role } from '../../abstract/plugin';
8
8
  /**
9
- * @openapi-component
10
- * Hello:
11
- * type: object
12
- * description: Response returned by the hello-world demo endpoint.
13
- * properties:
14
- * message:
15
- * type: string
16
- * description: Static greeting string.
17
- * example: Hello
18
- * hookResults:
19
- * type: array
20
- * description: |
21
- * Results collected from every function registered on the `hello`
22
- * hook. Empty when no hook listeners are installed.
23
- * items: {}
24
- * example: []
25
- * example:
26
- * message: Hello
27
- * hookResults: []
9
+ * The answer of the hello-world endpoint.
10
+ *
11
+ * Exported because the OpenAPI generator reads it without running the
12
+ * plugin, as it reads every schema a route declares.
28
13
  */
14
+ export declare const HelloResponse: import("@sinclair/typebox").TObject<{
15
+ message: import("@sinclair/typebox").TString;
16
+ hookResults: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
17
+ }>;
29
18
  export default class HelloWorld extends DmPlugin {
30
19
  name: string;
31
20
  roles: Role[];
@@ -1,5 +1,22 @@
1
1
  import type { Express } from 'express';
2
2
  import DmPlugin, { type Role } from '../../abstract/plugin';
3
+ export declare const StatusBody: import("@sinclair/typebox").TObject<{
4
+ state: import("@sinclair/typebox").TString;
5
+ }>;
6
+ export declare const PasswordBody: import("@sinclair/typebox").TObject<{
7
+ password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
+ forceChange: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
9
+ }>;
10
+ export declare const StatusResponse: import("@sinclair/typebox").TObject<{
11
+ success: import("@sinclair/typebox").TBoolean;
12
+ state: import("@sinclair/typebox").TString;
13
+ }>;
14
+ export declare const PasswordResponse: import("@sinclair/typebox").TObject<{
15
+ success: import("@sinclair/typebox").TBoolean;
16
+ generated: import("@sinclair/typebox").TBoolean;
17
+ forceChange: import("@sinclair/typebox").TBoolean;
18
+ password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
19
+ }>;
3
20
  /**
4
21
  * Draw a password from {@link PASSWORD_ALPHABET} with a uniform distribution.
5
22
  *