Skip to content

Commit

Permalink
Merge branch 'v3' into collect-ca-roleseparation
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK authored May 2, 2024
2 parents c36ff69 + 53431a9 commit 75dd88d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/CommonLib/Processors/CertAbuseProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,23 @@ public async Task<EnrollmentAgentRegistryAPIResult> ProcessEAPermissions(string
return ret;
}

public IEnumerable<TypedPrincipal> ProcessCertTemplates(string[] templates, string domainName)
public (IEnumerable<TypedPrincipal> resolvedTemplates, IEnumerable<String> unresolvedTemplates) ProcessCertTemplates(string[] templates, string domainName)
{
var resolvedTemplates = new List<TypedPrincipal>();
var unresolvedTemplates = new List<String>();

var certTemplatesLocation = _utils.BuildLdapPath(DirectoryPaths.CertTemplateLocation, domainName);
foreach (var templateCN in templates)
{
var res = _utils.ResolveCertTemplateByProperty(Encoder.LdapFilterEncode(templateCN), LDAPProperties.CanonicalName, certTemplatesLocation, domainName);
yield return res;
if (res != null) {
resolvedTemplates.Add(res);
} else {
unresolvedTemplates.Add(templateCN);
}
}

return (resolvedTemplates: resolvedTemplates, unresolvedTemplates: unresolvedTemplates);
}

/// <summary>
Expand Down

0 comments on commit 75dd88d

Please sign in to comment.