mirror of
https://github.com/bitwarden/directory-connector
synced 2026-01-21 11:53:38 +00:00
[PM-14360] Import Batching (#703)
* initial implementation * next iteration * clean up * cleanup * fix test * cleanup * rename services, refactor, fix test logic * fix DI * update comment * update comment * resolve merge conflict * register dependencies out of jslib, more cleanup * fix failing test in build * fix type error * try fixing test error * remove async from test setup * attempt to fix test * fix text * fix test * add ts-expect-error comment * cleanup --------- Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
This commit is contained in:
53
src/utils/test-fixtures.ts
Normal file
53
src/utils/test-fixtures.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { LdapConfiguration } from "../models/ldapConfiguration";
|
||||
import { SyncConfiguration } from "../models/syncConfiguration";
|
||||
|
||||
/**
|
||||
* @returns a basic ldap configuration without TLS/SSL enabled. Can be overridden by passing in a partial configuration.
|
||||
*/
|
||||
export const getLdapConfiguration = (config?: Partial<LdapConfiguration>): LdapConfiguration => ({
|
||||
ssl: false,
|
||||
startTls: false,
|
||||
tlsCaPath: null,
|
||||
sslAllowUnauthorized: false,
|
||||
sslCertPath: null,
|
||||
sslKeyPath: null,
|
||||
sslCaPath: null,
|
||||
hostname: "localhost",
|
||||
port: 1389,
|
||||
domain: null,
|
||||
rootPath: "dc=bitwarden,dc=com",
|
||||
currentUser: false,
|
||||
username: "cn=admin,dc=bitwarden,dc=com",
|
||||
password: "admin",
|
||||
ad: false,
|
||||
pagedSearch: false,
|
||||
...(config ?? {}),
|
||||
});
|
||||
|
||||
/**
|
||||
* @returns a basic sync configuration. Can be overridden by passing in a partial configuration.
|
||||
*/
|
||||
export const getSyncConfiguration = (config?: Partial<SyncConfiguration>): SyncConfiguration => ({
|
||||
users: false,
|
||||
groups: false,
|
||||
interval: 5,
|
||||
userFilter: null,
|
||||
groupFilter: null,
|
||||
removeDisabled: false,
|
||||
overwriteExisting: false,
|
||||
largeImport: false,
|
||||
// Ldap properties
|
||||
groupObjectClass: "posixGroup",
|
||||
userObjectClass: "person",
|
||||
groupPath: null,
|
||||
userPath: null,
|
||||
groupNameAttribute: "cn",
|
||||
userEmailAttribute: "mail",
|
||||
memberAttribute: "memberUid",
|
||||
useEmailPrefixSuffix: false,
|
||||
emailPrefixAttribute: "sAMAccountName",
|
||||
emailSuffix: null,
|
||||
creationDateAttribute: "whenCreated",
|
||||
revisionDateAttribute: "whenChanged",
|
||||
...(config ?? {}),
|
||||
});
|
||||
Reference in New Issue
Block a user