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

revision date filter. allow clearing config values

This commit is contained in:
Kyle Spearrin
2017-05-13 22:47:22 -04:00
parent e2a443640b
commit ca30ab61aa
7 changed files with 150 additions and 36 deletions

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Bit.Core.Enums;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.DirectoryServices;
@@ -10,17 +11,38 @@ namespace Bit.Core.Models
{
public class SyncConfiguration
{
public SyncConfiguration() { }
public SyncConfiguration(DirectoryType type)
{
switch(type)
{
case DirectoryType.ActiveDirectory:
MemberAttribute = "memberOf";
CreationDateAttribute = "whenCreated";
RevisionDateAttribute = "whenChanged";
UserEmailPrefixAttribute = "sAMAccountName";
break;
case DirectoryType.AzureActiveDirectory:
break;
case DirectoryType.Other:
break;
default:
break;
}
}
public string GroupFilter { get; set; } = "(&(objectClass=group))";
public string UserFilter { get; set; } = "(&(objectClass=person))";
public bool SyncGroups { get; set; } = true;
public bool SyncUsers { get; set; } = true;
public string MemberAttribute { get; set; } = "memberOf";
public string MemberAttribute { get; set; } = "member";
public string GroupNameAttribute { get; set; } = "name";
public string UserEmailAttribute { get; set; } = "mail";
public bool EmailPrefixSuffix { get; set; } = false;
public string UserEmailPrefixAttribute { get; set; } = "sAMAccountName";
public string UserEmailPrefixAttribute { get; set; } = "cn";
public string UserEmailSuffix { get; set; } = "@companyname.com";
public string CreationDateAttribute { get; set; } = "whenCreated";
public string RevisionDateAttribute { get; set; } = "whenChanged";
public string CreationDateAttribute { get; set; }
public string RevisionDateAttribute { get; set; }
}
}