Separate AD group description shortening

This commit is contained in:
Meik
2026-03-29 23:46:20 +02:00
parent 45009dfacc
commit f3af7b74f0
3 changed files with 39 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ namespace C4IT_IAM_Engine
public static class Helper
{
public const int MaxAdGroupNameLength = 64;
public const int MaxAdGroupDescriptionLength = 1024;
public const int MaxAdGroupLoopDigits = 3;
private const int MinLeadingRelativePathSegmentLength = 3;
private const int MinSingleLeadingRelativePathSegmentLength = 2;
@@ -74,7 +75,8 @@ namespace C4IT_IAM_Engine
string folderName,
IDictionary<string, string> replacementTags,
int maxLength,
string logContext)
string logContext,
string valueLabel = "AD-Gruppenname")
{
var effectiveSegments = (sanitizedSegments ?? Array.Empty<string>()).Where(i => i != null).ToArray();
var effectiveFolderName = folderName ?? string.Empty;
@@ -132,14 +134,14 @@ namespace C4IT_IAM_Engine
{
cLogManager.DefaultLogger.LogEntry(
LogLevels.Warning,
$"AD-Gruppenname gekuerzt ({logContext}): '{result.OriginalValue}' ({GetMeasuredTemplateLength(result.OriginalValue)}) -> '{result.FinalValue}' ({GetMeasuredTemplateLength(result.FinalValue)}), Strategie: {result.Strategy}, Limit: {maxLength}.");
$"{valueLabel} gekuerzt ({logContext}): '{result.OriginalValue}' ({GetMeasuredTemplateLength(result.OriginalValue)}) -> '{result.FinalValue}' ({GetMeasuredTemplateLength(result.FinalValue)}), Strategie: {result.Strategy}, Limit: {maxLength}.");
}
if (measuredValue.Length > maxLength)
{
cLogManager.DefaultLogger.LogEntry(
LogLevels.Warning,
$"AD-Gruppenname ueberschreitet weiterhin das sichere Limit ({logContext}): '{result.FinalValue}' ({measuredValue.Length}), Limit: {maxLength}.");
$"{valueLabel} ueberschreitet weiterhin das sichere Limit ({logContext}): '{result.FinalValue}' ({measuredValue.Length}), Limit: {maxLength}.");
}
return result;