Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BED-3868: Build contains edges from DNs #71

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Producers/BaseProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected LDAPData CreateLDAPData()
{
if ((methods & ResolvedCollectionMethod.Container) != 0)
{
query = query.AddContainers().AddDomains();
query = query.AddComputers().AddContainers().AddUsers().AddGroups().AddDomains().AddOUs().AddGPOs();
props.AddRange(CommonProperties.ContainerProps);
}

Expand Down
25 changes: 21 additions & 4 deletions src/Runtime/ObjectProcessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ private async Task<User> ProcessUserObject(ISearchResultEntry entry,
ret.SPNTargets = targets.ToArray();
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

return ret;
}

Expand Down Expand Up @@ -183,6 +188,11 @@ private async Task<Computer> ProcessComputerObject(ISearchResultEntry entry,
ret.DumpSMSAPassword = computerProps.DumpSMSAPassword;
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

if (!_methods.IsComputerCollectionSet())
return ret;

Expand Down Expand Up @@ -306,6 +316,11 @@ private Group ProcessGroupObject(ISearchResultEntry entry,
}
}

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

return ret;
}

Expand Down Expand Up @@ -368,7 +383,6 @@ private async Task<Domain> ProcessDomainObject(ISearchResultEntry entry,

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray();
ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray();
}

Expand Down Expand Up @@ -410,7 +424,11 @@ private GPO ProcessGPOObject(ISearchResultEntry entry,
ret.Properties);
}
}


if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
}

return ret;
}
Expand Down Expand Up @@ -447,7 +465,6 @@ private async Task<OU> ProcessOUObject(ISearchResultEntry entry,

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray();
ret.Properties.Add("blocksinheritance",
ContainerProcessor.ReadBlocksInheritance(entry.GetProperty("gpoptions")));
ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray();
Expand Down Expand Up @@ -477,7 +494,7 @@ private Container ProcessContainerObject(ISearchResultEntry entry,
ret.Properties.Add("highvalue", false);

if ((_methods & ResolvedCollectionMethod.Container) != 0)
ret.ChildObjects = _containerProcessor.GetContainerChildObjects(entry.DistinguishedName).ToArray();
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);

if ((_methods & ResolvedCollectionMethod.ACL) != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Writers/JsonDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class JsonDataWriter<T> : BaseWriter<T>
private string _fileName;
private JsonSerializerSettings _serializerSettings;

private const int DataVersion = 5;
private const int DataVersion = 6;

/// <summary>
/// Creates a new instance of a JSONWriter using the specified datatype and program context
Expand Down
Loading