mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-15 07:43:27 +00:00
filter unsupported user entries by email length
This commit is contained in:
@@ -51,7 +51,7 @@ export class SyncService {
|
|||||||
try {
|
try {
|
||||||
const entries = await directoryService.getEntries(force || syncConfig.overwriteExisting, test);
|
const entries = await directoryService.getEntries(force || syncConfig.overwriteExisting, test);
|
||||||
let groups = entries[0];
|
let groups = entries[0];
|
||||||
let users = entries[1];
|
let users = this.filterUnsupportedUsers(entries[1]);
|
||||||
|
|
||||||
if (groups != null && groups.length > 0) {
|
if (groups != null && groups.length > 0) {
|
||||||
this.flattenUsersToGroups(groups, groups);
|
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> {
|
private flattenUsersToGroups(levelGroups: GroupEntry[], allGroups: GroupEntry[]): Set<string> {
|
||||||
let allUsers = new Set<string>();
|
let allUsers = new Set<string>();
|
||||||
for (const group of levelGroups) {
|
for (const group of levelGroups) {
|
||||||
|
|||||||
Reference in New Issue
Block a user