mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-14 23:33:19 +00:00
document filter syntax
This commit is contained in:
@@ -32,8 +32,38 @@ namespace Bit.Core.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Depending on what server type you are using, filters are be one of the following:
|
||||||
|
*
|
||||||
|
* 1. ActiveDirectory or Other
|
||||||
|
* - LDAP query/filter syntax
|
||||||
|
* - Read more at: http://bit.ly/2qyLpzW
|
||||||
|
* - ex. "(&(givenName=John)(|(l=Dallas)(l=Austin)))"
|
||||||
|
*
|
||||||
|
* 2. AzureActiveDirectory
|
||||||
|
* - OData syntax for a Microsoft Graph query parameter '$filter'
|
||||||
|
* - Read more at http://bit.ly/2q3FOOD
|
||||||
|
* - ex. "startswith(displayName,'J')"
|
||||||
|
*
|
||||||
|
* 3. GSuite
|
||||||
|
* - Group Filter
|
||||||
|
* - Custom filtering syntax that allows you to exclude or include a comma separated list of group names.
|
||||||
|
* - ex. "include:Group A,Sales People,My Other Group"
|
||||||
|
* or "exclude:Group C,Developers,Some Other Group"
|
||||||
|
* - User Filter
|
||||||
|
* - Custom filtering syntax that allows you to exclude or include a comma separated list of group names.
|
||||||
|
* - Allows you to concatenate a GSuite Admin API user search query to the end of the filter after delimiting
|
||||||
|
* the include/exclude filter with a pipe (|).
|
||||||
|
* - Read more at http://bit.ly/2rlTskX
|
||||||
|
* - ex.
|
||||||
|
* or "include:joe@company.com,bill@company.com,tom@company.com"
|
||||||
|
* or "exclude:john@company.com,bill@company.com|orgName=Engineering orgTitle:Manager"
|
||||||
|
* or "|orgName=Engineering orgTitle:Manager"
|
||||||
|
*/
|
||||||
|
|
||||||
public string GroupFilter { get; set; }
|
public string GroupFilter { get; set; }
|
||||||
public string UserFilter { get; set; }
|
public string UserFilter { get; set; }
|
||||||
|
|
||||||
public bool SyncGroups { get; set; } = true;
|
public bool SyncGroups { get; set; } = true;
|
||||||
public bool SyncUsers { get; set; } = true;
|
public bool SyncUsers { get; set; } = true;
|
||||||
public int IntervalMinutes { get; set; } = 5;
|
public int IntervalMinutes { get; set; } = 5;
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ namespace Bit.Core.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
var mainParts = filter.Split('|');
|
var mainParts = filter.Split('|');
|
||||||
if(mainParts.Count() < 2)
|
if(mainParts.Count() < 2 || string.IsNullOrWhiteSpace(mainParts[1]))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ namespace Bit.Core.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
var mainParts = filter.Split('|');
|
var mainParts = filter.Split('|');
|
||||||
if(mainParts.Count() < 1)
|
if(mainParts.Count() < 1 || string.IsNullOrWhiteSpace(mainParts[0]))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user