1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-19 09:43:15 +00:00

refactoring entry and path usage

This commit is contained in:
Kyle Spearrin
2017-05-18 08:29:06 -04:00
parent 5fe45f0524
commit badee2d49c
3 changed files with 62 additions and 18 deletions

View File

@@ -15,14 +15,11 @@ namespace Bit.Core.Models
public SyncConfiguration(DirectoryType type)
{
Ldap = new LdapSyncConfiguration(type);
switch(type)
{
case DirectoryType.ActiveDirectory:
Ldap.CreationDateAttribute = "whenCreated";
Ldap.RevisionDateAttribute = "whenChanged";
Ldap.UserEmailPrefixAttribute = "sAMAccountName";
Ldap.UserPath = "Users";
Ldap.GroupPath = "Users";
break;
case DirectoryType.AzureActiveDirectory:
GroupFilter = null;
@@ -45,6 +42,26 @@ namespace Bit.Core.Models
public class LdapSyncConfiguration
{
public LdapSyncConfiguration() { }
public LdapSyncConfiguration(DirectoryType type)
{
switch(type)
{
case DirectoryType.ActiveDirectory:
CreationDateAttribute = "whenCreated";
RevisionDateAttribute = "whenChanged";
UserEmailPrefixAttribute = "sAMAccountName";
UserPath = "Users";
GroupPath = "Users";
break;
case DirectoryType.Other:
break;
default:
break;
}
}
public string UserPath { get; set; }
public string GroupPath { get; set; }
public string UserObjectClass { get; set; } = "person";