diff --git a/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/ProtectedConfigurationBuilderTest.cs b/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/ProtectedConfigurationBuilderTest.cs index 833d0da..e57297d 100644 --- a/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/ProtectedConfigurationBuilderTest.cs +++ b/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/ProtectedConfigurationBuilderTest.cs @@ -35,9 +35,9 @@ public class ProtectedConfigurationBuilderTestFixture : IDisposable public ProtectedConfigurationBuilderTestFixture() { // cleans existing XML, JSON and BAK files - Directory.EnumerateFiles(".", "*.json").ToList().ForEach(f => File.Delete(f)); - Directory.EnumerateFiles(".", "*.xml").ToList().ForEach(f => File.Delete(f)); - Directory.EnumerateFiles(".", "*.bak").ToList().ForEach(f => File.Delete(f)); + Directory.EnumerateFiles(".", "random_*.json").ToList().ForEach(f => File.Delete(f)); + Directory.EnumerateFiles(".", "random_*.xml").ToList().ForEach(f => File.Delete(f)); + Directory.EnumerateFiles(".", "random_*.bak").ToList().ForEach(f => File.Delete(f)); } public void Dispose() @@ -137,7 +137,7 @@ protected Int64 NextInt64(Int64 minValue, Int64 maxValue) return (dataType, NextInt64(Int64.MinValue, Int64.MaxValue)); case DataTypes.DateTimeOffset: - return (dataType, new DateTimeOffset(NextInt64(DateTimeOffset.MinValue.Ticks + 2 * TimeSpan.TicksPerDay, DateTimeOffset.MaxValue.Ticks - 2 * TimeSpan.TicksPerDay), TimeZoneInfoValues[Random.Next(TimeZoneInfoValues.Length)].BaseUtcOffset)); + return (dataType, new DateTimeOffset(NextInt64(DateTimeOffset.MinValue.Ticks + 2 * TimeSpan.TicksPerDay, DateTimeOffset.MaxValue.Ticks - 2 * TimeSpan.TicksPerDay)+TimeZoneInfoValues[Random.Next(TimeZoneInfoValues.Length)].BaseUtcOffset.Ticks,TimeSpan.Zero)); case DataTypes.Double: return (dataType, NextInt64(Int64.MinValue, Int64.MaxValue) * Random.NextDouble()); @@ -168,7 +168,7 @@ protected Int64 NextInt64(Int64 minValue, Int64 maxValue) case DataTypes.DateTimeOffsetArray: var dateTimeArray = new DateTimeOffset[Random.Next(0, ARRAYMAXLENGTH)]; for (int i = 0; i < dateTimeArray.Length; i++) - dateTimeArray[i] = new DateTimeOffset(NextInt64(DateTimeOffset.MinValue.Ticks, DateTimeOffset.MaxValue.Ticks), TimeZoneInfoValues[Random.Next(TimeZoneInfoValues.Length)].BaseUtcOffset); + dateTimeArray[i] = new DateTimeOffset(NextInt64(DateTimeOffset.MinValue.Ticks + 2 * TimeSpan.TicksPerDay, DateTimeOffset.MaxValue.Ticks - 2 * TimeSpan.TicksPerDay) + TimeZoneInfoValues[Random.Next(TimeZoneInfoValues.Length)].BaseUtcOffset.Ticks, TimeSpan.Zero); return (dataType, dateTimeArray); case DataTypes.DoubleArray: @@ -184,7 +184,7 @@ protected Int64 NextInt64(Int64 minValue, Int64 maxValue) - protected int CheckConfigurationEntriesAreEqual(IConfigurationRoot configurationRoot) + protected int CheckConfigurationEntriesAreEqual(IConfigurationRoot configurationRoot, bool skipMissingNullKeys=false) { int numEntries = 0; @@ -201,11 +201,14 @@ protected int CheckConfigurationEntriesAreEqual(IConfigurationRoot configuration { numEntries++; var encryptedKey = key.Key.Replace("_Plaintext", "_Encrypted"); - if (key.Value != dataProperty[encryptedKey]) - throw new InvalidDataException($"Value mismatch: Plaintext Key {key.Key} Value {key.Value} Encrypted Key {encryptedKey} Value {dataProperty[encryptedKey]}"); + if (!dataProperty.TryGetValue(encryptedKey, out var encryptedValue) && skipMissingNullKeys && encryptedKey.Contains("_Null_")) + continue; + + if (key.Value != encryptedValue) + throw new InvalidDataException($"Value mismatch: Plaintext Key {key.Key} Value {key.Value} Encrypted Key {encryptedKey} Value {encryptedValue}"); // for debugging - //TestOutputHelper.WriteLine($"Checked Key {key.Key} Value {key.Value} Encrypted Key {encryptedKey} Value {dataProperty[encryptedKey]}"); + //TestOutputHelper.WriteLine($"{DateTime.Now}: Checked Key {key.Key} Value {key.Value} Encrypted Key {encryptedKey} Value {dataProperty[encryptedKey]}"); } } @@ -229,13 +232,14 @@ protected int CheckConfigurationEntriesAreEqual(IConfigurationRoot configuration { numEntries++; var encryptedKey = fullKey.Replace("_Plaintext", "_Encrypted"); - provider.TryGet(encryptedKey, out var valueDecrypted); + if (!provider.TryGet(encryptedKey, out var valueDecrypted) && skipMissingNullKeys && encryptedKey.Contains("_Null_")) + continue; if (value != valueDecrypted) throw new InvalidDataException($"Value mismatch: Plaintext Key {fullKey} Value {value} Encrypted Key {encryptedKey} Value {valueDecrypted}"); // for debugging - //TestOutputHelper.WriteLine($"Checked Key {fullKey} Value {value} Encrypted Key {encryptedKey} Value {valueDecrypted}"); + //TestOutputHelper.WriteLine($"{DateTime.Now}: Checked Key {fullKey} Value {value} Encrypted Key {encryptedKey} Value {valueDecrypted}"); } } else @@ -308,6 +312,8 @@ protected String CreateJsonProtectValue(string subPurpose, DataTypes dataType, o String subPurpose; var fileName = RANDOMJSONFILENAME; + TestOutputHelper.WriteLine($"{DateTime.Now}: Generating a random JSON file with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}..."); + var JSONObject = new JsonObject(); var currentNode = JSONObject; @@ -372,9 +378,7 @@ protected String CreateJsonProtectValue(string subPurpose, DataTypes dataType, o File.WriteAllText(fileName, JSONObject.ToJsonString(JsonSerializerOptions)); var fileInfo = new FileInfo(fileName); - TestOutputHelper.WriteLine($"Generated a random JSON file with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}"); - TestOutputHelper.WriteLine($"File location file://{Path.GetFullPath(fileName).Replace("\\", "/")}"); - TestOutputHelper.WriteLine($"Size {fileInfo.Length / 1024}KB, starting test..."); + TestOutputHelper.WriteLine($"{DateTime.Now}: File location file://{Path.GetFullPath(fileName).Replace("\\", "/")}"); return (fileName, numEntries); } @@ -397,12 +401,12 @@ public void RandomJsonFileTest(bool useJsonWithCommentFileProcessor) // genererates a JSON file var result = GenerateRandomJsonFile(); - stopwatch.Step($"Generated random JSON file ({result.NumEntries} entries)"); + stopwatch.Step($"Generated random JSON file ({result.NumEntries} entries size {new FileInfo(result.FileName).Length / 1024} KB)"); // Encrypts the JSON file Assert.True(ProtectProviderConfigurationData.ProtectFiles(".")?.Any()); - stopwatch.Step("Encrypted random JSON file"); + stopwatch.Step($"Encrypted random JSON file ({result.NumEntries} entries size {new FileInfo(result.FileName).Length / 1024} KB)"); // Reads the encrypted JSON file and checks that all encrypted entries do not match DefaultProtectRegexString var encryptedJsonDocument = JsonSerializer.Deserialize>(File.ReadAllText(result.FileName), JsonSerializerOptions); @@ -512,7 +516,7 @@ protected String CreateXmlProtectValue(string subPurpose, DataTypes dataType, ob /// the new node value /// if true, forces the new node to be an element /// always true - public bool AddXmlNode(XmlNode currentNode, string name, DataTypes dataType, object value) + public bool AddXmlNode(XElement currentNode, string name, DataTypes dataType, object value) { // with array we must use elememts, with WhitespaceString we must use attributes (whitespace is only preserved there) bool forceElement = new List { DataTypes.StringArray, DataTypes.IntegerArray, DataTypes.DoubleArray, DataTypes.BooleanArray, DataTypes.DateTimeOffsetArray }.Contains(dataType); @@ -527,15 +531,13 @@ public bool AddXmlNode(XmlNode currentNode, string name, DataTypes dataType, obj if (attributeNode) { - var attribute = currentNode.OwnerDocument.CreateAttribute(name); - attribute.Value = valueString; - currentNode.Attributes.Append(attribute); + var attribute = new XAttribute(name, valueString ?? String.Empty); + currentNode.Add(attribute); } else { - var element = currentNode.OwnerDocument.CreateElement(name); - element.InnerText = valueString; - currentNode.AppendChild(element); + var element = new XElement(name, valueString); + currentNode.Add(element); } return true; @@ -556,10 +558,12 @@ public bool AddXmlNode(XmlNode currentNode, string name, DataTypes dataType, obj String subPurpose; var fileName = RANDOMXMLFILENAME; - var xmlDocument = new XmlDocument(); - xmlDocument.AppendChild(xmlDocument.CreateElement("root")); + TestOutputHelper.WriteLine($"{DateTime.Now}: Generating a random XML file with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}..."); + + var xDocument = new XDocument(); + xDocument.Add(new XElement("root")); - var currentNode = xmlDocument.DocumentElement; + var currentNode = xDocument.Root; int level = 1; int numEntries = 0; @@ -596,19 +600,19 @@ public bool AddXmlNode(XmlNode currentNode, string name, DataTypes dataType, obj case DataTypes.DoubleArray: case DataTypes.BooleanArray: case DataTypes.DateTimeOffsetArray: - var arrayElement = xmlDocument.CreateElement(entryKey + "Plaintext"); + var arrayElement = new XElement(entryKey + "Plaintext"); ((Array)entryValue.Value).Cast().Select((obj, index) => AddXmlNode(arrayElement, $"A_{index}", entryValue.DataType, entryValue.DataType == DataTypes.StringArray ? obj.ToString().Trim() : obj)).ToArray(); - currentNode.AppendChild(arrayElement); + currentNode.Add(arrayElement); - arrayElement = xmlDocument.CreateElement(entryKey + "Encrypted"); + arrayElement = new XElement(entryKey + "Encrypted"); ((Array)entryValue.Value).Cast().Select((obj, index) => { subPurpose = (Random.Next() % 4 == 0) ? TrimRegexCharsFromSubpurpose(GenerateRandomString(SUBPURPOSEMAXLENGTH)) : null; return AddXmlNode(arrayElement, $"A_{index}", entryValue.DataType, CreateXmlProtectValue(subPurpose, entryValue.DataType, entryValue.DataType == DataTypes.StringArray ? obj.ToString().Trim() : obj)); }).ToArray(); - currentNode.AppendChild(arrayElement); + currentNode.Add(arrayElement); - numEntries += ((Array)entryValue.Value).Length; // note IConfigurationBuilder.AddXmlFile does not load empty XML elements like + numEntries += ((Array)entryValue.Value).Length; // note IConfigurationBuilder.AddXmlFile does not load empty XML elements like , see break; } @@ -616,25 +620,22 @@ public bool AddXmlNode(XmlNode currentNode, string name, DataTypes dataType, obj { var nextSubLevelKey = $"Sublevel_{++level}"; - if (currentNode.GetElementsByTagName(nextSubLevelKey).Count == 0) - currentNode.AppendChild(xmlDocument.CreateElement(nextSubLevelKey)); + if (!currentNode.Elements(nextSubLevelKey).Any()) + currentNode.Add(new XElement(nextSubLevelKey)); - currentNode = (XmlElement)currentNode.GetElementsByTagName(nextSubLevelKey).Item(0); + currentNode = (XElement)currentNode.Elements(nextSubLevelKey).First(); } else if (levelMove == LevelMove.Up && level > 1) { level--; - currentNode = (XmlElement)currentNode.ParentNode; + currentNode = (XElement)currentNode.Parent; } } - - File.WriteAllText(fileName, xmlDocument.OuterXml); + xDocument.Save(fileName); var fileInfo = new FileInfo(fileName); - TestOutputHelper.WriteLine($"Generated a random XML file with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}"); - TestOutputHelper.WriteLine($"File location file://{Path.GetFullPath(fileName).Replace("\\", "/")}"); - TestOutputHelper.WriteLine($"Size {fileInfo.Length / 1024}KB, starting test..."); + TestOutputHelper.WriteLine($"{DateTime.Now}: File location file://{Path.GetFullPath(fileName).Replace("\\", "/")}"); return (fileName, numEntries); } @@ -653,12 +654,12 @@ public void RandomXmlFileTest() // genererates a XML file var result = GenerateRandomXmlFile(); - stopwatch.Step($"Generated random XML file ({result.NumEntries} entries)"); + stopwatch.Step($"Generated random XML file ({result.NumEntries} entries size {new FileInfo(result.FileName).Length / 1024} KB)"); // Encrypts the XML file Assert.True(ProtectProviderConfigurationData.ProtectFiles(".", searchPattern: "*.xml")?.Any()); - - stopwatch.Step("Encrypted random XML file"); + + stopwatch.Step($"Encrypted random XML file ({result.NumEntries} entries size {new FileInfo(result.FileName).Length / 1024} KB)"); // Reads the encrypted XML file and checks that all encrypted entries do not match DefaultProtectRegexString var encryptedXmlDocument = XDocument.Load(result.FileName); @@ -678,13 +679,13 @@ public void RandomXmlFileTest() stopwatch.Step("Checked that all random XML file is encrypted"); - // Loads the XML with ProtectedConfigurationBuilder, note that IConfigurationBuilder.AddXmlFile does not load empty XML elements like + // Loads the XML with ProtectedConfigurationBuilder, note that IConfigurationBuilder.AddXmlFile does not load empty XML elements like see var configuration = new ProtectedConfigurationBuilder(ProtectProviderConfigurationData).AddXmlFile(result.FileName).Build(); stopwatch.Step("Loaded and decrypted random XML file with ProtectedConfigurationBuilder"); - // Foreach xxx_Plaintext key check that its value is equal to xxx_Encrypted - var checkedEntries = CheckConfigurationEntriesAreEqual(configuration); + // Foreach xxx_Plaintext key check that its value is equal to xxx_Encrypted, here we pass true to skipMissingNullKeys because of the previous comment about empty XML elements + var checkedEntries = CheckConfigurationEntriesAreEqual(configuration,true); stopwatch.Step($"Checked that {checkedEntries} entries are equal"); } @@ -722,6 +723,8 @@ protected void GenerateRandomEnvironmentVariables() String subPurpose; var fileName = RANDOMXMLFILENAME; + TestOutputHelper.WriteLine($"{DateTime.Now}: Generating a random environment variables {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}..."); + // Generate random environments variables // for (int i = 0; i < Math.Min(NUMENTRIES,2000); i++) @@ -763,8 +766,7 @@ protected void GenerateRandomEnvironmentVariables() } } - TestOutputHelper.WriteLine($"Generated a random environment variables {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}"); - TestOutputHelper.WriteLine($"Starting test..."); + TestOutputHelper.WriteLine($"{DateTime.Now}: Starting test..."); } @@ -824,6 +826,8 @@ protected Dictionary GenerateRandomInMemoryDictionary() { String subPurpose; + TestOutputHelper.WriteLine($"{DateTime.Now}: Generating a random in-memory dictionary with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}..."); + var dictionary = new Dictionary(); var currentNode = dictionary; @@ -865,8 +869,7 @@ protected Dictionary GenerateRandomInMemoryDictionary() } - TestOutputHelper.WriteLine($"Generated a random in-memory dictionary with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}"); - TestOutputHelper.WriteLine($"Starting test..."); + TestOutputHelper.WriteLine($"{DateTime.Now}: Starting test..."); return dictionary; } @@ -929,6 +932,8 @@ protected String[] GenerateRandomCommandLine() { String subPurpose; + TestOutputHelper.WriteLine($"{DateTime.Now}: Generating a random command line arguments with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}..."); + var args = new String[4 * NUMENTRIES]; for (int i = 0; i < NUMENTRIES; i++) @@ -972,8 +977,7 @@ protected String[] GenerateRandomCommandLine() } - TestOutputHelper.WriteLine($"Generated a random command line arguments with {NUMENTRIES} keys, autogenerated strings max length {STRINGMAXLENGTH} and autogenerated array max length {ARRAYMAXLENGTH}"); - TestOutputHelper.WriteLine($"Starting test..."); + TestOutputHelper.WriteLine($"{DateTime.Now}: Starting test..."); return args; } diff --git a/Fededim.Extensions.Configuration.Protected/docs/README.md b/Fededim.Extensions.Configuration.Protected/docs/README.md index 9d982c0..cb2bc68 100644 --- a/Fededim.Extensions.Configuration.Protected/docs/README.md +++ b/Fededim.Extensions.Configuration.Protected/docs/README.md @@ -275,7 +275,7 @@ v1.0.17 - Refinement: added virtual to various methods in order to allow extensibility v1.0.18 -- Refinement: updated System.Text.Json to 8.0.4 in order to fix the security issue CVE-2024-30105 +- Security fix: updated System.Text.Json to 8.0.4 in order to fix the security issue CVE-2024-30105 # Detailed guide diff --git a/misc/last_build_artifacts/Cobertura.xml b/misc/last_build_artifacts/Cobertura.xml index 342518a..9a41c82 100644 --- a/misc/last_build_artifacts/Cobertura.xml +++ b/misc/last_build_artifacts/Cobertura.xml @@ -1,6 +1,6 @@ - + D:\a\Fededim.Extensions.Configuration.Protected\Fededim.Extensions.Configuration.Protected\ @@ -11,7 +11,7 @@ - + @@ -25,14 +25,14 @@ - - - - - - - - + + + + + + + + @@ -42,25 +42,25 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -84,8 +84,8 @@ - - + + @@ -103,7 +103,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -128,34 +128,34 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -163,8 +163,8 @@ - - + + @@ -176,58 +176,58 @@ - + - + - + - + - - + + - - + + - - + + - + - + - - - - - - + + + + + + - - + + - - + + - + - + @@ -335,31 +335,31 @@ - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - + @@ -374,28 +374,28 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + @@ -498,12 +498,12 @@ - + - + @@ -554,20 +554,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -638,8 +638,8 @@ - - + + @@ -672,20 +672,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -720,12 +720,12 @@ - + - + @@ -738,8 +738,8 @@ - - + + @@ -830,17 +830,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -867,17 +867,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -1012,40 +1012,40 @@ - + - + - + - + - - - + + + - - - - - - - + + + + + + + diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProataProtectionAPIProtectConfigurationData.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProataProtectionAPIProtectConfigurationData.html index e0b531d..680c1c2 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProataProtectionAPIProtectConfigurationData.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProataProtectionAPIProtectConfigurationData.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885 @@ -339,7 +339,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io +

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProtectionAPI_DataProtectionAPIProtectProvider.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProtectionAPI_DataProtectionAPIProtectProvider.html index 3e3f807..17cf448 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProtectionAPI_DataProtectionAPIProtectProvider.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected.DataProtectionAPI_DataProtectionAPIProtectProvider.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -135,17 +135,17 @@

 8    /// </summary>  9    public class DataProtectionAPIProtectProvider : IProtectProvider  10    { - 443572611        public IDataProtector DataProtector { get; } + 444361611        public IDataProtector DataProtector { get; }  12  13  14        /// <summary>  15        /// The main constructor  16        /// </summary>  17        /// <param name="dataProtector">the <see cref="IDataProtector"/> interface obtained from Data Protection API</pa - 88591018        public DataProtectionAPIProtectProvider(IDataProtector dataProtector) + 88935818        public DataProtectionAPIProtectProvider(IDataProtector dataProtector)  19        { - 88591020            DataProtector = dataProtector; - 88591021        } + 88935820            DataProtector = dataProtector; + 88935821        }  22  23        /// <summary>  24        /// This methods create a new <see cref="IProtectProvider"/> for supporting per configuration value encryption s @@ -154,7 +154,7 @@

 27        /// <returns>a derived <see cref="IProtectProvider"/> based on the <see cref="subkey"/> parameter</returns>  28        public IProtectProvider CreateNewProviderFromSubkey(String subkey)  29        { - 88589830            return new DataProtectionAPIProtectProvider(DataProtector.CreateProtector(subkey)); + 88934630            return new DataProtectionAPIProtectProvider(DataProtector.CreateProtector(subkey));  31        }  32  33 @@ -165,7 +165,7 @@

 38        /// <returns>the decrypted string</returns>  39        public String Decrypt(String encryptedValue)  40        { - 177491441            return DataProtector.Unprotect(encryptedValue); + 177713541            return DataProtector.Unprotect(encryptedValue);  42        }  43  44 @@ -176,14 +176,14 @@

 49        /// <returns>the encrypted string</returns>  50        public String Encrypt(String plainTextValue)  51        { - 177491452            return DataProtector.Protect(plainTextValue); + 177713552            return DataProtector.Protect(plainTextValue);  53        }  54    }  55}

- +

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ConfigurationBuilderExtensions.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ConfigurationBuilderExtensions.html index 514d5ff..a2b6be7 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ConfigurationBuilderExtensions.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ConfigurationBuilderExtensions.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -173,7 +173,7 @@

 40        /// - One for RAW files (<see cref="RawProtectFileOption"/> and <see cref="RawProtectFileProcessor"/>)<br/><br /  41        /// This list has a public getter so you can add any additional decoding function you want or replace an existin  42        /// </summary> - 1443        public static List<ProtectFileOptions> ProtectFilesOptions { get; private set; } = new List<ProtectFileOptions>( + 1843        public static List<ProtectFileOptions> ProtectFilesOptions { get; private set; } = new List<ProtectFileOptions>(  244        {  245         JsonProtectFileOption,  246         XmlProtectFileOption, @@ -208,19 +208,19 @@

 75  676            var result = new List<String>();  77 - 2878            foreach (var f in Directory.EnumerateFiles(path, searchPattern, searchOption)) + 3678            foreach (var f in Directory.EnumerateFiles(path, searchPattern, searchOption))  79            { - 880                var fileContent = File.ReadAllText(f); - 881                var replacedContent = fileContent; + 1280                var fileContent = File.ReadAllText(f); + 1281                var replacedContent = fileContent;  82 - 2883                foreach (var protectFileOption in ProtectFilesOptions) - 1084                    if (protectFileOption.FilenameRegex.Match(f).Success) + 4083                foreach (var protectFileOption in ProtectFilesOptions) + 1484                    if (protectFileOption.FilenameRegex.Match(f).Success)  85                    { - 142157286                        replacedContent = protectFileOption.ProtectFileProcessor.ProtectFile(fileContent, protectProvide - 887                        break; + 142349486                        replacedContent = protectFileOption.ProtectFileProcessor.ProtectFile(fileContent, protectProvide + 1287                        break;  88                    }  89 - 890                if (replacedContent != fileContent) + 1290                if (replacedContent != fileContent)  91                {  692                    if (backupOriginalFile)  693                        File.Copy(f, f + ".bak", true); @@ -248,7 +248,7 @@

 115        /// <exception cref="ArgumentException"></exception>  116        public static String ProtectConfigurationValue(this IProtectProviderConfigurationData protectProviderConfigurati  117        { - 2628988118            return ProtectConfigurationValueInternal(protectProviderConfigurationData, value); + 2630752118            return ProtectConfigurationValueInternal(protectProviderConfigurationData, value);  119        }  120  121 @@ -261,22 +261,22 @@

 128        /// <returns></returns>  129        private static String ProtectConfigurationValueInternal(IProtectProviderConfigurationData protectProviderConfigu  130        { - 2628988131            if (value == null) - 100410132                return null; + 2630752131            if (value == null) + 99654132                return null;  133 - 2528578134            protectProviderConfigurationData.CheckConfigurationIsValid(); + 2531098134            protectProviderConfigurationData.CheckConfigurationIsValid();  135 - 2528578136            return protectProviderConfigurationData.ProtectRegex.Replace(value, (me) => - 2528578137            { - 1774914138                var subPurposePresent = !String.IsNullOrEmpty(me.Groups["subPurpose"]?.Value); - 2528578139 - 1774914140                var protectProvider = protectProviderConfigurationData.ProtectProvider; - 2528578141 - 1774914142                if (subPurposePresent) - 442949143                    protectProvider = protectProviderConfigurationData.ProtectProvider.CreateNewProviderFromSubkey(me.Gr - 2528578144 - 1774914145                return protectProviderConfigurationData.ProtectedReplaceString.Replace("${subPurposePattern}", subPurpos - 2528578146            }); + 2531098136            return protectProviderConfigurationData.ProtectRegex.Replace(value, (me) => + 2531098137            { + 1777135138                var subPurposePresent = !String.IsNullOrEmpty(me.Groups["subPurpose"]?.Value); + 2531098139 + 1777135140                var protectProvider = protectProviderConfigurationData.ProtectProvider; + 2531098141 + 1777135142                if (subPurposePresent) + 444673143                    protectProvider = protectProviderConfigurationData.ProtectProvider.CreateNewProviderFromSubkey(me.Gr + 2531098144 + 1777135145                return protectProviderConfigurationData.ProtectedReplaceString.Replace("${subPurposePattern}", subPurpos + 2531098146            });  147        }  148  149 @@ -330,8 +330,8 @@

 197        {  2198            var environmentVariables = Environment.GetEnvironmentVariables(environmentTarget);  199 - 14852200            foreach (String key in environmentVariables.Keys) - 7424201                Environment.SetEnvironmentVariable(key, protectProviderConfigurationData.ProtectConfigurationValue(envir + 14544200            foreach (String key in environmentVariables.Keys) + 7270201                Environment.SetEnvironmentVariable(key, protectProviderConfigurationData.ProtectConfigurationValue(envir  2202        }  203  204 @@ -359,7 +359,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_IProtectProviderConfigurationData.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_IProtectProviderConfigurationData.html index e4370b5..7d18726 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_IProtectProviderConfigurationData.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_IProtectProviderConfigurationData.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -174,24 +174,24 @@

 47        /// <summary>  48        /// The actual provider performing the encryption/decryption, <see cref="IProtectProvider"/> interface  49        /// </summary> - 652139750        public IProtectProvider ProtectProvider { get; protected set; } + 653008350        public IProtectProvider ProtectProvider { get; protected set; }  51  52        /// <summary>  53        /// a regular expression which captures the data to be decrypted in a named group called protectData  54        /// </summary> - 1397233355        public Regex ProtectedRegex { get; protected set; } + 1398831455        public Regex ProtectedRegex { get; protected set; }  56  57  58        /// <summary>  59        /// a regular expression which captures the data to be encrypted in a named group called protectData  60        /// </summary> - 1067559561        public Regex ProtectRegex { get; protected set; } + 1068330061        public Regex ProtectRegex { get; protected set; }  62  63  64        /// <summary>  65        /// a string replacement expression which captures the substitution which must be applied for transforming unenc  66        /// </summary> - 1188934667        public String ProtectedReplaceString { get; protected set; } + 1190164767        public String ProtectedReplaceString { get; protected set; }  68  69  70        /// <summary> @@ -199,21 +199,21 @@

 72        /// </summary>  73        public virtual void CheckConfigurationIsValid()  74        { - 252860875            ProtectRegex = ProtectRegex ?? new Regex(DefaultProtectRegexString); - 252860876            if (!ProtectRegex.GetGroupNames().Contains("protectData")) + 253112875            ProtectRegex = ProtectRegex ?? new Regex(DefaultProtectRegexString); + 253112876            if (!ProtectRegex.GetGroupNames().Contains("protectData"))  077                throw new ArgumentException("ProtectRegex must contain a group named protectedData!", nameof(ProtectRege  78 - 252860879            ProtectedRegex = ProtectedRegex ?? new Regex(DefaultProtectedRegexString); - 252860880            if (!ProtectedRegex.GetGroupNames().Contains("protectedData")) + 253112879            ProtectedRegex = ProtectedRegex ?? new Regex(DefaultProtectedRegexString); + 253112880            if (!ProtectedRegex.GetGroupNames().Contains("protectedData"))  081                throw new ArgumentException("ProtectedRegex must contain a group named protectedData!", nameof(Protected  82 - 252860883            ProtectedReplaceString = !String.IsNullOrEmpty(ProtectedReplaceString) ? ProtectedReplaceString : DefaultPro - 252860884            if (!ProtectedReplaceString.Contains("${protectedData}")) + 253112883            ProtectedReplaceString = !String.IsNullOrEmpty(ProtectedReplaceString) ? ProtectedReplaceString : DefaultPro + 253112884            if (!ProtectedReplaceString.Contains("${protectedData}"))  085                throw new ArgumentException("ProtectedReplaceString must contain ${protectedData}!", nameof(ProtectedRep  86 - 252860887            if (ProtectProvider == null) + 253112887            if (ProtectProvider == null)  088                throw new ArgumentException("ProtectProvider must not be null!", nameof(ProtectProvider)); - 252860889        } + 253112889        }  90    }  91  92 @@ -272,7 +272,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonProtectFileProcessor.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonProtectFileProcessor.html index f7ca442..0d2cac4 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonProtectFileProcessor.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonProtectFileProcessor.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -451,7 +451,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonWithCommentsProtectFileProcessor.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonWithCommentsProtectFileProcessor.html index 27c0036..afe6f7a 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonWithCommentsProtectFileProcessor.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_JsonWithCommentsProtectFileProcessor.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -314,8 +314,8 @@

 187    public class JsonWithCommentsProtectFileProcessor : IProtectFileProcessor  188    {  10189        protected JsonSerializerOptions JsonSerializerOptions { get; set; } - 947932190        protected JsonReaderOptions JsonReaderOptions { get; set; } - 947932191        protected JsonWriterOptions JsonWriterOptions { get; set; } + 950145190        protected JsonReaderOptions JsonReaderOptions { get; set; } + 950145191        protected JsonWriterOptions JsonWriterOptions { get; set; }  192  193  194        /// <summary> @@ -342,21 +342,21 @@

 215        /// <returns>the encrypted re-encoded file as a string</returns>  216        public virtual String ProtectFile(String rawFileText, Regex protectRegex, Func<String, String> protectFunction)  217        { - 6218            return protectRegex.Replace(rawFileText, me => - 6219            { - 947930220                var utf8JsonReader = new Utf8JsonReader(Encoding.UTF8.GetBytes($"\"{me.Value}\"").AsSpan(), JsonReaderOp - 947930221                var reencodedJsonMemoryStream = new MemoryStream(); - 947930222                var utf8JsonWriter = new Utf8JsonWriter(reencodedJsonMemoryStream, JsonWriterOptions); - 6223 - 947930224                if (utf8JsonReader.Read()) - 6225                { - 947930226                    utf8JsonWriter.WriteStringValue(protectFunction(utf8JsonReader.GetString())); - 947930227                    utf8JsonWriter.Flush(); - 947930228                    return Encoding.UTF8.GetString(reencodedJsonMemoryStream.ToArray()).Replace("\"",String.Empty); - 6229                } - 6230                else + 10218            return protectRegex.Replace(rawFileText, me => + 10219            { + 950143220                var utf8JsonReader = new Utf8JsonReader(Encoding.UTF8.GetBytes($"\"{me.Value}\"").AsSpan(), JsonReaderOp + 950143221                var reencodedJsonMemoryStream = new MemoryStream(); + 950143222                var utf8JsonWriter = new Utf8JsonWriter(reencodedJsonMemoryStream, JsonWriterOptions); + 10223 + 950143224                if (utf8JsonReader.Read()) + 10225                { + 950143226                    utf8JsonWriter.WriteStringValue(protectFunction(utf8JsonReader.GetString())); + 950143227                    utf8JsonWriter.Flush(); + 950143228                    return Encoding.UTF8.GetString(reencodedJsonMemoryStream.ToArray()).Replace("\"",String.Empty); + 10229                } + 10230                else  0231                    throw new JsonException($"Found invalid JSON value: {me.Value}!"); - 6232            }); + 10232            });  233        }  234    }  235 @@ -450,7 +450,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectFileOptions.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectFileOptions.html index 0592739..0b116fb 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectFileOptions.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectFileOptions.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -161,12 +161,12 @@

 36        /// <summary>  37        /// Specifies the regex on the filename which if matched applies the associated FileProcessorFunction  38        /// </summary> - 1839        public Regex FilenameRegex { get; private set; } + 2239        public Regex FilenameRegex { get; private set; }  40  41        /// <summary>  42        /// Specifies the ProtectFileProcessor class implementing the <see cref="IProtectFileProcessor"/> interface used  43        /// </summary> - 1644        public IProtectFileProcessor ProtectFileProcessor { get; private set; } + 2044        public IProtectFileProcessor ProtectFileProcessor { get; private set; }  45  46  847        public ProtectFileOptions(Regex filenameRegex, IProtectFileProcessor protectFileProcessor) @@ -448,7 +448,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectProviderConfigurationData.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectProviderConfigurationData.html index b4277dc..c029a52 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectProviderConfigurationData.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectProviderConfigurationData.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -269,7 +269,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationBuilder.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationBuilder.html index 4e9a2dd..4024c44 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationBuilder.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationBuilder.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -280,7 +280,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationProvider.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationProvider.html index 81c4e42..060eb5b 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationProvider.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_ProtectedConfigurationProvider.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -154,8 +154,8 @@

 16    [DebuggerDisplay("Provider = Protected{Provider}")]  17    public class ProtectedConfigurationProvider : IConfigurationProvider, IDisposable  18    { - 638663519        protected IConfigurationProvider Provider { get; } - 816142320        protected IProtectProviderConfigurationData ProtectProviderConfigurationData { get; } + 639505619        protected IConfigurationProvider Provider { get; } + 817206520        protected IProtectProviderConfigurationData ProtectProviderConfigurationData { get; }  21  22        protected ConfigurationReloadToken ReloadToken;  23 @@ -271,21 +271,21 @@

 133            // the speed improvement is more than 3000 times!  18134            if (((dataProperty = ProviderData) != null))  135            { - 13527916136                foreach (var key in dataProperty.Keys.ToList()) + 13443936136                foreach (var key in dataProperty.Keys.ToList())  137                { - 6763940138                    if (!String.IsNullOrEmpty(dataProperty[key])) - 6386509139                        Provider.Set(key, ProtectProviderConfigurationData.ProtectedRegex.Replace(dataProperty[key], me  - 6386509140                        { - 6386509141 - 1774914142                            var subPurposePresent = !String.IsNullOrEmpty(me.Groups["subPurpose"]?.Value); - 6386509143 - 1774914144                            IProtectProvider protectProvider = ProtectProviderConfigurationData.ProtectProvider; - 6386509145 - 1774914146                            if (subPurposePresent) - 442949147                                protectProvider = protectProvider.CreateNewProviderFromSubkey(me.Groups["subPurpose"].Va - 6386509148 - 1774914149                            return protectProvider.Decrypt(me.Groups["protectedData"].Value); - 6386509150                        })); + 6721950138                    if (!String.IsNullOrEmpty(dataProperty[key])) + 6394930139                        Provider.Set(key, ProtectProviderConfigurationData.ProtectedRegex.Replace(dataProperty[key], me  + 6394930140                        { + 6394930141 + 1777135142                            var subPurposePresent = !String.IsNullOrEmpty(me.Groups["subPurpose"]?.Value); + 6394930143 + 1777135144                            IProtectProvider protectProvider = ProtectProviderConfigurationData.ProtectProvider; + 6394930145 + 1777135146                            if (subPurposePresent) + 444673147                                protectProvider = protectProvider.CreateNewProviderFromSubkey(me.Groups["subPurpose"].Va + 6394930148 + 1777135149                            return protectProvider.Decrypt(me.Groups["protectedData"].Value); + 6394930150                        }));  151                }  152            }  153            else @@ -392,7 +392,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_RawProtectFileProcessor.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_RawProtectFileProcessor.html index 154adae..4c7cfe9 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_RawProtectFileProcessor.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_RawProtectFileProcessor.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -446,7 +446,7 @@

Generated by: ReportGenerator 5.3.8.0
8/1/2024 - 5:51:37 PM
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_XmlProtectFileProcessor.html b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_XmlProtectFileProcessor.html index 4330967..cc08e02 100644 --- a/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_XmlProtectFileProcessor.html +++ b/misc/last_build_artifacts/Fededim.Extensions.Configuration.Protected_XmlProtectFileProcessor.html @@ -29,7 +29,7 @@

< Summary - Code Coverage and Repor Tag: -55_10203082220 +59_11114010885

@@ -424,33 +424,33 @@

 297            String value;  298  299            // protects all element attribute values - 2298692300            foreach (var attribute in element.Attributes()) + 2296804300            foreach (var attribute in element.Attributes())  301            { - 83620302                value = attribute.Value; - 83620303                if (protectRegex.IsMatch(value)) - 36699304                    attribute.Value = protectFunction(value); + 83393302                value = attribute.Value; + 83393303                if (protectRegex.IsMatch(value)) + 36690304                    attribute.Value = protectFunction(value);  305            }  306 - 1065726307            if (element.HasElements) + 1065009307            if (element.HasElements)  308            {  309                // recursively protects nested elements - 2431616310                foreach (var nestedElement in element.Elements()) - 1065724311                    ProtectXmlNodes(nestedElement, protectRegex, protectFunction); + 2430398310                foreach (var nestedElement in element.Elements()) + 1065007311                    ProtectXmlNodes(nestedElement, protectRegex, protectFunction);  312            }  313            else  314            {  315                // protects element value if it has no children elements - 915642316                value = element.Value; - 915642317                if (protectRegex.IsMatch(value)) - 436935318                    element.Value = protectFunction(value); + 914817316                value = element.Value; + 914817317                if (protectRegex.IsMatch(value)) + 436649318                    element.Value = protectFunction(value);  319            } - 1065726320        } + 1065009320        }  321    }  322}

- +

Methods/Properties

diff --git a/misc/last_build_artifacts/SummaryGithub.md b/misc/last_build_artifacts/SummaryGithub.md index 28aed65..b80a69d 100644 --- a/misc/last_build_artifacts/SummaryGithub.md +++ b/misc/last_build_artifacts/SummaryGithub.md @@ -3,8 +3,8 @@ ||| |:---|:---| -| Generated on: | 8/1/2024 - 5:51:37 PM | -| Coverage date: | 8/1/2024 - 5:45:02 PM - 8/1/2024 - 5:51:34 PM | +| Generated on: | 9/30/2024 - 9:00:42 PM | +| Coverage date: | 9/30/2024 - 8:59:33 PM - 9/30/2024 - 9:00:38 PM | | Parser: | MultiReport (2x Cobertura) | | Assemblies: | 2 | | Classes: | 12 | @@ -18,7 +18,7 @@ | Covered branches: | 79 | | Total branches: | 160 | | **Method coverage:** | [Feature is only available for sponsors](https://reportgenerator.io/pro) | -| Tag: | 55_10203082220 | +| Tag: | 59_11114010885 | diff --git a/misc/last_build_artifacts/TestResults-net462-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx b/misc/last_build_artifacts/TestResults-net462-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx index 28f783d..d9ef257 100644 --- a/misc/last_build_artifacts/TestResults-net462-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx +++ b/misc/last_build_artifacts/TestResults-net462-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx @@ -1,113 +1,110 @@  - - - - + + + + - + - Generated a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_1613688905.json -Size 58844KB, starting test... -8/1/2024 5:45:30 PM: Generated random JSON file (250211 entries) duration 1479ms -8/1/2024 5:45:34 PM: Encrypted random JSON file duration 4197ms -8/1/2024 5:45:35 PM: Checked that all random JSON file is encrypted duration 937ms -8/1/2024 5:45:44 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 8935ms -8/1/2024 5:45:45 PM: Checked that 250211 entries are equal duration 670ms + 9/30/2024 9:00:00 PM: Generating a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 9:00:01 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_948154301.json +9/30/2024 9:00:01 PM: Generated random JSON file (250380 entries size 59196 KB) duration 1203ms +9/30/2024 9:00:05 PM: Encrypted random JSON file (250380 entries size 90173 KB) duration 4368ms +9/30/2024 9:00:06 PM: Checked that all random JSON file is encrypted duration 871ms +9/30/2024 9:00:15 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 8735ms +9/30/2024 9:00:16 PM: Checked that 250380 entries are equal duration 688ms - + - Generated a random command line arguments with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:51:31 PM: Generated random comand line args duration 242ms -8/1/2024 5:51:32 PM: Encrypted random comand line args duration 919ms -8/1/2024 5:51:32 PM: Checked that all random comand line args are encrypted duration 57ms -8/1/2024 5:51:34 PM: Loaded and decrypted random comand line args with ProtectedConfigurationBuilder duration 1995ms -8/1/2024 5:51:34 PM: Checked that 100000 entries are equal duration 58ms + 9/30/2024 8:59:41 PM: Generating a random environment variables 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:42 PM: Starting test... +9/30/2024 8:59:42 PM: Generated random environment variables (note that Windows has a maximum size of 32KB for all environment variables, so not all 100000 keys could be created) duration 505ms +9/30/2024 8:59:43 PM: Encrypted random environment variables duration 864ms +9/30/2024 8:59:43 PM: Checked that all random environment variables are encrypted duration 3ms +9/30/2024 8:59:43 PM: Loaded and decrypted random environment variables with ProtectedConfigurationBuilder duration 43ms +9/30/2024 8:59:43 PM: Checked that 1726 entries are equal duration 0ms - + - Generated a random XML file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_700956516.xml -Size 26447KB, starting test... -8/1/2024 5:51:13 PM: Generated random XML file (246165 entries) duration 00:05:28.6938404 -8/1/2024 5:51:18 PM: Encrypted random XML file duration 4475ms -8/1/2024 5:51:19 PM: Checked that all random XML file is encrypted duration 1340ms -8/1/2024 5:51:30 PM: Loaded and decrypted random XML file with ProtectedConfigurationBuilder duration 00:00:10.5397999 -8/1/2024 5:51:30 PM: Checked that 246165 entries are equal duration 682ms + 9/30/2024 8:59:43 PM: Generating a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:45 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_2062340310.json +9/30/2024 8:59:45 PM: Generated random JSON file (249857 entries size 67823 KB) duration 1750ms +9/30/2024 8:59:48 PM: Encrypted random JSON file (249857 entries size 98748 KB) duration 3781ms +9/30/2024 8:59:49 PM: Checked that all random JSON file is encrypted duration 1010ms +9/30/2024 8:59:59 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 9471ms +9/30/2024 9:00:00 PM: Checked that 249857 entries are equal duration 823ms - + - Generated a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_1500837466.json -Size 59017KB, starting test... -8/1/2024 5:45:14 PM: Generated random JSON file (249564 entries) duration 1691ms -8/1/2024 5:45:18 PM: Encrypted random JSON file duration 3815ms -8/1/2024 5:45:19 PM: Checked that all random JSON file is encrypted duration 914ms -8/1/2024 5:45:28 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 8987ms -8/1/2024 5:45:28 PM: Checked that 249564 entries are equal duration 669ms + 9/30/2024 9:00:16 PM: Generating a random XML file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 9:00:18 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net462/random_2025896355.xml +9/30/2024 9:00:18 PM: Generated random XML file (244863 entries size 63580 KB) duration 2334ms +9/30/2024 9:00:22 PM: Encrypted random XML file (244863 entries size 94139 KB) duration 4509ms +9/30/2024 9:00:24 PM: Checked that all random XML file is encrypted duration 1298ms +9/30/2024 9:00:34 PM: Loaded and decrypted random XML file with ProtectedConfigurationBuilder duration 00:00:10.3027937 +9/30/2024 9:00:35 PM: Checked that 238567 entries are equal duration 696ms - + - Generated a random environment variables 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:45:11 PM: Generated random environment variables (note that Windows has a maximum size of 32KB for all environment variables, so not all 100000 keys could be created) duration 749ms -8/1/2024 5:45:12 PM: Encrypted random environment variables duration 1161ms -8/1/2024 5:45:12 PM: Checked that all random environment variables are encrypted duration 2ms -8/1/2024 5:45:12 PM: Loaded and decrypted random environment variables with ProtectedConfigurationBuilder duration 44ms -8/1/2024 5:45:12 PM: Checked that 1780 entries are equal duration 1ms + 9/30/2024 9:00:35 PM: Generating a random command line arguments with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 9:00:35 PM: Starting test... +9/30/2024 9:00:35 PM: Generated random comand line args duration 237ms +9/30/2024 9:00:36 PM: Encrypted random comand line args duration 907ms +9/30/2024 9:00:36 PM: Checked that all random comand line args are encrypted duration 59ms +9/30/2024 9:00:38 PM: Loaded and decrypted random comand line args with ProtectedConfigurationBuilder duration 2180ms +9/30/2024 9:00:38 PM: Checked that 100000 entries are equal duration 56ms - + - Generated a random in-memory dictionary with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:45:07 PM: Generated random in-memory dictionary duration 321ms -8/1/2024 5:45:08 PM: Encrypted random in-memory dictionary duration 1151ms -8/1/2024 5:45:08 PM: Checked that all random in-memory dictionary is encrypted duration 59ms -8/1/2024 5:45:10 PM: Loaded and decrypted random in-memory dictionary with ProtectedConfigurationBuilder duration 2102ms -8/1/2024 5:45:10 PM: Checked that 100000 entries are equal duration 56ms + 9/30/2024 8:59:37 PM: Generating a random in-memory dictionary with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:38 PM: Starting test... +9/30/2024 8:59:38 PM: Generated random in-memory dictionary duration 309ms +9/30/2024 8:59:39 PM: Encrypted random in-memory dictionary duration 1332ms +9/30/2024 8:59:39 PM: Checked that all random in-memory dictionary is encrypted duration 60ms +9/30/2024 8:59:41 PM: Loaded and decrypted random in-memory dictionary with ProtectedConfigurationBuilder duration 2116ms +9/30/2024 8:59:41 PM: Checked that 100000 entries are equal duration 54ms - + - + - + - + - + - + - - - - - - + + + + + + @@ -116,11 +113,11 @@ Starting test... - [xUnit.net 00:00:00.01] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET Framework 4.8.9256.0) -[xUnit.net 00:00:00.81] Discovering: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:00:00.94] Discovered: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:00:00.95] Starting: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:06:29.54] Finished: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest + [xUnit.net 00:00:00.03] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET Framework 4.8.9266.0) +[xUnit.net 00:00:01.29] Discovering: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:00:01.48] Discovered: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:00:01.48] Starting: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:01:04.11] Finished: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest diff --git a/misc/last_build_artifacts/TestResults-net6.0-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx b/misc/last_build_artifacts/TestResults-net6.0-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx index ba42a92..84bd5e3 100644 --- a/misc/last_build_artifacts/TestResults-net6.0-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx +++ b/misc/last_build_artifacts/TestResults-net6.0-Fededim.Extensions.Configuration.Protected.DataProtectionAPITest.trx @@ -1,113 +1,110 @@  - - - - + + + + - + - Generated a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_358764726.json -Size 57165KB, starting test... -8/1/2024 5:39:23 PM: Generated random JSON file (248452 entries) duration 1180ms -8/1/2024 5:39:26 PM: Encrypted random JSON file duration 2716ms -8/1/2024 5:39:26 PM: Checked that all random JSON file is encrypted duration 583ms -8/1/2024 5:39:31 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 4672ms -8/1/2024 5:39:31 PM: Checked that 248452 entries are equal duration 364ms + 9/30/2024 8:58:58 PM: Generating a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:58:59 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_858000299.json +9/30/2024 8:58:59 PM: Generated random JSON file (250522 entries size 63986 KB) duration 1212ms +9/30/2024 8:59:02 PM: Encrypted random JSON file (250522 entries size 95045 KB) duration 2846ms +9/30/2024 8:59:02 PM: Checked that all random JSON file is encrypted duration 666ms +9/30/2024 8:59:07 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 4854ms +9/30/2024 8:59:08 PM: Checked that 250522 entries are equal duration 391ms - + - Generated a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_1338376854.json -Size 56957KB, starting test... -8/1/2024 5:39:32 PM: Generated random JSON file (249706 entries) duration 916ms -8/1/2024 5:39:35 PM: Encrypted random JSON file duration 3050ms -8/1/2024 5:39:36 PM: Checked that all random JSON file is encrypted duration 528ms -8/1/2024 5:39:41 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 4682ms -8/1/2024 5:39:41 PM: Checked that 249706 entries are equal duration 362ms + 9/30/2024 8:58:54 PM: Generating a random in-memory dictionary with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:58:54 PM: Starting test... +9/30/2024 8:58:54 PM: Generated random in-memory dictionary duration 329ms +9/30/2024 8:58:55 PM: Encrypted random in-memory dictionary duration 1015ms +9/30/2024 8:58:55 PM: Checked that all random in-memory dictionary is encrypted duration 40ms +9/30/2024 8:58:56 PM: Loaded and decrypted random in-memory dictionary with ProtectedConfigurationBuilder duration 1133ms +9/30/2024 8:58:56 PM: Checked that 100000 entries are equal duration 34ms - + - Generated a random XML file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_220487423.xml -Size 26260KB, starting test... -8/1/2024 5:44:48 PM: Generated random XML file (245031 entries) duration 00:05:07.1497767 -8/1/2024 5:44:52 PM: Encrypted random XML file duration 3744ms -8/1/2024 5:44:53 PM: Checked that all random XML file is encrypted duration 1035ms -8/1/2024 5:45:00 PM: Loaded and decrypted random XML file with ProtectedConfigurationBuilder duration 6655ms -8/1/2024 5:45:00 PM: Checked that 245031 entries are equal duration 395ms + 9/30/2024 8:58:56 PM: Generating a random environment variables 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:58:57 PM: Starting test... +9/30/2024 8:58:57 PM: Generated random environment variables (note that Windows has a maximum size of 32KB for all environment variables, so not all 100000 keys could be created) duration 474ms +9/30/2024 8:58:58 PM: Encrypted random environment variables duration 820ms +9/30/2024 8:58:58 PM: Checked that all random environment variables are encrypted duration 2ms +9/30/2024 8:58:58 PM: Loaded and decrypted random environment variables with ProtectedConfigurationBuilder duration 23ms +9/30/2024 8:58:58 PM: Checked that 1740 entries are equal duration 0ms - + - Generated a random environment variables 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:39:21 PM: Generated random environment variables (note that Windows has a maximum size of 32KB for all environment variables, so not all 100000 keys could be created) duration 675ms -8/1/2024 5:39:22 PM: Encrypted random environment variables duration 1218ms -8/1/2024 5:39:22 PM: Checked that all random environment variables are encrypted duration 2ms -8/1/2024 5:39:22 PM: Loaded and decrypted random environment variables with ProtectedConfigurationBuilder duration 23ms -8/1/2024 5:39:22 PM: Checked that 1765 entries are equal duration 0ms + 9/30/2024 8:59:08 PM: Generating a random JSON file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:08 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_1100708482.json +9/30/2024 8:59:08 PM: Generated random JSON file (249547 entries size 63387 KB) duration 789ms +9/30/2024 8:59:11 PM: Encrypted random JSON file (249547 entries size 94291 KB) duration 3126ms +9/30/2024 8:59:12 PM: Checked that all random JSON file is encrypted duration 665ms +9/30/2024 8:59:17 PM: Loaded and decrypted random JSON file with ProtectedConfigurationBuilder duration 4706ms +9/30/2024 8:59:17 PM: Checked that 249547 entries are equal duration 394ms - + - Generated a random in-memory dictionary with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:39:18 PM: Generated random in-memory dictionary duration 231ms -8/1/2024 5:39:19 PM: Encrypted random in-memory dictionary duration 1023ms -8/1/2024 5:39:19 PM: Checked that all random in-memory dictionary is encrypted duration 39ms -8/1/2024 5:39:20 PM: Loaded and decrypted random in-memory dictionary with ProtectedConfigurationBuilder duration 1142ms -8/1/2024 5:39:20 PM: Checked that 100000 entries are equal duration 35ms + 9/30/2024 8:59:30 PM: Generating a random command line arguments with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:31 PM: Starting test... +9/30/2024 8:59:31 PM: Generated random comand line args duration 137ms +9/30/2024 8:59:31 PM: Encrypted random comand line args duration 693ms +9/30/2024 8:59:31 PM: Checked that all random comand line args are encrypted duration 37ms +9/30/2024 8:59:33 PM: Loaded and decrypted random comand line args with ProtectedConfigurationBuilder duration 1241ms +9/30/2024 8:59:33 PM: Checked that 100000 entries are equal duration 41ms - + - Generated a random command line arguments with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10 -Starting test... -8/1/2024 5:45:00 PM: Generated random comand line args duration 129ms -8/1/2024 5:45:01 PM: Encrypted random comand line args duration 745ms -8/1/2024 5:45:01 PM: Checked that all random comand line args are encrypted duration 38ms -8/1/2024 5:45:02 PM: Loaded and decrypted random comand line args with ProtectedConfigurationBuilder duration 1265ms -8/1/2024 5:45:02 PM: Checked that 100000 entries are equal duration 42ms + 9/30/2024 8:59:17 PM: Generating a random XML file with 100000 keys, autogenerated strings max length 20 and autogenerated array max length 10... +9/30/2024 8:59:19 PM: File location file://D:/a/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected/Fededim.Extensions.Configuration.Protected.DataProtectionAPITest/bin/Release/net6.0/random_249224556.xml +9/30/2024 8:59:19 PM: Generated random XML file (245857 entries size 61244 KB) duration 2025ms +9/30/2024 8:59:23 PM: Encrypted random XML file (245857 entries size 91972 KB) duration 3524ms +9/30/2024 8:59:24 PM: Checked that all random XML file is encrypted duration 1037ms +9/30/2024 8:59:30 PM: Loaded and decrypted random XML file with ProtectedConfigurationBuilder duration 6325ms +9/30/2024 8:59:30 PM: Checked that 239717 entries are equal duration 351ms - + - + - + - + - + - + - - - - - - + + + + + + @@ -116,11 +113,11 @@ Starting test... - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 6.0.32) -[xUnit.net 00:00:00.28] Discovering: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:00:00.48] Discovered: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:00:00.49] Starting: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest -[xUnit.net 00:05:45.40] Finished: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 6.0.33) +[xUnit.net 00:00:00.82] Discovering: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:00:01.26] Discovered: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:00:01.26] Starting: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest +[xUnit.net 00:00:40.48] Finished: Fededim.Extensions.Configuration.Protected.DataProtectionAPITest diff --git a/misc/last_build_artifacts/index.htm b/misc/last_build_artifacts/index.htm index 963886f..7ae3250 100644 --- a/misc/last_build_artifacts/index.htm +++ b/misc/last_build_artifacts/index.htm @@ -33,11 +33,11 @@

Summary - Code Coverage and Reports55_10203082220 +59_11114010885 Coverage date: -8/1/2024 - 5:45:02 PM - 8/1/2024 - 5:51:34 PM +9/30/2024 - 8:59:33 PM - 9/30/2024 - 9:00:38 PM

@@ -196,7 +196,7 @@

Coverage

- +