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 all 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
21 changes: 17 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,6 @@ private GPO ProcessGPOObject(ISearchResultEntry entry,
ret.Properties);
}
}


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

if ((_methods & ResolvedCollectionMethod.Container) != 0)
{
ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray();
ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName);
ret.Properties.Add("blocksinheritance",
ContainerProcessor.ReadBlocksInheritance(entry.GetProperty("gpoptions")));
ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray();
Expand Down Expand Up @@ -477,7 +490,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