Skip to content

Commit 8a8c3c4

Browse files
authored
Merge branch '2.6_Document_Updates' into ab#67005-migration-script-fix
2 parents f20b5dd + f3de7ce commit 8a8c3c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3597
-3290
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
2.5.2
1+
2.6.1
2+
* documentation updates for the 2.6 release
23
* fix a naming typo in the 2.5 migration SQL script
3-
* remove a field from the integration-manifest.json
4+
* update integration-manifest.json
5+
6+
2.6.0
7+
* Added the ability to run the extension in a Linux environment. To utilize this change, for each Cert Store Types (WinCert/WinIIS/WinSQL), add ssh to the Custom Field <b>WinRM Protocol</b>. When using ssh as a protocol, make sure to enter the appropriate ssh port number under WinRM Port.
8+
* NOTE: For legacy purposes the Display names WinRM Protocol and WinRM Port are maintained although the type of protocols now includes ssh.
9+
* Moved all inventory and management jobs to external PowerShell script file .\PowerShellScripts\WinCertScripts.ps1
410

511
2.5.1
612
* Fixed WinSQL service name when InstanceID differs from InstanceName

IISU/Certificate.cs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// 021225 rcp 2.6.0 Cleaned up and verified code
16+
17+
using Newtonsoft.Json;
1518
using System;
16-
using System.Linq;
17-
using System.Text.RegularExpressions;
19+
using System.Collections.Generic;
1820

1921
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
2022
{
@@ -29,30 +31,27 @@ public class Certificate
2931

3032
public class Utilities
3133
{
32-
public static string FormatSAN(string san)
34+
public static List<T> DeserializeCertificates<T>(string jsonResults)
3335
{
34-
// Use regular expression to extract key-value pairs
35-
var regex = new Regex(@"(?<key>DNS Name|Email|IP Address)=(?<value>[^=,\s]+)");
36-
var matches = regex.Matches(san);
37-
38-
// Format matches into the desired format
39-
string result = string.Join("&", matches.Cast<Match>()
40-
.Select(m => $"{NormalizeKey(m.Groups["key"].Value)}={m.Groups["value"].Value}"));
41-
42-
return result;
43-
}
36+
if (string.IsNullOrEmpty(jsonResults))
37+
{
38+
// Handle no objects returned
39+
return new List<T>();
40+
}
4441

45-
private static string NormalizeKey(string key)
46-
{
47-
return key.ToLower() switch
42+
// Determine if the JSON is an array or a single object
43+
if (jsonResults.TrimStart().StartsWith("["))
4844
{
49-
"dns name" => "dns",
50-
"email" => "email",
51-
"ip address" => "ip",
52-
_ => key.ToLower() // For other types, keep them as-is
53-
};
45+
// It's an array, deserialize as list
46+
return JsonConvert.DeserializeObject<List<T>>(jsonResults);
47+
}
48+
else
49+
{
50+
// It's a single object, wrap it in a list
51+
var singleObject = JsonConvert.DeserializeObject<T>(jsonResults);
52+
return new List<T> { singleObject };
53+
}
5454
}
55-
5655
}
5756
}
5857
}

IISU/CertificateStore.cs

Lines changed: 0 additions & 211 deletions
This file was deleted.

IISU/ClientPSCertStoreInventory.cs

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)