ldap-rest 2.0.3 → 2.0.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.
Files changed (169) hide show
  1. package/dist/lib/entitySchema/validator.js +1 -1
  2. package/dist/lib/utils.js +1 -1
  3. package/dist/plugins/auth/authzDynamic.js +1 -1
  4. package/dist/plugins/auth/trustedProxy.js +1 -1
  5. package/dist/plugins/ldap/departmentSync.js +1 -1
  6. package/dist/plugins/scim/baseResolver.js +1 -1
  7. package/dist/src/abstract/ldapFlat.d.ts +6 -6
  8. package/dist/src/abstract/plugin.d.ts +11 -11
  9. package/dist/src/abstract/twakePlugin.d.ts +4 -4
  10. package/dist/src/bin/index.d.ts +10 -10
  11. package/dist/src/browser/ldap-browser/LdapBrowser.d.ts +1 -1
  12. package/dist/src/browser/ldap-browser/api/RawApiClient.d.ts +1 -1
  13. package/dist/src/browser/ldap-browser/components/EntryTree.d.ts +2 -2
  14. package/dist/src/browser/ldap-browser/components/EntryView.d.ts +2 -2
  15. package/dist/src/browser/ldap-browser/index.d.ts +4 -5
  16. package/dist/src/browser/ldap-browser/schema.d.ts +1 -1
  17. package/dist/src/browser/ldap-group-editor/LdapGroupEditor.d.ts +2 -2
  18. package/dist/src/browser/ldap-group-editor/api/GroupApiClient.d.ts +1 -1
  19. package/dist/src/browser/ldap-group-editor/components/CreateGroupModal.d.ts +2 -2
  20. package/dist/src/browser/ldap-group-editor/components/GroupPropertyEditor.d.ts +1 -1
  21. package/dist/src/browser/ldap-group-editor/components/MoveGroupModal.d.ts +1 -1
  22. package/dist/src/browser/ldap-group-editor/types.d.ts +1 -1
  23. package/dist/src/browser/ldap-resource-editor/api/ResourceApiClient.d.ts +2 -2
  24. package/dist/src/browser/ldap-resource-editor/index.d.ts +2 -2
  25. package/dist/src/browser/ldap-resource-editor/types.d.ts +1 -1
  26. package/dist/src/browser/ldap-tree-viewer/LdapTreeViewer.d.ts +1 -1
  27. package/dist/src/browser/ldap-tree-viewer/components/TreeNode.d.ts +2 -2
  28. package/dist/src/browser/ldap-tree-viewer/components/TreeRoot.d.ts +2 -2
  29. package/dist/src/browser/ldap-tree-viewer/index.d.ts +2 -3
  30. package/dist/src/browser/ldap-tree-viewer/store/actions.d.ts +2 -2
  31. package/dist/src/browser/ldap-tree-viewer/store/reducers.d.ts +2 -2
  32. package/dist/src/browser/ldap-unit-editor/LdapUnitEditor.d.ts +1 -1
  33. package/dist/src/browser/ldap-unit-editor/api/UnitApiClient.d.ts +1 -1
  34. package/dist/src/browser/ldap-unit-editor/components/MoveUnitModal.d.ts +1 -1
  35. package/dist/src/browser/ldap-unit-editor/components/UnitPropertyEditor.d.ts +1 -1
  36. package/dist/src/browser/ldap-unit-editor/types.d.ts +1 -1
  37. package/dist/src/browser/ldap-user-editor/LdapUserEditor.d.ts +2 -2
  38. package/dist/src/browser/ldap-user-editor/api/UserApiClient.d.ts +2 -2
  39. package/dist/src/browser/ldap-user-editor/components/MoveUserModal.d.ts +1 -1
  40. package/dist/src/browser/ldap-user-editor/components/PointerField.d.ts +2 -2
  41. package/dist/src/browser/ldap-user-editor/components/UserEditor.d.ts +1 -1
  42. package/dist/src/browser/ldap-user-editor/components/UserList.d.ts +1 -1
  43. package/dist/src/browser/ldap-user-editor/components/UserTree.d.ts +1 -1
  44. package/dist/src/browser/ldap-user-editor/index.d.ts +2 -3
  45. package/dist/src/browser/ldap-user-editor/types.d.ts +1 -1
  46. package/dist/src/browser/shared/components/Modal.d.ts +1 -1
  47. package/dist/src/browser/shared/index.d.ts +7 -7
  48. package/dist/src/browser/shared/utils/form.d.ts +1 -1
  49. package/dist/src/browser/shared/utils/schema.d.ts +1 -1
  50. package/dist/src/config/args.d.ts +3 -3
  51. package/dist/src/config/options.d.ts +2 -2
  52. package/dist/src/config/schema.d.ts +1 -1
  53. package/dist/src/hooks.d.ts +5 -5
  54. package/dist/src/lib/auth/base.d.ts +2 -2
  55. package/dist/src/lib/authz/base.d.ts +6 -6
  56. package/dist/src/lib/authz/composition.d.ts +4 -4
  57. package/dist/src/lib/entitySchema/validator.d.ts +23 -2
  58. package/dist/src/lib/expressFormatedResponses.d.ts +1 -1
  59. package/dist/src/lib/health.d.ts +1 -1
  60. package/dist/src/lib/hookBus.d.ts +1 -1
  61. package/dist/src/lib/ldap/schema.d.ts +2 -2
  62. package/dist/src/lib/ldapActions.d.ts +5 -5
  63. package/dist/src/lib/mailDomains.d.ts +1 -1
  64. package/dist/src/lib/parseConfig.d.ts +1 -1
  65. package/dist/src/lib/schemaFile.d.ts +1 -1
  66. package/dist/src/lib/staticFiles.d.ts +1 -1
  67. package/dist/src/lib/storage/store.d.ts +1 -1
  68. package/dist/src/lib/utils.d.ts +3 -3
  69. package/dist/src/logger/winston.d.ts +1 -1
  70. package/dist/src/plugins/auth/auth.options.d.ts +39 -39
  71. package/dist/src/plugins/auth/authzDynamic.d.ts +24 -11
  72. package/dist/src/plugins/auth/authzLinid1.d.ts +7 -7
  73. package/dist/src/plugins/auth/authzPerBranch.d.ts +8 -8
  74. package/dist/src/plugins/auth/authzPerRoute.d.ts +2 -2
  75. package/dist/src/plugins/auth/authzScope.d.ts +1 -1
  76. package/dist/src/plugins/auth/crowdsec.d.ts +4 -4
  77. package/dist/src/plugins/auth/fake.d.ts +3 -3
  78. package/dist/src/plugins/auth/hmac.d.ts +4 -4
  79. package/dist/src/plugins/auth/llng.d.ts +20 -5
  80. package/dist/src/plugins/auth/openidconnect.d.ts +9 -9
  81. package/dist/src/plugins/auth/rateLimit.d.ts +3 -3
  82. package/dist/src/plugins/auth/token.d.ts +3 -3
  83. package/dist/src/plugins/auth/totp.d.ts +5 -5
  84. package/dist/src/plugins/auth/trustedProxy.d.ts +16 -32
  85. package/dist/src/plugins/bcl.d.ts +4 -4
  86. package/dist/src/plugins/bcl.options.d.ts +3 -3
  87. package/dist/src/plugins/configApi.d.ts +1 -1
  88. package/dist/src/plugins/demo/helloworld.d.ts +1 -1
  89. package/dist/src/plugins/ldap/accountLifecycle.d.ts +1 -1
  90. package/dist/src/plugins/ldap/bulkImport.d.ts +5 -5
  91. package/dist/src/plugins/ldap/departmentSync.d.ts +14 -3
  92. package/dist/src/plugins/ldap/enterpriseRules.d.ts +7 -7
  93. package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +6 -6
  94. package/dist/src/plugins/ldap/flatGeneric.d.ts +6 -6
  95. package/dist/src/plugins/ldap/groups.d.ts +8 -8
  96. package/dist/src/plugins/ldap/ldap.options.d.ts +45 -45
  97. package/dist/src/plugins/ldap/onChange.d.ts +4 -4
  98. package/dist/src/plugins/ldap/organization.d.ts +1 -1
  99. package/dist/src/plugins/ldap/organizations.d.ts +12 -12
  100. package/dist/src/plugins/ldap/passwordPolicy.d.ts +11 -11
  101. package/dist/src/plugins/ldap/raw.d.ts +8 -8
  102. package/dist/src/plugins/ldap/trash.d.ts +6 -6
  103. package/dist/src/plugins/metrics.d.ts +3 -3
  104. package/dist/src/plugins/metrics.options.d.ts +3 -3
  105. package/dist/src/plugins/rabbitmq.d.ts +4 -4
  106. package/dist/src/plugins/rabbitmq.options.d.ts +3 -3
  107. package/dist/src/plugins/scim/baseResolver.d.ts +3 -3
  108. package/dist/src/plugins/scim/bulk.d.ts +7 -7
  109. package/dist/src/plugins/scim/discovery.d.ts +4 -4
  110. package/dist/src/plugins/scim/errors.d.ts +3 -3
  111. package/dist/src/plugins/scim/filter.d.ts +1 -1
  112. package/dist/src/plugins/scim/groups.d.ts +8 -8
  113. package/dist/src/plugins/scim/list.d.ts +1 -1
  114. package/dist/src/plugins/scim/mapping.d.ts +2 -2
  115. package/dist/src/plugins/scim/patch.d.ts +2 -2
  116. package/dist/src/plugins/scim/scim.d.ts +30 -30
  117. package/dist/src/plugins/scim/scim.options.d.ts +27 -27
  118. package/dist/src/plugins/scim/users.d.ts +6 -6
  119. package/dist/src/plugins/static.d.ts +6 -6
  120. package/dist/src/plugins/static.options.d.ts +6 -6
  121. package/dist/src/plugins/storage/file.d.ts +2 -2
  122. package/dist/src/plugins/storage/ldap.d.ts +2 -2
  123. package/dist/src/plugins/storage/postgres.d.ts +2 -2
  124. package/dist/src/plugins/storage/valkey.d.ts +2 -2
  125. package/dist/src/plugins/storage.d.ts +13 -13
  126. package/dist/src/plugins/storage.options.d.ts +11 -11
  127. package/dist/src/plugins/twake/appAccounts.options.d.ts +6 -6
  128. package/dist/src/plugins/twake/appAccountsApi.d.ts +7 -7
  129. package/dist/src/plugins/twake/appAccountsConsistency.d.ts +9 -9
  130. package/dist/src/plugins/twake/calendar.d.ts +14 -14
  131. package/dist/src/plugins/twake/calendar.options.d.ts +11 -11
  132. package/dist/src/plugins/twake/calendarResources.d.ts +1 -1
  133. package/dist/src/plugins/twake/cloudery.options.d.ts +18 -18
  134. package/dist/src/plugins/twake/clouderyProvision.d.ts +19 -19
  135. package/dist/src/plugins/twake/cozy.options.d.ts +14 -14
  136. package/dist/src/plugins/twake/cozyProvision.d.ts +15 -15
  137. package/dist/src/plugins/twake/drive.d.ts +9 -9
  138. package/dist/src/plugins/twake/drive.options.d.ts +7 -7
  139. package/dist/src/plugins/twake/groups.d.ts +16 -16
  140. package/dist/src/plugins/twake/instances.d.ts +38 -38
  141. package/dist/src/plugins/twake/james.d.ts +18 -18
  142. package/dist/src/plugins/twake/james.options.d.ts +13 -13
  143. package/dist/src/plugins/twake/lifecycleAttributes.d.ts +2 -2
  144. package/dist/src/plugins/twake/lifecycleEvents.d.ts +13 -13
  145. package/dist/src/plugins/twake/migrationProxy.d.ts +11 -11
  146. package/dist/src/plugins/twake/migrationProxy.options.d.ts +8 -8
  147. package/dist/src/plugins/twake/spaces.d.ts +12 -12
  148. package/dist/src/plugins/twake/tombstone.d.ts +10 -10
  149. package/dist/src/plugins/twake/twakeGroups.options.d.ts +12 -12
  150. package/dist/src/plugins/twake/twakeInstances.options.d.ts +35 -35
  151. package/dist/src/plugins/twake/twakeLifecycle.options.d.ts +12 -12
  152. package/dist/src/plugins/twake/twakeSpaces.options.d.ts +11 -11
  153. package/dist/src/plugins/twake/twakeTombstone.options.d.ts +9 -9
  154. package/dist/src/plugins/weblogs.d.ts +1 -1
  155. package/docs/client-development/schemas/README.md +6 -1
  156. package/docs/development/contracts.md +22 -0
  157. package/docs/presentations/en.md +1 -1
  158. package/docs/presentations/fr.md +1 -1
  159. package/docs/usage/plugins/auth/authz-dynamic.md +3 -1
  160. package/docs/usage/plugins/auth/trusted-proxy.md +11 -1
  161. package/docs/usage/upgrading.md +27 -0
  162. package/package.json +4 -3
  163. package/static/browser/ldap-user-editor.esm.js.map +1 -1
  164. package/static/browser/ldap-user-editor.js.map +1 -1
  165. package/static/browser/ldap-user-editor.min.js.map +1 -1
  166. package/static/browser/shared/utils/schema.js.map +1 -1
  167. package/static/browser/shared.esm.js.map +1 -1
  168. package/static/browser/shared.js.map +1 -1
  169. package/static/browser/shared.min.js.map +1 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * LDAP User Editor - API Client
