1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

filter unsupported user entries by email length

This commit is contained in:
Kyle Spearrin
2020-03-27 10:36:41 -04:00
parent 379b4f4612
commit f7dd9d8d5b

View File

@@ -51,7 +51,7 @@ export class SyncService {
try {
const entries = await directoryService.getEntries(force || syncConfig.overwriteExisting, test);
let groups = entries[0];
let users = entries[1];
let users = this.filterUnsupportedUsers(entries[1]);
if (groups != null && groups.length > 0) {
this.flattenUsersToGroups(groups, groups);
@@ -103,6 +103,10 @@ export class SyncService {
}
}
private filterUnsupportedUsers(users: UserEntry[]): UserEntry[] {
return users.filter((u) => u.email.length <= 50);
}
private flattenUsersToGroups(levelGroups: GroupEntry[], allGroups: GroupEntry[]): Set<string> {
let allUsers = new Set<string>();
for (const group of levelGroups) {