ldap-rest 1.2.1 → 1.3.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.
- package/bin/sync-james.mjs +13 -2
- package/dist/abstract/ldapFlat.js +1 -1
- package/dist/abstract/plugin.js +1 -1
- package/dist/abstract/twakePlugin.js +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/config/args.js +1 -1
- package/dist/config/options.js +1 -0
- package/dist/config/schema.js +1 -1
- package/dist/lib/auth/base.js +1 -1
- package/dist/lib/authz/base.js +1 -1
- package/dist/lib/entitySchema/validator.js +1 -1
- package/dist/lib/errors.js +1 -1
- package/dist/lib/expressFormatedResponses.js +1 -1
- package/dist/lib/health.js +1 -1
- package/dist/lib/hookBus.js +1 -0
- package/dist/lib/instanceProviders.js +1 -1
- package/dist/lib/ldapActions.js +1 -1
- package/dist/lib/ldapSchema.js +1 -1
- package/dist/lib/parseConfig.js +1 -1
- package/dist/lib/route.js +1 -0
- package/dist/lib/schemaFile.js +1 -1
- package/dist/lib/storage/store.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/version.js +1 -0
- package/dist/logger/winston.js +1 -1
- package/dist/plugins/auth/auth.options.js +1 -0
- package/dist/plugins/auth/authzDynamic.js +1 -1
- package/dist/plugins/auth/authzLinid1.js +1 -1
- package/dist/plugins/auth/authzPerBranch.js +1 -1
- package/dist/plugins/auth/authzPerRoute.js +1 -1
- package/dist/plugins/auth/authzScope.js +1 -1
- package/dist/plugins/auth/crowdsec.js +1 -1
- package/dist/plugins/auth/fake.js +1 -1
- package/dist/plugins/auth/hmac.js +1 -1
- package/dist/plugins/auth/llng.js +1 -1
- package/dist/plugins/auth/openidconnect.js +1 -1
- package/dist/plugins/auth/rateLimit.js +1 -1
- package/dist/plugins/auth/token.js +1 -1
- package/dist/plugins/auth/totp.js +1 -1
- package/dist/plugins/auth/trustedProxy.js +1 -1
- package/dist/plugins/bcl.js +1 -1
- package/dist/plugins/bcl.options.js +1 -0
- package/dist/plugins/configApi.js +1 -1
- package/dist/plugins/demo/helloworld.js +1 -1
- package/dist/plugins/ldap/accountLifecycle.js +1 -1
- package/dist/plugins/ldap/bulkImport.js +1 -1
- package/dist/plugins/ldap/departmentSync.js +1 -1
- package/dist/plugins/ldap/enterpriseRules.js +1 -1
- package/dist/plugins/ldap/externalUsersInGroups.js +1 -1
- package/dist/plugins/ldap/flatGeneric.js +1 -1
- package/dist/plugins/ldap/groups.js +1 -1
- package/dist/plugins/ldap/ldap.options.js +1 -0
- package/dist/plugins/ldap/onChange.js +1 -1
- package/dist/plugins/ldap/organizations.js +1 -1
- package/dist/plugins/ldap/passwordPolicy.js +1 -1
- package/dist/plugins/ldap/raw.js +1 -1
- package/dist/plugins/ldap/trash.js +1 -1
- package/dist/plugins/metrics.js +1 -1
- package/dist/plugins/metrics.options.js +1 -0
- package/dist/plugins/rabbitmq.js +1 -1
- package/dist/plugins/rabbitmq.options.js +1 -0
- package/dist/plugins/scim/baseResolver.js +1 -1
- package/dist/plugins/scim/bulk.js +1 -1
- package/dist/plugins/scim/discovery.js +1 -1
- package/dist/plugins/scim/errors.js +1 -1
- package/dist/plugins/scim/filter.js +1 -1
- package/dist/plugins/scim/groups.js +1 -1
- package/dist/plugins/scim/mapping.js +1 -1
- package/dist/plugins/scim/patch.js +1 -1
- package/dist/plugins/scim/scim.js +1 -1
- package/dist/plugins/scim/scim.options.js +1 -0
- package/dist/plugins/scim/users.js +1 -1
- package/dist/plugins/static.js +1 -1
- package/dist/plugins/static.options.js +1 -0
- package/dist/plugins/storage/file.js +1 -1
- package/dist/plugins/storage/ldap.js +1 -1
- package/dist/plugins/storage/postgres.js +1 -1
- package/dist/plugins/storage/valkey.js +1 -1
- package/dist/plugins/storage.js +1 -1
- package/dist/plugins/storage.options.js +1 -0
- package/dist/plugins/twake/appAccounts.options.js +1 -0
- package/dist/plugins/twake/appAccountsApi.js +1 -1
- package/dist/plugins/twake/appAccountsConsistency.js +1 -1
- package/dist/plugins/twake/calendar.js +1 -1
- package/dist/plugins/twake/calendar.options.js +1 -0
- package/dist/plugins/twake/calendarResources.js +1 -1
- package/dist/plugins/twake/cloudery.options.js +1 -0
- package/dist/plugins/twake/clouderyProvision.js +1 -1
- package/dist/plugins/twake/cozy.options.js +1 -0
- package/dist/plugins/twake/cozyProvision.js +1 -1
- package/dist/plugins/twake/drive.js +1 -1
- package/dist/plugins/twake/drive.options.js +1 -0
- package/dist/plugins/twake/groups.js +1 -1
- package/dist/plugins/twake/instances.js +1 -1
- package/dist/plugins/twake/james.js +1 -1
- package/dist/plugins/twake/james.options.js +1 -0
- package/dist/plugins/twake/lifecycleAttributes.js +1 -1
- package/dist/plugins/twake/lifecycleEvents.js +1 -1
- package/dist/plugins/twake/migrationProxy.js +1 -1
- package/dist/plugins/twake/migrationProxy.options.js +1 -0
- package/dist/plugins/twake/spaces.js +1 -1
- package/dist/plugins/twake/tombstone.js +1 -1
- package/dist/plugins/twake/twakeGroups.options.js +1 -0
- package/dist/plugins/twake/twakeInstances.options.js +1 -0
- package/dist/plugins/twake/twakeLifecycle.options.js +1 -0
- package/dist/plugins/twake/twakeSpaces.options.js +1 -0
- package/dist/plugins/twake/twakeTombstone.options.js +1 -0
- package/dist/plugins/weblogs.js +1 -1
- package/dist/src/abstract/ldapFlat.d.ts +28 -10
- package/dist/src/abstract/plugin.d.ts +10 -5
- package/dist/src/abstract/twakePlugin.d.ts +14 -4
- package/dist/src/bin/index.d.ts +17 -4
- package/dist/src/config/args.d.ts +2 -4
- package/dist/src/config/options.d.ts +89 -0
- package/dist/src/config/schema.d.ts +50 -1
- package/dist/src/hooks.d.ts +60 -22
- package/dist/src/lib/authz/base.d.ts +4 -51
- package/dist/src/lib/authz/composition.d.ts +2 -2
- package/dist/src/lib/entitySchema/validator.d.ts +63 -6
- package/dist/src/lib/errors.d.ts +56 -1
- package/dist/src/lib/expressFormatedResponses.d.ts +49 -7
- package/dist/src/lib/hookBus.d.ts +226 -0
- package/dist/src/lib/instanceProviders.d.ts +0 -8
- package/dist/src/lib/ldapActions.d.ts +7 -0
- package/dist/src/lib/parseConfig.d.ts +5 -0
- package/dist/src/lib/route.d.ts +99 -0
- package/dist/src/lib/utils.d.ts +31 -36
- package/dist/src/lib/version.d.ts +12 -0
- package/dist/src/plugins/auth/auth.options.d.ts +88 -0
- package/dist/src/plugins/auth/authzDynamic.d.ts +10 -1
- package/dist/src/plugins/auth/authzLinid1.d.ts +6 -0
- package/dist/src/plugins/auth/authzPerBranch.d.ts +9 -0
- package/dist/src/plugins/auth/authzPerRoute.d.ts +3 -0
- package/dist/src/plugins/auth/authzScope.d.ts +23 -14
- package/dist/src/plugins/auth/crowdsec.d.ts +5 -0
- package/dist/src/plugins/auth/fake.d.ts +3 -0
- package/dist/src/plugins/auth/hmac.d.ts +4 -0
- package/dist/src/plugins/auth/llng.d.ts +4 -0
- package/dist/src/plugins/auth/openidconnect.d.ts +7 -0
- package/dist/src/plugins/auth/rateLimit.d.ts +4 -0
- package/dist/src/plugins/auth/token.d.ts +3 -0
- package/dist/src/plugins/auth/totp.d.ts +5 -0
- package/dist/src/plugins/auth/trustedProxy.d.ts +4 -0
- package/dist/src/plugins/bcl.d.ts +3 -0
- package/dist/src/plugins/bcl.options.d.ts +8 -0
- package/dist/src/plugins/configApi.d.ts +24 -5
- package/dist/src/plugins/demo/helloworld.d.ts +8 -19
- package/dist/src/plugins/ldap/accountLifecycle.d.ts +17 -0
- package/dist/src/plugins/ldap/bulkImport.d.ts +6 -76
- package/dist/src/plugins/ldap/departmentSync.d.ts +1 -0
- package/dist/src/plugins/ldap/enterpriseRules.d.ts +8 -1
- package/dist/src/plugins/ldap/externalUsersInGroups.d.ts +4 -0
- package/dist/src/plugins/ldap/flatGeneric.d.ts +4 -0
- package/dist/src/plugins/ldap/groups.d.ts +27 -11
- package/dist/src/plugins/ldap/ldap.options.d.ts +75 -0
- package/dist/src/plugins/ldap/onChange.d.ts +10 -2
- package/dist/src/plugins/ldap/organizations.d.ts +16 -0
- package/dist/src/plugins/ldap/passwordPolicy.d.ts +32 -1
- package/dist/src/plugins/ldap/raw.d.ts +50 -19
- package/dist/src/plugins/ldap/trash.d.ts +6 -0
- package/dist/src/plugins/metrics.d.ts +3 -0
- package/dist/src/plugins/metrics.options.d.ts +8 -0
- package/dist/src/plugins/rabbitmq.d.ts +3 -0
- package/dist/src/plugins/rabbitmq.options.d.ts +8 -0
- package/dist/src/plugins/scim/baseResolver.d.ts +2 -1
- package/dist/src/plugins/scim/bulk.d.ts +6 -7
- package/dist/src/plugins/scim/discovery.d.ts +3 -0
- package/dist/src/plugins/scim/errors.d.ts +2 -1
- package/dist/src/plugins/scim/groups.d.ts +6 -4
- package/dist/src/plugins/scim/scim.d.ts +37 -3
- package/dist/src/plugins/scim/scim.options.d.ts +35 -0
- package/dist/src/plugins/scim/users.d.ts +6 -7
- package/dist/src/plugins/static.d.ts +9 -0
- package/dist/src/plugins/static.options.d.ts +13 -0
- package/dist/src/plugins/storage.d.ts +12 -1
- package/dist/src/plugins/storage.options.d.ts +16 -0
- package/dist/src/plugins/twake/appAccounts.options.d.ts +13 -0
- package/dist/src/plugins/twake/appAccountsApi.d.ts +18 -0
- package/dist/src/plugins/twake/appAccountsConsistency.d.ts +8 -0
- package/dist/src/plugins/twake/calendar.d.ts +25 -2
- package/dist/src/plugins/twake/calendar.options.d.ts +19 -0
- package/dist/src/plugins/twake/cloudery.options.d.ts +26 -0
- package/dist/src/plugins/twake/clouderyProvision.d.ts +18 -0
- package/dist/src/plugins/twake/cozy.options.d.ts +23 -0
- package/dist/src/plugins/twake/cozyProvision.d.ts +14 -0
- package/dist/src/plugins/twake/drive.d.ts +7 -0
- package/dist/src/plugins/twake/drive.options.d.ts +15 -0
- package/dist/src/plugins/twake/groups.d.ts +29 -1
- package/dist/src/plugins/twake/instances.d.ts +43 -10
- package/dist/src/plugins/twake/james.d.ts +17 -0
- package/dist/src/plugins/twake/james.options.d.ts +21 -0
- package/dist/src/plugins/twake/lifecycleEvents.d.ts +12 -0
- package/dist/src/plugins/twake/migrationProxy.d.ts +11 -11
- package/dist/src/plugins/twake/migrationProxy.options.d.ts +16 -0
- package/dist/src/plugins/twake/spaces.d.ts +30 -0
- package/dist/src/plugins/twake/tombstone.d.ts +16 -14
- package/dist/src/plugins/twake/twakeGroups.options.d.ts +20 -0
- package/dist/src/plugins/twake/twakeInstances.options.d.ts +43 -0
- package/dist/src/plugins/twake/twakeLifecycle.options.d.ts +21 -0
- package/dist/src/plugins/twake/twakeSpaces.options.d.ts +19 -0
- package/dist/src/plugins/twake/twakeTombstone.options.d.ts +17 -0
- package/docs/README.md +1 -0
- package/docs/client-development/api/rest-api.md +9 -3
- package/docs/client-development/schemas/README.md +96 -32
- package/docs/plugin-development/README.md +45 -94
- package/docs/plugin-development/dependencies.md +11 -6
- package/docs/plugin-development/hooks.md +142 -23
- package/docs/plugin-development/openapi.md +14 -1
- package/docs/plugin-development/options.md +109 -0
- package/docs/plugin-development/routes.md +152 -0
- package/docs/plugin-development/testing.md +3 -3
- package/docs/usage/configuration.md +18 -11
- package/docs/usage/operations.md +19 -4
- package/docs/usage/plugins/ldap/enterprise-rules.md +10 -1
- package/docs/usage/plugins/ldap/flat-generic.md +4 -0
- package/docs/usage/plugins/ldap/raw.md +17 -1
- package/docs/usage/upgrading.md +194 -0
- package/package.json +358 -277
- package/static/browser/ldap-browser/LdapBrowser.js +8 -6
- package/static/browser/ldap-browser/LdapBrowser.js.map +1 -1
- package/static/browser/ldap-browser/api/RawApiClient.js +2 -0
- package/static/browser/ldap-browser/api/RawApiClient.js.map +1 -1
- package/static/browser/ldap-browser/components/EntryTree.js +9 -5
- package/static/browser/ldap-browser/components/EntryTree.js.map +1 -1
- package/static/browser/ldap-browser/components/EntryView.js +2 -0
- package/static/browser/ldap-browser/components/EntryView.js.map +1 -1
- package/static/browser/ldap-browser/schema.js +3 -2
- package/static/browser/ldap-browser/schema.js.map +1 -1
- package/static/browser/ldap-browser.esm.js +27 -18
- package/static/browser/ldap-browser.esm.js.map +1 -1
- package/static/browser/ldap-browser.js +27 -18
- package/static/browser/ldap-browser.js.map +1 -1
- package/static/browser/ldap-browser.min.js +1 -1
- package/static/browser/ldap-browser.min.js.map +1 -1
- package/static/browser/ldap-group-editor/LdapGroupEditor.js +8 -6
- package/static/browser/ldap-group-editor/LdapGroupEditor.js.map +1 -1
- package/static/browser/ldap-group-editor/api/GroupApiClient.js +1 -0
- package/static/browser/ldap-group-editor/api/GroupApiClient.js.map +1 -1
- package/static/browser/ldap-group-editor/components/CreateGroupModal.js +5 -1
- package/static/browser/ldap-group-editor/components/CreateGroupModal.js.map +1 -1
- package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js +6 -3
- package/static/browser/ldap-group-editor/components/GroupPropertyEditor.js.map +1 -1
- package/static/browser/ldap-group-editor/components/GroupTree.js +6 -3
- package/static/browser/ldap-group-editor/components/GroupTree.js.map +1 -1
- package/static/browser/ldap-group-editor/components/MoveGroupModal.js +6 -3
- package/static/browser/ldap-group-editor/components/MoveGroupModal.js.map +1 -1
- package/static/browser/ldap-group-editor.esm.js +32 -16
- package/static/browser/ldap-group-editor.esm.js.map +1 -1
- package/static/browser/ldap-group-editor.js +32 -16
- package/static/browser/ldap-group-editor.js.map +1 -1
- package/static/browser/ldap-group-editor.min.js +1 -1
- package/static/browser/ldap-group-editor.min.js.map +1 -1
- package/static/browser/ldap-resource-editor/api/ResourceApiClient.js +3 -0
- package/static/browser/ldap-resource-editor/api/ResourceApiClient.js.map +1 -1
- package/static/browser/ldap-resource-editor/cache/CacheManager.js +3 -1
- package/static/browser/ldap-resource-editor/cache/CacheManager.js.map +1 -1
- package/static/browser/ldap-tree-viewer/LdapTreeViewer.js +6 -1
- package/static/browser/ldap-tree-viewer/LdapTreeViewer.js.map +1 -1
- package/static/browser/ldap-tree-viewer/api/LdapApiClient.js +2 -0
- package/static/browser/ldap-tree-viewer/api/LdapApiClient.js.map +1 -1
- package/static/browser/ldap-tree-viewer/components/TreeNode.js +4 -0
- package/static/browser/ldap-tree-viewer/components/TreeNode.js.map +1 -1
- package/static/browser/ldap-tree-viewer/components/TreeRoot.js +3 -0
- package/static/browser/ldap-tree-viewer/components/TreeRoot.js.map +1 -1
- package/static/browser/ldap-tree-viewer/store/Store.js +3 -1
- package/static/browser/ldap-tree-viewer/store/Store.js.map +1 -1
- package/static/browser/ldap-tree-viewer.esm.js +18 -2
- package/static/browser/ldap-tree-viewer.esm.js.map +1 -1
- package/static/browser/ldap-tree-viewer.js +18 -2
- package/static/browser/ldap-tree-viewer.js.map +1 -1
- package/static/browser/ldap-tree-viewer.min.js +1 -1
- package/static/browser/ldap-tree-viewer.min.js.map +1 -1
- package/static/browser/ldap-unit-editor/LdapUnitEditor.js +7 -5
- package/static/browser/ldap-unit-editor/LdapUnitEditor.js.map +1 -1
- package/static/browser/ldap-unit-editor/api/UnitApiClient.js +1 -0
- package/static/browser/ldap-unit-editor/api/UnitApiClient.js.map +1 -1
- package/static/browser/ldap-unit-editor/components/MoveUnitModal.js +7 -4
- package/static/browser/ldap-unit-editor/components/MoveUnitModal.js.map +1 -1
- package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js +7 -4
- package/static/browser/ldap-unit-editor/components/UnitPropertyEditor.js.map +1 -1
- package/static/browser/ldap-unit-editor/components/UnitTree.js +6 -3
- package/static/browser/ldap-unit-editor/components/UnitTree.js.map +1 -1
- package/static/browser/ldap-unit-editor.esm.js +28 -16
- package/static/browser/ldap-unit-editor.esm.js.map +1 -1
- package/static/browser/ldap-unit-editor.js +28 -16
- package/static/browser/ldap-unit-editor.js.map +1 -1
- package/static/browser/ldap-unit-editor.min.js +1 -1
- package/static/browser/ldap-unit-editor.min.js.map +1 -1
- package/static/browser/ldap-user-editor/LdapUserEditor.js +9 -7
- package/static/browser/ldap-user-editor/LdapUserEditor.js.map +1 -1
- package/static/browser/ldap-user-editor/api/UserApiClient.js +2 -0
- package/static/browser/ldap-user-editor/api/UserApiClient.js.map +1 -1
- package/static/browser/ldap-user-editor/cache/CacheManager.js +3 -1
- package/static/browser/ldap-user-editor/cache/CacheManager.js.map +1 -1
- package/static/browser/ldap-user-editor/components/MoveUserModal.js +7 -4
- package/static/browser/ldap-user-editor/components/MoveUserModal.js.map +1 -1
- package/static/browser/ldap-user-editor/components/PointerField.js +6 -1
- package/static/browser/ldap-user-editor/components/PointerField.js.map +1 -1
- package/static/browser/ldap-user-editor/components/UserEditor.js +10 -5
- package/static/browser/ldap-user-editor/components/UserEditor.js.map +1 -1
- package/static/browser/ldap-user-editor/components/UserList.js +8 -4
- package/static/browser/ldap-user-editor/components/UserList.js.map +1 -1
- package/static/browser/ldap-user-editor/components/UserTree.js +7 -3
- package/static/browser/ldap-user-editor/components/UserTree.js.map +1 -1
- package/static/browser/ldap-user-editor.esm.js +55 -30
- package/static/browser/ldap-user-editor.esm.js.map +1 -1
- package/static/browser/ldap-user-editor.js +55 -30
- package/static/browser/ldap-user-editor.js.map +1 -1
- package/static/browser/ldap-user-editor.min.js +1 -1
- package/static/browser/ldap-user-editor.min.js.map +1 -1
- package/static/browser/shared/components/DisposableComponent.js +3 -5
- package/static/browser/shared/components/DisposableComponent.js.map +1 -1
- package/static/browser/shared/components/Modal.js +2 -1
- package/static/browser/shared/components/Modal.js.map +1 -1
- package/static/browser/shared/components/StatusMessage.js +3 -2
- package/static/browser/shared/components/StatusMessage.js.map +1 -1
- package/static/browser/shared/utils/form.js.map +1 -1
- package/static/browser/shared/utils/hmac.js +1 -0
- package/static/browser/shared/utils/hmac.js.map +1 -1
- package/static/browser/shared/utils/totp.js +1 -0
- package/static/browser/shared/utils/totp.js.map +1 -1
- package/static/browser/shared.esm.js +9 -8
- package/static/browser/shared.esm.js.map +1 -1
- package/static/browser/shared.js +9 -8
- package/static/browser/shared.js.map +1 -1
- package/static/browser/shared.min.js +1 -1
- package/static/browser/shared.min.js.map +1 -1
- package/static/schemas/ad/groups.json +1 -1
- package/static/schemas/ad/users.json +3 -3
- package/static/schemas/example/organizations.json +2 -2
- package/static/schemas/example/users.json +2 -2
- package/static/schemas/obm/users.json +2 -2
- package/static/schemas/standard/groups.json +1 -1
- package/static/schemas/standard/users.json +2 -2
- package/static/schemas/twake/groups.json +4 -4
- package/static/schemas/twake/teamMailboxes.json +3 -3
- package/static/schemas/twake/users.json +7 -7
|
@@ -89,7 +89,8 @@ export interface ReferenceRewriteReport {
|
|
|
89
89
|
*
|
|
90
90
|
* @param raw value as submitted
|
|
91
91
|
* @returns the size in bytes
|
|
92
|
-
* @throws BadRequestError when the value is not a size
|
|
92
|
+
* @throws BadRequestError when the value is not a size, or when its number of
|
|
93
|
+
* bytes is one a `Number` cannot hold exactly
|
|
93
94
|
*/
|
|
94
95
|
export declare function parseByteSize(raw: AttributeValue): number;
|
|
95
96
|
/**
|
|
@@ -147,12 +148,18 @@ export declare function startOfUtcDay(now?: Date): number;
|
|
|
147
148
|
*/
|
|
148
149
|
export declare function mailInDomains(mail: string, domains: string[], allowSubdomains?: boolean): boolean;
|
|
149
150
|
export default class LdapEnterpriseRules extends DmPlugin {
|
|
151
|
+
static optionDefinitions: {
|
|
152
|
+
enterprise_domain_name_attribute: import("../../config/options").StringOption;
|
|
153
|
+
enterprise_domain_link_attribute: import("../../config/options").StringOption;
|
|
154
|
+
};
|
|
150
155
|
name: string;
|
|
151
156
|
roles: Role[];
|
|
152
157
|
/** Placeholder member some directories keep to satisfy `groupOfNames` */
|
|
153
158
|
private dummyMember?;
|
|
154
159
|
/** Root of the organization tree */
|
|
155
160
|
private topOrganization?;
|
|
161
|
+
private readonly enterpriseSettings;
|
|
162
|
+
private readonly orgSettings;
|
|
156
163
|
constructor(server: DM);
|
|
157
164
|
/**
|
|
158
165
|
* Tell whether this plugin fills a given generated attribute.
|
|
@@ -16,6 +16,10 @@ import ldapActions from '../../lib/ldapActions';
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const mailDomainOf: (mail: string) => string;
|
|
18
18
|
export default class ExternalUsersInGroups extends DmPlugin {
|
|
19
|
+
static optionDefinitions: {
|
|
20
|
+
external_members_branch: import("../../config/options").StringOption;
|
|
21
|
+
external_branch_class: import("../../config/options").ArrayOption;
|
|
22
|
+
};
|
|
19
23
|
name: string;
|
|
20
24
|
roles: Role[];
|
|
21
25
|
dependencies: {
|
|
@@ -50,6 +50,10 @@ declare class LdapFlatInstance extends LdapFlat {
|
|
|
50
50
|
constructor(server: DM, config: ConstructorParameters<typeof LdapFlat>[1]);
|
|
51
51
|
}
|
|
52
52
|
export default class LdapFlatGeneric extends DmPlugin {
|
|
53
|
+
static optionDefinitions: {
|
|
54
|
+
ldap_flat_schema: import("../../config/options").ArrayOption;
|
|
55
|
+
ldap_flat_auto_repair: import("../../config/options").BooleanOption;
|
|
56
|
+
};
|
|
53
57
|
name: string;
|
|
54
58
|
roles: Role[];
|
|
55
59
|
instances: LdapFlatInstance[];
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module plugins/ldap/groups
|
|
3
|
-
* @author Xavier Guimard <xguimard@linagora.com>
|
|
4
|
-
*
|
|
5
|
-
* Plugin to manage groups into LDAP server
|
|
6
|
-
* - add/delete groups
|
|
7
|
-
* - add/delete members of groups
|
|
8
|
-
* - detect user deletion to remove them from groups (hook)
|
|
9
|
-
*/
|
|
10
1
|
import type { Express, Request, Response } from 'express';
|
|
11
2
|
import DmPlugin, { type Role } from '../../abstract/plugin';
|
|
12
3
|
import type { DM } from '../../bin';
|
|
4
|
+
import type { OptionSet } from '../../config/options';
|
|
13
5
|
import type { Hooks } from '../../hooks';
|
|
14
6
|
import type ldapActions from '../../lib/ldapActions';
|
|
15
7
|
import type { AttributesList, AttributeValue, LdapList, ModifyRequest } from '../../lib/ldapActions';
|
|
@@ -111,13 +103,37 @@ export type postModify = ModifyRequest;
|
|
|
111
103
|
* attribute: attribute
|
|
112
104
|
* value: value
|
|
113
105
|
*/
|
|
106
|
+
export declare const GroupsQuery: import("@sinclair/typebox").TObject<{
|
|
107
|
+
match: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
108
|
+
attribute: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
109
|
+
attributes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const GroupParams: import("@sinclair/typebox").TObject<{
|
|
112
|
+
cn: import("@sinclair/typebox").TString;
|
|
113
|
+
}>;
|
|
114
|
+
export declare const GroupMemberParams: import("@sinclair/typebox").TObject<{
|
|
115
|
+
cn: import("@sinclair/typebox").TString;
|
|
116
|
+
member: import("@sinclair/typebox").TString;
|
|
117
|
+
}>;
|
|
118
|
+
export declare const GroupMembersBody: import("@sinclair/typebox").TObject<{
|
|
119
|
+
member: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>]>;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const GroupMoveBody: import("@sinclair/typebox").TObject<{
|
|
122
|
+
targetOrgDn: import("@sinclair/typebox").TString;
|
|
123
|
+
}>;
|
|
124
|
+
export declare const GroupRenameBody: import("@sinclair/typebox").TObject<{
|
|
125
|
+
newCn: import("@sinclair/typebox").TString;
|
|
126
|
+
}>;
|
|
114
127
|
export default class LdapGroups extends DmPlugin {
|
|
128
|
+
static optionDefinitions: OptionSet;
|
|
115
129
|
name: string;
|
|
116
130
|
roles: Role[];
|
|
117
131
|
base?: string;
|
|
118
132
|
ldap: ldapActions;
|
|
119
133
|
cn: string;
|
|
120
134
|
schema?: Schema;
|
|
135
|
+
private get groupSettings();
|
|
136
|
+
private get orgSettings();
|
|
121
137
|
constructor(server: DM);
|
|
122
138
|
/**
|
|
123
139
|
* The loaded group schema, before it is used: a subclass declares there
|
|
@@ -146,7 +162,7 @@ export default class LdapGroups extends DmPlugin {
|
|
|
146
162
|
* @param member DN of a member
|
|
147
163
|
* @returns true for the placeholder
|
|
148
164
|
*/
|
|
149
|
-
isDummyMember(member: string): boolean;
|
|
165
|
+
isDummyMember(member: string, placeholder?: string): boolean;
|
|
150
166
|
/**
|
|
151
167
|
* An entry with the placeholder taken out of its members. It is there for
|
|
152
168
|
* the directory's schema, not for anyone reading the group: listed, it
|
|
@@ -298,7 +314,7 @@ export default class LdapGroups extends DmPlugin {
|
|
|
298
314
|
* With `req`, each member is looked up as the caller sees the directory:
|
|
299
315
|
* an entry an authorization plugin hides from them is refused as one that
|
|
300
316
|
* does not exist, so that an administrator cannot put an account of
|
|
301
|
-
* another branch in a group of theirs. `--
|
|
317
|
+
* another branch in a group of theirs. `--groups-allow-unexistent-members`
|
|
302
318
|
* still accepts a member that does not exist, but not one that does and
|
|
303
319
|
* is hidden — which tells the caller it exists, a smaller leak than the
|
|
304
320
|
* membership it would otherwise grant.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Config } from '../../config/args';
|
|
2
|
+
import type { AttributesList } from '../../lib/ldapActions';
|
|
3
|
+
import { type OptionsOf } from '../../config/options';
|
|
4
|
+
export declare const organizationOptions: {
|
|
5
|
+
ldap_top_organization: import("../../config/options").StringOption;
|
|
6
|
+
ldap_organization_class: import("../../config/options").ArrayOption;
|
|
7
|
+
ldap_organization_link_attribute: import("../../config/options").StringOption;
|
|
8
|
+
ldap_organization_path_attribute: import("../../config/options").StringOption;
|
|
9
|
+
ldap_organization_path_separator: import("../../config/options").StringOption;
|
|
10
|
+
ldap_organization_max_subnodes: import("../../config/options").NumberOption;
|
|
11
|
+
organization_schema: import("../../config/options").StringOption;
|
|
12
|
+
};
|
|
13
|
+
export type OrganizationOptions = OptionsOf<typeof organizationOptions>;
|
|
14
|
+
export declare const enterpriseRulesOptions: {
|
|
15
|
+
enterprise_domain_name_attribute: import("../../config/options").StringOption;
|
|
16
|
+
enterprise_domain_link_attribute: import("../../config/options").StringOption;
|
|
17
|
+
};
|
|
18
|
+
export type EnterpriseRulesOptions = OptionsOf<typeof enterpriseRulesOptions>;
|
|
19
|
+
export declare const groupsOptions: {
|
|
20
|
+
ldap_group_base: import("../../config/options").StringOption;
|
|
21
|
+
ldap_groups_main_attribute: import("../../config/options").StringOption;
|
|
22
|
+
group_class: import("../../config/options").ArrayOption;
|
|
23
|
+
groups_allow_unexistent_members: import("../../config/options").BooleanOption;
|
|
24
|
+
group_default_attributes: import("../../config/options").JsonOption<AttributesList>;
|
|
25
|
+
group_dummy_user: import("../../config/options").StringOption;
|
|
26
|
+
group_schema: import("../../config/options").StringOption;
|
|
27
|
+
};
|
|
28
|
+
export type GroupsOptions = OptionsOf<typeof groupsOptions>;
|
|
29
|
+
export declare const externalUsersOptions: {
|
|
30
|
+
external_members_branch: import("../../config/options").StringOption;
|
|
31
|
+
external_branch_class: import("../../config/options").ArrayOption;
|
|
32
|
+
};
|
|
33
|
+
export type ExternalUsersOptions = OptionsOf<typeof externalUsersOptions>;
|
|
34
|
+
export declare const flatGenericOptions: {
|
|
35
|
+
ldap_flat_schema: import("../../config/options").ArrayOption;
|
|
36
|
+
ldap_flat_auto_repair: import("../../config/options").BooleanOption;
|
|
37
|
+
};
|
|
38
|
+
export type FlatGenericOptions = OptionsOf<typeof flatGenericOptions>;
|
|
39
|
+
export declare const rawOptions: {
|
|
40
|
+
ldap_raw_base: import("../../config/options").ArrayOption;
|
|
41
|
+
ldap_raw_hidden_attribute: import("../../config/options").ArrayOption;
|
|
42
|
+
ldap_raw_show_secrets: import("../../config/options").BooleanOption;
|
|
43
|
+
ldap_raw_max_results: import("../../config/options").NumberOption;
|
|
44
|
+
ldap_raw_schema_cache_ttl: import("../../config/options").NumberOption;
|
|
45
|
+
};
|
|
46
|
+
export type RawOptions = OptionsOf<typeof rawOptions>;
|
|
47
|
+
export declare const bulkImportOptions: {
|
|
48
|
+
bulk_import_schemas: import("../../config/options").StringOption;
|
|
49
|
+
bulk_import_max_file_size: import("../../config/options").StringOption;
|
|
50
|
+
bulk_import_batch_size: import("../../config/options").StringOption;
|
|
51
|
+
};
|
|
52
|
+
export type BulkImportOptions = OptionsOf<typeof bulkImportOptions>;
|
|
53
|
+
export declare const trashOptions: {
|
|
54
|
+
trash_base: import("../../config/options").StringOption;
|
|
55
|
+
trash_watched_bases: import("../../config/options").StringOption;
|
|
56
|
+
trash_add_metadata: import("../../config/options").StringOption;
|
|
57
|
+
trash_auto_create: import("../../config/options").StringOption;
|
|
58
|
+
};
|
|
59
|
+
export type TrashOptions = OptionsOf<typeof trashOptions>;
|
|
60
|
+
export declare const passwordPolicyOptions: {
|
|
61
|
+
ppolicy_default_dn: import("../../config/options").StringOption;
|
|
62
|
+
ppolicy_base: import("../../config/options").StringOption;
|
|
63
|
+
ppolicy_warn_days: import("../../config/options").NumberOption;
|
|
64
|
+
ppolicy_validate_complexity: import("../../config/options").BooleanOption;
|
|
65
|
+
ppolicy_min_length: import("../../config/options").NumberOption;
|
|
66
|
+
ppolicy_require_uppercase: import("../../config/options").BooleanOption;
|
|
67
|
+
ppolicy_require_lowercase: import("../../config/options").BooleanOption;
|
|
68
|
+
ppolicy_require_digit: import("../../config/options").BooleanOption;
|
|
69
|
+
ppolicy_require_special: import("../../config/options").BooleanOption;
|
|
70
|
+
ldap_users_base: import("../../config/options").StringOption;
|
|
71
|
+
};
|
|
72
|
+
export type PasswordPolicyOptions = OptionsOf<typeof passwordPolicyOptions>;
|
|
73
|
+
export declare function organizationOptionsOf(config: Config): OrganizationOptions;
|
|
74
|
+
export declare function groupsOptionsOf(config: Config): GroupsOptions;
|
|
75
|
+
export declare function trashOptionsOf(config: Config): TrashOptions;
|
|
@@ -20,6 +20,14 @@ export type ChangesToNotify = Record<string, [
|
|
|
20
20
|
* and so are two orderings of the same values.
|
|
21
21
|
*/
|
|
22
22
|
export declare function diffEntries(before: Entry | null, after: Entry | null): ChangesToNotify;
|
|
23
|
+
declare const events: {
|
|
24
|
+
readonly mail_attribute: "onLdapMailChange";
|
|
25
|
+
readonly quota_attribute: "onLdapQuotaChange";
|
|
26
|
+
readonly alias_attribute: "onLdapAliasChange";
|
|
27
|
+
readonly forward_attribute: "onLdapForwardChange";
|
|
28
|
+
readonly drive_quota_attribute: "onLdapDriveQuotaChange";
|
|
29
|
+
};
|
|
30
|
+
type AttributeHook = (typeof events)[keyof typeof events];
|
|
23
31
|
declare class OnLdapChange extends DmPlugin {
|
|
24
32
|
name: string;
|
|
25
33
|
roles: Role[];
|
|
@@ -33,8 +41,8 @@ declare class OnLdapChange extends DmPlugin {
|
|
|
33
41
|
read(dn: string): Promise<Entry | undefined>;
|
|
34
42
|
publish(dn: string, before: Entry | null, after: Entry | null, context?: ChangeContext): void;
|
|
35
43
|
notify(dn: string, changes: ChangesToNotify, before: Entry | null, after: Entry | null): void;
|
|
36
|
-
notifyAttributeChange(attribute: string, hookName:
|
|
37
|
-
notifyAttributeChangeWithMail(attribute: string, hookName:
|
|
44
|
+
notifyAttributeChange(attribute: string, hookName: AttributeHook, dn: string, changes: ChangesToNotify, stringOnly?: boolean): void;
|
|
45
|
+
notifyAttributeChangeWithMail(attribute: string, hookName: AttributeHook, dn: string, changes: ChangesToNotify, after: Entry | null): void;
|
|
38
46
|
/**
|
|
39
47
|
* The name the James plugin gives an identity, in the same order: the
|
|
40
48
|
* display name attribute, then cn, then givenName + sn
|
|
@@ -94,9 +94,25 @@ import type { Schema } from '../../config/schema';
|
|
|
94
94
|
* example:
|
|
95
95
|
* description: Updated description for Marketing
|
|
96
96
|
*/
|
|
97
|
+
export declare const OrganizationParams: import("@sinclair/typebox").TObject<{
|
|
98
|
+
dn: import("@sinclair/typebox").TString;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const OrganizationSearchQuery: import("@sinclair/typebox").TObject<{
|
|
101
|
+
q: import("@sinclair/typebox").TString;
|
|
102
|
+
}>;
|
|
97
103
|
export default class LdapOrganizations extends DmPlugin {
|
|
104
|
+
static optionDefinitions: {
|
|
105
|
+
ldap_top_organization: import("../../config/options").StringOption;
|
|
106
|
+
ldap_organization_class: import("../../config/options").ArrayOption;
|
|
107
|
+
ldap_organization_link_attribute: import("../../config/options").StringOption;
|
|
108
|
+
ldap_organization_path_attribute: import("../../config/options").StringOption;
|
|
109
|
+
ldap_organization_path_separator: import("../../config/options").StringOption;
|
|
110
|
+
ldap_organization_max_subnodes: import("../../config/options").NumberOption;
|
|
111
|
+
organization_schema: import("../../config/options").StringOption;
|
|
112
|
+
};
|
|
98
113
|
name: string;
|
|
99
114
|
roles: Role[];
|
|
115
|
+
private readonly settings;
|
|
100
116
|
pathAttr: string;
|
|
101
117
|
linkAttr: string;
|
|
102
118
|
schema?: Schema;
|
|
@@ -232,7 +232,38 @@ import DmPlugin, { type Role } from '../../abstract/plugin';
|
|
|
232
232
|
* description: List of failed rule descriptions (empty when valid).
|
|
233
233
|
* example: []
|
|
234
234
|
*/
|
|
235
|
+
export declare const PolicyParams: import("@sinclair/typebox").TObject<{
|
|
236
|
+
cn: import("@sinclair/typebox").TString;
|
|
237
|
+
}>;
|
|
238
|
+
export declare const PolicyUserParams: import("@sinclair/typebox").TObject<{
|
|
239
|
+
id: import("@sinclair/typebox").TString;
|
|
240
|
+
}>;
|
|
241
|
+
export declare const ExpiringQuery: import("@sinclair/typebox").TObject<{
|
|
242
|
+
days: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
243
|
+
}>;
|
|
244
|
+
export declare const AssignPolicyBody: import("@sinclair/typebox").TObject<{
|
|
245
|
+
policy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
246
|
+
}>;
|
|
247
|
+
export declare const UnlockResponse: import("@sinclair/typebox").TObject<{
|
|
248
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
249
|
+
message: import("@sinclair/typebox").TString;
|
|
250
|
+
}>;
|
|
251
|
+
export declare const ValidatePasswordBody: import("@sinclair/typebox").TObject<{
|
|
252
|
+
password: import("@sinclair/typebox").TString;
|
|
253
|
+
}>;
|
|
235
254
|
export default class PasswordPolicy extends DmPlugin {
|
|
255
|
+
static optionDefinitions: {
|
|
256
|
+
ppolicy_default_dn: import("../../config/options").StringOption;
|
|
257
|
+
ppolicy_base: import("../../config/options").StringOption;
|
|
258
|
+
ppolicy_warn_days: import("../../config/options").NumberOption;
|
|
259
|
+
ppolicy_validate_complexity: import("../../config/options").BooleanOption;
|
|
260
|
+
ppolicy_min_length: import("../../config/options").NumberOption;
|
|
261
|
+
ppolicy_require_uppercase: import("../../config/options").BooleanOption;
|
|
262
|
+
ppolicy_require_lowercase: import("../../config/options").BooleanOption;
|
|
263
|
+
ppolicy_require_digit: import("../../config/options").BooleanOption;
|
|
264
|
+
ppolicy_require_special: import("../../config/options").BooleanOption;
|
|
265
|
+
ldap_users_base: import("../../config/options").StringOption;
|
|
266
|
+
};
|
|
236
267
|
name: string;
|
|
237
268
|
roles: Role[];
|
|
238
269
|
private policyCache;
|
|
@@ -241,6 +272,7 @@ export default class PasswordPolicy extends DmPlugin {
|
|
|
241
272
|
private warnedMissingBase;
|
|
242
273
|
private warnedUnreadableSchema;
|
|
243
274
|
private readonly POLICY_CACHE_TTL;
|
|
275
|
+
private get settings();
|
|
244
276
|
api(app: Express): void;
|
|
245
277
|
/**
|
|
246
278
|
* Get password status for a user
|
|
@@ -320,7 +352,6 @@ export default class PasswordPolicy extends DmPlugin {
|
|
|
320
352
|
private updatePolicy;
|
|
321
353
|
private deletePolicy;
|
|
322
354
|
private assignPolicy;
|
|
323
|
-
private param;
|
|
324
355
|
/**
|
|
325
356
|
* Parse GeneralizedTime (YYYYMMDDHHmmssZ) to Date
|
|
326
357
|
*/
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module plugins/ldap/raw
|
|
3
|
-
* @author Xavier Guimard <xguimard@linagora.com>
|
|
4
|
-
*
|
|
5
|
-
* Low-level LDAP browsing API (read-only).
|
|
6
|
-
*
|
|
7
|
-
* Where the other plugins expose business objects (users, groups,
|
|
8
|
-
* organizations), this one exposes the directory itself: the root DSE, the
|
|
9
|
-
* schema, and entries addressed by their DN. It is the server side of a
|
|
10
|
-
* phpLDAPadmin-like interface.
|
|
11
|
-
*
|
|
12
|
-
* Every directory access goes through `server.ldap`, so the authorization,
|
|
13
|
-
* trash and logging hooks apply exactly as they do for the high-level APIs.
|
|
14
|
-
* Root DSE and schema are directory metadata rather than user data and are
|
|
15
|
-
* read with the service account, so that a UI can render attribute names and
|
|
16
|
-
* types even when the caller is restricted to a branch.
|
|
17
|
-
*/
|
|
18
1
|
import type { Express, Request } from 'express';
|
|
19
2
|
import DmPlugin, { type Role } from '../../abstract/plugin';
|
|
20
3
|
import type { DM } from '../../bin';
|
|
@@ -103,13 +86,45 @@ export interface RawSearchResult {
|
|
|
103
86
|
}
|
|
104
87
|
declare const VALID_SCOPES: readonly ["base", "one", "sub"];
|
|
105
88
|
type Scope = (typeof VALID_SCOPES)[number];
|
|
89
|
+
export declare const RawSearchQuery: import("@sinclair/typebox").TObject<{
|
|
90
|
+
base: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
91
|
+
scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
92
|
+
filter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
93
|
+
attributes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
94
|
+
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
95
|
+
}>;
|
|
96
|
+
export declare const RawDnParams: import("@sinclair/typebox").TObject<{
|
|
97
|
+
dn: import("@sinclair/typebox").TString;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const RawChildrenQuery: import("@sinclair/typebox").TObject<{
|
|
100
|
+
children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
101
|
+
}>;
|
|
106
102
|
export default class LdapRaw extends DmPlugin {
|
|
103
|
+
static optionDefinitions: {
|
|
104
|
+
ldap_raw_base: import("../../config/options").ArrayOption;
|
|
105
|
+
ldap_raw_hidden_attribute: import("../../config/options").ArrayOption;
|
|
106
|
+
ldap_raw_show_secrets: import("../../config/options").BooleanOption;
|
|
107
|
+
ldap_raw_max_results: import("../../config/options").NumberOption;
|
|
108
|
+
ldap_raw_schema_cache_ttl: import("../../config/options").NumberOption;
|
|
109
|
+
};
|
|
107
110
|
name: string;
|
|
108
111
|
roles: Role[];
|
|
109
112
|
/** Subtrees the API is allowed to expose */
|
|
110
113
|
bases: string[];
|
|
111
114
|
/** Attributes never returned, whatever the request (lowercase) */
|
|
112
115
|
hiddenAttributes: Set<string>;
|
|
116
|
+
/**
|
|
117
|
+
* The hidden attributes resolved to their directory types: OID and every
|
|
118
|
+
* name the schema gives them, once it has been read. Undefined until then,
|
|
119
|
+
* when only the configured names are compared.
|
|
120
|
+
*/
|
|
121
|
+
private hiddenTypeNames?;
|
|
122
|
+
/**
|
|
123
|
+
* The hidden types plus their supertypes, which a filter assertion also
|
|
124
|
+
* tests (RFC 4511 §4.5.1.7.1). A result still answers under the subtype's
|
|
125
|
+
* own name, so only the filter check reads this set.
|
|
126
|
+
*/
|
|
127
|
+
private hiddenFilterNames?;
|
|
113
128
|
/** True when credential attributes are served instead of being hidden */
|
|
114
129
|
showSecrets: boolean;
|
|
115
130
|
/** Maximum entries returned by a search or a children listing */
|
|
@@ -124,16 +139,32 @@ export default class LdapRaw extends DmPlugin {
|
|
|
124
139
|
* @throws ForbiddenError when the DN is outside every configured base
|
|
125
140
|
*/
|
|
126
141
|
checkDn(dn: string): void;
|
|
142
|
+
/**
|
|
143
|
+
* Resolve the hidden attribute names to the directory's attribute types: a
|
|
144
|
+
* type answers under its OID and under each of its names, so comparing the
|
|
145
|
+
* configured spelling alone would let an alias or an OID through.
|
|
146
|
+
*
|
|
147
|
+
* @returns the names to compare, configured spellings included
|
|
148
|
+
*/
|
|
149
|
+
private hiddenNames;
|
|
150
|
+
/** Whether an attribute description names one of the hidden types */
|
|
151
|
+
private isHidden;
|
|
127
152
|
/**
|
|
128
153
|
* Reject a malformed LDAP filter before it reaches the directory. Parsing
|
|
129
154
|
* it here turns what would surface as an opaque server error into a 400
|
|
130
155
|
* naming the offending expression — a search box hands us whatever the
|
|
131
156
|
* user typed, and `gov` is a filter typo, not a server fault.
|
|
132
157
|
*
|
|
158
|
+
* The filter is also the way a client could ask whether a hidden value
|
|
159
|
+
* matches without it being served, since the search runs with the service
|
|
160
|
+
* account's rights: an assertion on a hidden type is refused.
|
|
161
|
+
*
|
|
133
162
|
* @param filter filter to validate
|
|
134
|
-
* @
|
|
163
|
+
* @param hidden hidden types, the configured names when not resolved yet
|
|
164
|
+
* @throws BadRequestError when the filter cannot be parsed or tests a
|
|
165
|
+
* hidden attribute
|
|
135
166
|
*/
|
|
136
|
-
checkFilter(filter: string): void;
|
|
167
|
+
checkFilter(filter: string, hidden: ReadonlySet<string>): void;
|
|
137
168
|
/**
|
|
138
169
|
* Convert an ldapts entry into its JSON representation: values are always
|
|
139
170
|
* arrays and hidden attributes are dropped.
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
import DmPlugin, { type Role } from '../../abstract/plugin';
|
|
15
15
|
import type { Hooks } from '../../hooks';
|
|
16
16
|
declare class TrashPlugin extends DmPlugin {
|
|
17
|
+
static optionDefinitions: {
|
|
18
|
+
trash_base: import("../../config/options").StringOption;
|
|
19
|
+
trash_watched_bases: import("../../config/options").StringOption;
|
|
20
|
+
trash_add_metadata: import("../../config/options").StringOption;
|
|
21
|
+
trash_auto_create: import("../../config/options").StringOption;
|
|
22
|
+
};
|
|
17
23
|
name: string;
|
|
18
24
|
roles: Role[];
|
|
19
25
|
private watchedBases;
|
|
@@ -2,6 +2,9 @@ import type { Express } from 'express';
|
|
|
2
2
|
import DmPlugin from '../abstract/plugin';
|
|
3
3
|
import type { DM } from '../bin';
|
|
4
4
|
export default class Metrics extends DmPlugin {
|
|
5
|
+
static optionDefinitions: {
|
|
6
|
+
metrics_port: import("../config/options").NumberOption;
|
|
7
|
+
};
|
|
5
8
|
name: string;
|
|
6
9
|
/** The gauges read at scrape time and the process metrics */
|
|
7
10
|
private readonly own;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Metrics plugin options, see `docs/plugin-development/options.md`. */
|
|
2
|
+
import type { Config } from '../config/args';
|
|
3
|
+
import { type OptionsOf } from '../config/options';
|
|
4
|
+
export declare const metricsOptions: {
|
|
5
|
+
metrics_port: import("../config/options").NumberOption;
|
|
6
|
+
};
|
|
7
|
+
export type MetricsOptions = OptionsOf<typeof metricsOptions>;
|
|
8
|
+
export declare function metricsOptionsOf(config: Config): MetricsOptions;
|
|
@@ -61,6 +61,9 @@ interface RabbitClientOptions {
|
|
|
61
61
|
logger: ClientLogger;
|
|
62
62
|
}
|
|
63
63
|
export default class RabbitMq extends DmPlugin {
|
|
64
|
+
static optionDefinitions: {
|
|
65
|
+
rabbitmq_url: import("../config/options").StringOption;
|
|
66
|
+
};
|
|
64
67
|
name: string;
|
|
65
68
|
private readonly rabbitmqUrl;
|
|
66
69
|
private client;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** RabbitMQ plugin options, see `docs/plugin-development/options.md`. */
|
|
2
|
+
import type { Config } from '../config/args';
|
|
3
|
+
import { type OptionsOf } from '../config/options';
|
|
4
|
+
export declare const rabbitmqOptions: {
|
|
5
|
+
rabbitmq_url: import("../config/options").StringOption;
|
|
6
|
+
};
|
|
7
|
+
export type RabbitmqOptions = OptionsOf<typeof rabbitmqOptions>;
|
|
8
|
+
export declare function rabbitmqOptionsOf(config: Config): RabbitmqOptions;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Config } from '../../config/args';
|
|
2
2
|
import { type DmRequest } from '../../lib/auth/base';
|
|
3
|
+
import { type ScimOptions } from './scim.options';
|
|
3
4
|
export interface BaseMapEntry {
|
|
4
5
|
userBase?: string;
|
|
5
6
|
groupBase?: string;
|
|
@@ -16,7 +17,7 @@ export declare class BaseResolver {
|
|
|
16
17
|
private readonly headerRoot;
|
|
17
18
|
/** Kept so a base is keyed on whatever `--authz-identity` names. */
|
|
18
19
|
private readonly config;
|
|
19
|
-
constructor(config: Config);
|
|
20
|
+
constructor(config: Config, options?: ScimOptions);
|
|
20
21
|
private applyTemplate;
|
|
21
22
|
/** Read a request header by name, tolerating Express req or a plain object. */
|
|
22
23
|
private readHeader;
|
|
@@ -11,29 +11,28 @@
|
|
|
11
11
|
* dispatch).
|
|
12
12
|
*/
|
|
13
13
|
import type winston from 'winston';
|
|
14
|
-
import type { Config } from '../../config/args';
|
|
15
14
|
import type { DmRequest } from '../../lib/auth/base';
|
|
15
|
+
import type HookBus from '../../lib/hookBus';
|
|
16
16
|
import type { ScimUsers } from './users';
|
|
17
|
+
import type { ScimOptions } from './scim.options';
|
|
17
18
|
import type { ScimGroups } from './groups';
|
|
18
19
|
import { type BulkRequest, type BulkResponse } from './types';
|
|
19
20
|
import { writeScimErrorFromException } from './errors';
|
|
20
21
|
export interface ScimBulkOptions {
|
|
21
|
-
|
|
22
|
+
options: ScimOptions;
|
|
22
23
|
logger: winston.Logger;
|
|
23
24
|
users: ScimUsers;
|
|
24
25
|
groups: ScimGroups;
|
|
25
26
|
scimPrefix: string;
|
|
26
|
-
|
|
27
|
-
[K: string]: Function[] | undefined;
|
|
28
|
-
};
|
|
27
|
+
hookBus: HookBus;
|
|
29
28
|
}
|
|
30
29
|
export declare class ScimBulk {
|
|
31
|
-
private readonly
|
|
30
|
+
private readonly options;
|
|
32
31
|
private readonly logger;
|
|
33
32
|
private readonly users;
|
|
34
33
|
private readonly groups;
|
|
35
34
|
private readonly scimPrefix;
|
|
36
|
-
private readonly
|
|
35
|
+
private readonly hookBus;
|
|
37
36
|
constructor(opts: ScimBulkOptions);
|
|
38
37
|
execute(req: DmRequest, body: BulkRequest): Promise<BulkResponse>;
|
|
39
38
|
private executeOne;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Config } from '../../config/args';
|
|
2
2
|
import type { DmRequest } from '../../lib/auth/base';
|
|
3
|
+
import type { ScimOptions } from './scim.options';
|
|
3
4
|
import { type ResourceTypeDefinition, type ServiceProviderConfig, type SchemaDefinition } from './types';
|
|
4
5
|
export interface DiscoveryOptions {
|
|
5
6
|
config: Config;
|
|
7
|
+
options: ScimOptions;
|
|
6
8
|
schemaDir: string;
|
|
7
9
|
scimPrefix: string;
|
|
8
10
|
loadedPlugins: {
|
|
@@ -11,6 +13,7 @@ export interface DiscoveryOptions {
|
|
|
11
13
|
}
|
|
12
14
|
export declare class ScimDiscovery {
|
|
13
15
|
private readonly config;
|
|
16
|
+
private readonly options;
|
|
14
17
|
private readonly schemaDir;
|
|
15
18
|
private readonly scimPrefix;
|
|
16
19
|
private readonly loadedPlugins;
|
|
@@ -32,7 +32,8 @@ export declare function writeScimError(res: Response, status: number, detail: st
|
|
|
32
32
|
* Split out from `writeScimErrorFromException` so `/Bulk`, which reports a
|
|
33
33
|
* status per operation instead of writing a response, applies exactly the
|
|
34
34
|
* same translations — including the ones that matter: an authorization
|
|
35
|
-
* refusal is a 403
|
|
35
|
+
* refusal is a 403 saying `AUTHZ_REFUSED`, not a 500 quoting the branch it
|
|
36
|
+
* judged.
|
|
36
37
|
*/
|
|
37
38
|
export declare function scimErrorFromException(err: unknown, fallbackStatus?: number): ScimErrorResponse;
|
|
38
39
|
export declare function writeScimErrorFromException(res: Response, err: unknown, fallbackStatus?: number): void;
|
|
@@ -8,9 +8,11 @@ import type winston from 'winston';
|
|
|
8
8
|
import type ldapActions from '../../lib/ldapActions';
|
|
9
9
|
import type { Config } from '../../config/args';
|
|
10
10
|
import type { DmRequest } from '../../lib/auth/base';
|
|
11
|
+
import type HookBus from '../../lib/hookBus';
|
|
11
12
|
import { BaseResolver } from './baseResolver';
|
|
12
13
|
import { type ResourceMapping, type ScimGroup, type ListResponse, type PatchRequest } from './types';
|
|
13
14
|
import type { ScimUsers } from './users';
|
|
15
|
+
import type { ScimOptions } from './scim.options';
|
|
14
16
|
export interface GroupListQuery {
|
|
15
17
|
filter?: string;
|
|
16
18
|
startIndex?: number;
|
|
@@ -21,20 +23,20 @@ export interface GroupListQuery {
|
|
|
21
23
|
export interface ScimGroupsOptions {
|
|
22
24
|
ldap: ldapActions;
|
|
23
25
|
config: Config;
|
|
26
|
+
options: ScimOptions;
|
|
24
27
|
logger: winston.Logger;
|
|
25
28
|
baseResolver: BaseResolver;
|
|
26
29
|
users: ScimUsers;
|
|
27
|
-
|
|
28
|
-
[K: string]: Function[] | undefined;
|
|
29
|
-
};
|
|
30
|
+
hookBus: HookBus;
|
|
30
31
|
}
|
|
31
32
|
export declare class ScimGroups {
|
|
32
33
|
private readonly ldap;
|
|
33
34
|
private readonly config;
|
|
35
|
+
private readonly options;
|
|
34
36
|
private readonly logger;
|
|
35
37
|
private readonly baseResolver;
|
|
36
38
|
private readonly users;
|
|
37
|
-
private readonly
|
|
39
|
+
private readonly hookBus;
|
|
38
40
|
private readonly mapping;
|
|
39
41
|
private readonly attributes;
|
|
40
42
|
private readonly rdnAttribute;
|