3
3
  */
4
- import type { Config, LdapUser, PointerOption, Schema } from '../types';
5
- import { CacheManager } from '../cache/CacheManager';
4
+ import type { Config, LdapUser, PointerOption, Schema } from '../types.js';
5
+ import { CacheManager } from '../cache/CacheManager.js';
6
6
  export declare class UserApiClient {
7
7
  private baseUrl;
8
8
  private cache;
@@ -2,7 +2,7 @@
2
2
  * LDAP User Editor - Move User Modal Component
3
3
  * Modal dialog for selecting target organization when moving a user
4
4
  */
5
- import type { UserApiClient } from '../api/UserApiClient';
5
+ import type { UserApiClient } from '../api/UserApiClient.js';
6
6
  export declare class MoveUserModal {
7
7
  private modal;
8
8
  private api;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * LDAP User Editor - Pointer Field Component
3
3
  */
4
- import type { SchemaAttribute } from '../types';
5
- import type { UserApiClient } from '../api/UserApiClient';
4
+ import type { SchemaAttribute } from '../types.js';
5
+ import type { UserApiClient } from '../api/UserApiClient.js';
6
6
  export declare class PointerField {
7
7
  private api;
8
8
  private attribute;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * LDAP User Editor - User Editor Component
3
3
  */
4
- import type { UserApiClient } from '../api/UserApiClient';
4
+ import type { UserApiClient } from '../api/UserApiClient.js';
5
5
  export declare class UserEditor {
6
6
  private container;
7
7
  private api;
@@ -2,7 +2,7 @@
2
2
  * LDAP User Editor - User List Component
3
3
  * Shows users in a selected organization
4
4
  */
5
- import type { UserApiClient } from '../api/UserApiClient';
5
+ import type { UserApiClient } from '../api/UserApiClient.js';
6
6
  export declare class UserList {
7
7
  private container;
8
8
  private api;
@@ -2,7 +2,7 @@
2
2
  * LDAP User Editor - Organization Tree Component
3
3
  * Shows only LDAP organization tree (filters out users/groups)
4
4
  */
5
- import { DisposableComponent } from '../../shared/components/DisposableComponent';
5
+ import { DisposableComponent } from '../../shared/components/DisposableComponent.js';
6
6
  export declare class UserTree extends DisposableComponent {
7
7
  private container;
8
8
  private baseUrl;
@@ -2,6 +2,5 @@
2
2
  * LDAP User Editor - Browser library
3
3
  * @author Xavier Guimard
4
4
  */
5
- import './styles.css';
6
- export { LdapUserEditor } from './LdapUserEditor';
7
- export type { EditorOptions, LdapUser, Schema, SchemaAttribute, PointerOption, Config, } from './types';
5
+ export { LdapUserEditor } from './LdapUserEditor.js';
6
+ export type { EditorOptions, LdapUser, Schema, SchemaAttribute, PointerOption, Config, } from './types.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * LDAP User Editor - Type definitions
3
3
  */
4
- import type { LocalizedText } from '../shared/types';
4
+ import type { LocalizedText } from '../shared/types/index.js';
5
5
  export interface EditorOptions {
6
6
  containerId: string;
7
7
  apiBaseUrl?: string;
@@ -2,7 +2,7 @@
2
2
  * Reusable Modal component
3
3
  * @module browser/shared/components/Modal
4
4
  */
5
- import { DisposableComponent } from './DisposableComponent';
5
+ import { DisposableComponent } from './DisposableComponent.js';
6
6
  export interface ModalOptions {
7
7
  id: string;
8
8
  title: string;
@@ -2,10 +2,10 @@
2
2
  * Main export file for shared browser utilities and components
3
3
  * @module browser/shared
4
4
  */
5
- export * from './utils/dom';
6
- export * from './utils/form';
7
- export * from './utils/schema';
8
- export * from './utils/totp';
9
- export { Modal, type ModalOptions } from './components/Modal';
10
- export { StatusMessage, showStatus, type StatusMessageOptions, } from './components/StatusMessage';
11
- export * from './types';
5
+ export * from './utils/dom.js';
6
+ export * from './utils/form.js';
7
+ export * from './utils/schema.js';
8
+ export * from './utils/totp.js';
9
+ export { Modal, type ModalOptions } from './components/Modal.js';
10
+ export { StatusMessage, showStatus, type StatusMessageOptions, } from './components/StatusMessage.js';
11
+ export * from './types/index.js';
@@ -2,7 +2,7 @@
2
2
  * Form utility functions
3
3
  * @module browser/shared/utils/form
4
4
  */
5
- import type { SchemaAttribute, PointerOption } from '../types';
5
+ import type { SchemaAttribute, PointerOption } from '../types/index.js';
6
6
  /**
7
7
  * Get user-friendly field label from field name
8
8
  */
@@ -2,7 +2,7 @@
2
2
  * Schema utility functions
3
3
  * @module browser/shared/utils/schema
4
4
  */
5
- import type { LocalizedText, PointerOption, SchemaAttribute } from '../types';
5
+ import type { LocalizedText, PointerOption, SchemaAttribute } from '../types/index.js';
6
6
  /**
7
7
  * Load pointer options from API
8
8
  */
@@ -1,6 +1,6 @@
1
- import type { AttributesList } from '../lib/ldapActions';
2
- import type { ConfigTemplate } from '../lib/parseConfig';
3
- export { STATIC_CSP, STATIC_FRAME_OPTIONS } from '../plugins/static.options';
1
+ import type { AttributesList } from '../lib/ldapActions.js';
2
+ import type { ConfigTemplate } from '../lib/parseConfig.js';
3
+ export { STATIC_CSP, STATIC_FRAME_OPTIONS } from '../plugins/static.options.js';
4
4
  export interface BranchPermissions {
5
5
  read?: boolean;
6
6
  write?: boolean;
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * See `docs/plugin-development/options.md`.
10
10
  */
11
- import { type ArrayKind, type ConfigEntry, type ConfigTemplate } from '../lib/parseConfig';
12
- import type { Config } from './args';
11
+ import { type ArrayKind, type ConfigEntry, type ConfigTemplate } from '../lib/parseConfig.js';
12
+ import type { Config } from './args.js';
13
13
  export type OptionType = 'string' | 'number' | 'boolean' | 'array' | 'json';
14
14
  export interface OptionSpec<T> {
15
15
  readonly type: OptionType;
@@ -1,4 +1,4 @@
1
- import type { AttributesList, AttributeValue, ModifyRequest } from '../lib/ldapActions';
1
+ import type { AttributesList, AttributeValue, ModifyRequest } from '../lib/ldapActions.js';
2
2
  /**
3
3
  * Scalar and container types an entity schema may declare.
4
4
  *
@@ -4,11 +4,11 @@
4
4
  */
5
5
  import type { Entry, SearchOptions, SearchResult } from 'ldapts';
6
6
  import type { Request, Response } from 'express';
7
- import type { ModifyRequest, AttributesList, AttributeValue, LdapList } from './lib/ldapActions';
8
- import type { ChangesToNotify } from './plugins/ldap/onChange';
9
- import type { ChangeContext } from './lib/changeContext';
10
- import type { BulkResponse, ScimGroup, ScimUser } from './plugins/scim/types';
11
- import * as utils from './lib/utils';
7
+ import type { ModifyRequest, AttributesList, AttributeValue, LdapList } from './lib/ldapActions.js';
8
+ import type { ChangesToNotify } from './plugins/ldap/onChange.js';
9
+ import type { ChangeContext } from './lib/changeContext.js';
10
+ import type { BulkResponse, ScimGroup, ScimUser } from './plugins/scim/types.js';
11
+ import * as utils from './lib/utils.js';
12
12
  export type MaybePromise<T> = Promise<T> | T;
13
13
  export type ChainedHook<T> = (arg: T) => MaybePromise<T>;
14
14
  /**
@@ -1,6 +1,6 @@
1
1
  import type { Express, Request, Response } from 'express';
2
- import DmPlugin from '../../abstract/plugin';
3
- import type { Config } from '../../config/args';
2
+ import DmPlugin from '../../abstract/plugin.js';
3
+ import type { Config } from '../../config/args.js';
4
4
  /**
5
5
  * A request as the authentication plugins leave it.
6
6
  *
@@ -7,12 +7,12 @@
7
7
  * @group Libraries
8
8
  */
9
9
  import type { SearchOptions } from 'ldapts';
10
- import DmPlugin, { type Role } from '../../abstract/plugin';
11
- import type { DM } from '../../bin';
12
- import type { BranchPermissions } from '../../config/args';
13
- import type { Hooks } from '../../hooks';
14
- import { type DmRequest } from '../auth/base';
15
- import type { ModifyRequest } from '../ldapActions';
10
+ import DmPlugin, { type Role } from '../../abstract/plugin.js';
11
+ import type { DM } from '../../bin/index.js';
12
+ import type { BranchPermissions } from '../../config/args.js';
13
+ import type { Hooks } from '../../hooks.js';
14
+ import { type DmRequest } from '../auth/base.js';
15
+ import type { ModifyRequest } from '../ldapActions.js';
16
16
  /**
17
17
  * The rule of the most specific configured branch holding `target`.
18
18
  *
@@ -16,10 +16,10 @@
16
16
  * the same ones without `--authz-combine`.
17
17
  * @group Libraries
18
18
  */
19
- import type DmPlugin from '../../abstract/plugin';
20
- import type { DM } from '../../bin';
21
- import type { Config } from '../../config/args';
22
- import type { DmRequest } from '../auth/base';
19
+ import type DmPlugin from '../../abstract/plugin.js';
20
+ import type { DM } from '../../bin/index.js';
21
+ import type { Config } from '../../config/args.js';
22
+ import type { DmRequest } from '../auth/base.js';
23
23
  /**
24
24
  * The hooks an LDAP operation is judged in: refused from, or — for
25
25
  * `ldapsearchfilter` — narrowed to what the caller may see. Two plugins on
@@ -1,5 +1,5 @@
1
- import type { AttributesList, AttributeValue, ModifyRequest } from '../ldapActions';
2
- import type { Schema } from '../../config/schema';
1
+ import type { AttributesList, AttributeValue, ModifyRequest } from '../ldapActions.js';
2
+ import type { Schema } from '../../config/schema.js';
3
3
  export interface EntityValidatorDeps {
4
4
  /**
5
5
  * Tells whether a DN names an entry. Asked as the server: a reference to
@@ -72,6 +72,27 @@ export declare class EntityValidator {
72
72
  * option, the only one a write takes, written as the directory writes it.
73
73
  */
74
74
  private schemaSpelling;
75
+ /**
76
+ * Refuse a fixed attribute a creation carries under an option. The schema
77
+ * forces its value under the attribute's own name, which leaves a subtype
78
+ * such as `l;lang-fr` as a second value of an attribute that cannot be
79
+ * changed. An alias or an OID (`localityName`, `2.5.4.7`) names the same
80
+ * attribute. A fixed attribute without a default is set at creation, so it
81
+ * keeps its options.
82
+ *
83
+ * @param values entry about to be created
84
+ * @throws BadRequestError for a fixed attribute with a default under an
85
+ * option
86
+ */
87
+ private refuseFixedOptions;
88
+ /**
89
+ * The schema's definition of the attribute a name holds, through the
90
+ * schema's own key, an alias or an OID.
91
+ *
92
+ * @param field attribute name, option included
93
+ * @returns the definition, or undefined when the schema does not declare it
94
+ */
95
+ private declaredAttribute;
75
96
  /**
76
97
  * Drop, in place, the keys a creation or an `add` carries with `null` or
77
98
  * `undefined` under a name the schema does not declare. A declared
@@ -1,6 +1,6 @@
1
1
  import type { Request, Response } from 'express';
2
2
  import type winston from 'winston';
3
- import { type Refusal } from './errors';
3
+ import { type Refusal } from './errors.js';
4
4
  /**
5
5
  * Install the logger, or remove it: a test restores the state it found,
6
6
  * which before any `DM` is none.
@@ -1,5 +1,5 @@
1
1
  import type { Express } from 'express';
2
- import type { MaybePromise } from '../hooks';
2
+ import type { MaybePromise } from '../hooks.js';
3
3
  /** What a plugin answers about the resources it depends on */
4
4
  export type HealthStatus = 'ok' | 'degraded';
5
5
  /** The paths of the two probes, served before authentication */
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @see docs/plugin-development/hooks.md
11
11
  */
12
- import type { Hooks } from '../hooks';
12
+ import type { Hooks } from '../hooks.js';
13
13
  export type HookFn = Function;
14
14
  /** A promise, or the value itself */
15
15
  type Settled<T> = T extends Promise<infer P> ? P : T;
@@ -4,8 +4,8 @@
4
4
  * write needs.
5
5
  */
6
6
  import type { SearchOptions, SearchResult } from 'ldapts';
7
- import type { AttributesList, ModifyRequest } from '../ldapActions';
8
- import { SchemaIndex } from '../ldapSchema';
7
+ import type { AttributesList, ModifyRequest } from '../ldapActions.js';
8
+ import { SchemaIndex } from '../ldapSchema.js';
9
9
  export interface SchemaLogger {
10
10
  info(message: string): void;
11
11
  warn(message: string): void;
@@ -6,11 +6,11 @@ import type { Request } from 'express';
6
6
  import type { SearchResult, SearchOptions } from 'ldapts';
7
7
  import type winston from 'winston';
8
8
  import pLimit from 'p-limit';
9
- import { type Config } from '../config/args';
10
- import { type DM } from '../bin';
11
- import type { Hooks } from '../hooks';
12
- import { type ChangeContext } from './changeContext';
13
- import type { SchemaIndex } from './ldapSchema';
9
+ import { type Config } from '../config/args.js';
10
+ import { type DM } from '../bin/index.js';
11
+ import type { Hooks } from '../hooks.js';
12
+ import { type ChangeContext } from './changeContext.js';
13
+ import type { SchemaIndex } from './ldapSchema.js';
14
14
  export type AttributeValue = Buffer | Buffer[] | string[] | string;
15
15
  export type AttributesList = Record<string, AttributeValue>;
16
16
  export type LdapList = Record<string, AttributesList>;
@@ -6,7 +6,7 @@
6
6
  * each naming its domain in an attribute.
7
7
  * @group Libraries
8
8
  */
9
- import type { DM } from '../bin';
9
+ import type { DM } from '../bin/index.js';
10
10
  /** Where mail domain entries live, and the attribute naming their domain */
11
11
  export interface DomainBranch {
12
12
  base: string;
@@ -3,7 +3,7 @@
3
3
  * Order: default < env < cli
4
4
  * @author Xavier Guimard <xguimard@linagora.com>
5
5
  */
6
- import type { Config } from '../config/args';
6
+ import type { Config } from '../config/args.js';
7
7
  export type ConfigTemplate = ConfigEntry[];
8
8
  export type ArrayKind = 'identifiers' | 'dns' | 'phrases';
9
9
  export type ConfigEntry = [
@@ -1,4 +1,4 @@
1
- import type { Config } from '../bin';
1
+ import type { Config } from '../bin/index.js';
2
2
  /** Directory of the schemas shipped with LDAP-Rest, whatever --schemas-path says */
3
3
  export declare const shippedSchemasPath: string;
4
4
  /** Prefix of an `extends` naming a shipped schema, as `ldap-rest:twake/users.json` */
@@ -3,7 +3,7 @@
3
3
  * announce it
4
4
  * @module lib/staticFiles
5
5
  */
6
- import type { DM } from '../bin';
6
+ import type { DM } from '../bin/index.js';
7
7
  /** A static plugin, as another plugin asks it where it serves a file */
8
8
  export interface StaticFiles {
9
9
  schemaUrlOf(file: string): string | undefined;
@@ -26,7 +26,7 @@
26
26
  * @group Libraries
27
27
  */
28
28
  import type winston from 'winston';
29
- import type { HealthStatus } from '../health';
29
+ import type { HealthStatus } from '../health.js';
30
30
  /** What a backend keeps: a value, and when it stops counting. */
31
31
  export interface StoredRecord {
32
32
  value: string;
@@ -3,8 +3,8 @@
3
3
  * @author Xavier Guimard <xguimard@linagora.com>
4
4
  */
5
5
  import type { Request, Response, NextFunction, RequestHandler } from 'express';
6
- import type { Config } from '../bin';
7
- import type { AttributeValue } from './ldapActions';
6
+ import type { Config } from '../bin/index.js';
7
+ import type { AttributeValue } from './ldapActions.js';
8
8
  /**
9
9
  * Get a compiled RegExp from cache, or compile and cache it
10
10
  * This avoids recompiling the same regex patterns repeatedly
@@ -22,7 +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
- export { hookOwner, recordHookOwner, runAsHookOwner } from './hookBus';
25
+ export { hookOwner, recordHookOwner, runAsHookOwner } from './hookBus.js';
26
26
  export declare const transformSchemas: (schemas: string | Buffer, config: Config) => string;
27
27
  /**
28
28
  * Escape special characters in LDAP filter values according to RFC 4515
@@ -1,5 +1,5 @@
1
1
  import winston from 'winston';
2
- import { Config } from '../bin';
2
+ import { Config } from '../bin/index.js';
3
3
  declare module 'winston' {
4
4
  interface Logger {
5
5
  notice: winston.LeveledLogMethod;
@@ -2,82 +2,82 @@
2
2
  * Authentication and authorization plugin options, see
3
3
  * `docs/plugin-development/options.md`.
4
4
  */
5
- import type { AuthConfig, Config } from '../../config/args';
6
- import { type OptionsOf } from '../../config/options';
5
+ import type { AuthConfig, Config } from '../../config/args.js';
6
+ import { type OptionsOf } from '../../config/options.js';
7
7
  export declare const tokenOptions: {
8
- auth_token: import("../../config/options").ArrayOption;
8
+ auth_token: import("../../config/options.js").ArrayOption;
9
9
  };
10
10
  export type TokenOptions = OptionsOf<typeof tokenOptions>;
11
11
  export declare const fakeOptions: {
12
- auth_fake_user: import("../../config/options").StringOption;
12
+ auth_fake_user: import("../../config/options.js").StringOption;
13
13
  };
14
14
  export type FakeOptions = OptionsOf<typeof fakeOptions>;
15
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;
16
+ auth_totp: import("../../config/options.js").ArrayOption;
17
+ auth_totp_window: import("../../config/options.js").NumberOption;
18
+ auth_totp_step: import("../../config/options.js").NumberOption;
19
19
  };
20
20
  export type TotpOptions = OptionsOf<typeof totpOptions>;
21
21
  export declare const hmacOptions: {
22
- auth_hmac: import("../../config/options").ArrayOption;
23
- auth_hmac_window: import("../../config/options").NumberOption;
22
+ auth_hmac: import("../../config/options.js").ArrayOption;
23
+ auth_hmac_window: import("../../config/options.js").NumberOption;
24
24
  };
25
25
  export type HmacOptions = OptionsOf<typeof hmacOptions>;
26
26
  export declare const llngOptions: {
27
- llng_ini: import("../../config/options").StringOption;
28
- llng_username_header: import("../../config/options").StringOption;
27
+ llng_ini: import("../../config/options.js").StringOption;
28
+ llng_username_header: import("../../config/options.js").StringOption;
29
29
  };
30
30
  export type LlngOptions = OptionsOf<typeof llngOptions>;
31
31
  export declare const perRouteOptions: {
32
- authz_per_route: import("../../config/options").ArrayOption;
32
+ authz_per_route: import("../../config/options.js").ArrayOption;
33
33
  };
34
34
  export type PerRouteOptions = OptionsOf<typeof perRouteOptions>;
35
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;
36
+ authz_per_branch_config: import("../../config/options.js").JsonOption<AuthConfig>;
37
+ authz_per_branch_cache_ttl: import("../../config/options.js").NumberOption;
38
+ ldap_group_member_attribute: import("../../config/options.js").StringOption;
39
39
  };
40
40
  export type PerBranchOptions = OptionsOf<typeof perBranchOptions>;
41
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;
42
+ authz_dynamic_bypass: import("../../config/options.js").ArrayOption;
43
+ authz_dynamic_base: import("../../config/options.js").StringOption;
44
+ authz_dynamic_cache_ttl: import("../../config/options.js").NumberOption;
45
+ authz_dynamic_token_attribute: import("../../config/options.js").StringOption;
46
+ authz_dynamic_config_attribute: import("../../config/options.js").StringOption;
47
+ authz_dynamic_tenant_attribute: import("../../config/options.js").StringOption;
48
+ authz_dynamic_reload_endpoint: import("../../config/options.js").BooleanOption;
49
49
  };
50
50
  export type DynamicOptions = OptionsOf<typeof dynamicOptions>;
51
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;
52
+ authz_local_admin_attribute: import("../../config/options.js").StringOption;
53
+ authz_global_branch: import("../../config/options.js").ArrayOption;
54
+ authz_global_write_branch: import("../../config/options.js").ArrayOption;
55
+ authz_global_organization: import("../../config/options.js").StringOption;
56
56
  };
57
57
  export type Linid1Options = OptionsOf<typeof linid1Options>;
58
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
- oidc_logout_origins: import("../../config/options").ArrayOption;
59
+ oidc_server: import("../../config/options.js").StringOption;
60
+ oidc_username_claim: import("../../config/options.js").StringOption;
61
+ oidc_client_id: import("../../config/options.js").StringOption;
62
+ oidc_client_secret: import("../../config/options.js").StringOption;
63
+ base_url: import("../../config/options.js").StringOption;
64
+ oidc_logout_origins: import("../../config/options.js").ArrayOption;
65
65
  };
66
66
  export type OpenidconnectOptions = OptionsOf<typeof openidconnectOptions>;
67
67
  export declare const rateLimitOptions: {
68
- rate_limit_window_ms: import("../../config/options").NumberOption;
69
- rate_limit_max: import("../../config/options").NumberOption;
68
+ rate_limit_window_ms: import("../../config/options.js").NumberOption;
69
+ rate_limit_max: import("../../config/options.js").NumberOption;
70
70
  };
71
71
  export type RateLimitOptions = OptionsOf<typeof rateLimitOptions>;
72
72
  export declare const crowdsecOptions: {
73
- crowdsec_url: import("../../config/options").StringOption;
74
- crowdsec_api_key: import("../../config/options").StringOption;
75
- crowdsec_cache_ttl: import("../../config/options").NumberOption;
73
+ crowdsec_url: import("../../config/options.js").StringOption;
74
+ crowdsec_api_key: import("../../config/options.js").StringOption;
75
+ crowdsec_cache_ttl: import("../../config/options.js").NumberOption;
76
76
  };
77
77
  export type CrowdsecOptions = OptionsOf<typeof crowdsecOptions>;
78
78
  export declare const trustedProxyOptions: {
79
- trusted_proxy: import("../../config/options").ArrayOption;
80
- trusted_proxy_auth_header: import("../../config/options").StringOption;
79
+ trusted_proxy: import("../../config/options.js").ArrayOption;
80
+ trusted_proxy_auth_header: import("../../config/options.js").StringOption;
81
81
  };
82
82
  export type TrustedProxyOptions = OptionsOf<typeof trustedProxyOptions>;
83
83
  /** The checked values for a caller that holds a Config instead of the plugin */
@@ -25,10 +25,10 @@
25
25
  * `ou=users,ou=acme`).
26
26
  */
27
27
  import type { Express, Response } from 'express';
28
- import { type Role } from '../../abstract/plugin';
29
- import type { DM } from '../../bin';
30
- import AuthBase, { type DmRequest } from '../../lib/auth/base';
31
- import type { Hooks } from '../../hooks';
28
+ import { type Role } from '../../abstract/plugin.js';
29
+ import type { DM } from '../../bin/index.js';
30
+ import AuthBase, { type DmRequest } from '../../lib/auth/base.js';
31
+ import type { Hooks } from '../../hooks.js';
32
32
  export interface BranchAcl {
33
33
  dn: string;
34
34
  read?: boolean;
@@ -52,13 +52,13 @@ export interface AuthzDynamicRequest extends DmRequest {
52
52
  }
53
53
  export default class AuthzDynamic extends AuthBase {
54
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;
55
+ authz_dynamic_bypass: import("../../config/options.js").ArrayOption;
56
+ authz_dynamic_base: import("../../config/options.js").StringOption;
57
+ authz_dynamic_cache_ttl: import("../../config/options.js").NumberOption;
58
+ authz_dynamic_token_attribute: import("../../config/options.js").StringOption;
59
+ authz_dynamic_config_attribute: import("../../config/options.js").StringOption;
60
+ authz_dynamic_tenant_attribute: import("../../config/options.js").StringOption;
61
+ authz_dynamic_reload_endpoint: import("../../config/options.js").BooleanOption;
62
62
  };
63
63
  name: string;
64
64
  roles: Role[];
@@ -80,6 +80,19 @@ export default class AuthzDynamic extends AuthBase {
80
80
  * does not poison the cache — the previous snapshot stays in use.
81
81
  */
82
82
  reload(): Promise<void>;
83
+ /**
84
+ * Read one ACL flag of a token's JSON.
85
+ *
86
+ * Only the boolean `true` grants the permission: every string is truthy,
87
+ * `"false"`, `"no"` and `"0"` included.
88
+ *
89
+ * @param value flag as the token's JSON holds it
90
+ * @param flag flag name, for the warning
91
+ * @param branch branch the flag applies to
92
+ * @param tokenDn DN of the token entry
93
+ * @returns whether the permission is granted
94
+ */
95
+ private aclFlag;
83
96
  /**
84
97
  * Ensure the cache is fresh (blocks if reloading).
85
98
  *
@@ -6,19 +6,19 @@
6
6
  * Grants permissions to users referenced in organization's twakeLocalAdminLink
7
7
  * @group Plugins
8
8
  */
9
- import type { DM } from '../../bin';
10
- import type { BranchPermissions } from '../../config/args';
11
- import AuthzBase from '../../lib/authz/base';
9
+ import type { DM } from '../../bin/index.js';
10
+ import type { BranchPermissions } from '../../config/args.js';
11
+ import AuthzBase from '../../lib/authz/base.js';
12
12
  interface CachedPermissions {
13
13
  branches: Map<string, BranchPermissions>;
14
14
  timestamp: number;
15
15
  }
16
16
  export default class AuthzLinid1 extends AuthzBase {
17
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;
18
+ authz_local_admin_attribute: import("../../config/options.js").StringOption;
19
+ authz_global_branch: import("../../config/options.js").ArrayOption;
20
+ authz_global_write_branch: import("../../config/options.js").ArrayOption;
21
+ authz_global_organization: import("../../config/options.js").StringOption;
22
22
  };
23
23
  name: string;
24
24
  permissionsCache: Map<string, CachedPermissions>;