diff --git a/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs b/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs index 16fd258..4ae771b 100644 --- a/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs +++ b/cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs @@ -633,8 +633,20 @@ public async Task Enroll_RenewOrReissue_NullExpirationDate_FallsBackToGetSingleR var result = await plugin.Enroll("csr", "CN=test", new Dictionary(), productInfo, RequestFormat.PKCS10, EnrollmentType.RenewOrReissue); - Assert.Equal((int)EndEntityStatus.EXTERNALVALIDATION, result!.Status); - mockClient.Verify(c => c.SubmitReissueAsync(It.IsAny()), Times.Once); + [Fact] + public void GetProductIds_ReturnsCanonicalAndLegacyNames() + { + var plugin = MakePlugin(); + var ids = plugin.GetProductIds(); + + // Command uses this list to auto-resolve a CA for a template when none is explicitly + // selected, so pre-1.2.0 legacy-named templates need their names advertised here too, + // not just the 10 canonical names. + Assert.Equal(17, ids.Count); + Assert.Contains("CSC TrustedSecure OV", ids); + Assert.Contains("CSC TrustedSecure DV Wildcard, Multiple Names", ids); + Assert.Contains("CSC TrustedSecure EV Certificate", ids); + Assert.Contains("CSC TrustedSecure Domain Validated SSL", ids); } [Fact] diff --git a/cscglobal-caplugin/CSCGlobalCAPlugin.cs b/cscglobal-caplugin/CSCGlobalCAPlugin.cs index 33d2306..c7c62cb 100644 --- a/cscglobal-caplugin/CSCGlobalCAPlugin.cs +++ b/cscglobal-caplugin/CSCGlobalCAPlugin.cs @@ -845,8 +845,16 @@ public Dictionary GetTemplateParameterAnnotations() //done public List GetProductIds() { - - return ProductIDs.productIds; + // Command uses this list to auto-resolve a CA for a template when none is explicitly + // selected (matches a template's product ID against each CA's advertised list). Existing + // Certificate Templates created before the 1.2.0 product rename are still configured with + // the pre-1.2.0 legacy names, so those must be advertised here too, or auto-resolution + // fails for them with "No CA was found to issue the specified template" even though + // explicit CA selection still works (that path goes through the more lenient + // ValidateProductInfo, which already accepts legacy names via legacyProductIdAliases). + return ProductIDs.productIds + .Concat(ProductIDs.legacyProductIdAliases.Keys) + .ToList(); } #region PRIVATE diff --git a/cscglobal-caplugin/Constants.cs b/cscglobal-caplugin/Constants.cs index f013902..982ed23 100644 --- a/cscglobal-caplugin/Constants.cs +++ b/cscglobal-caplugin/Constants.cs @@ -44,8 +44,8 @@ public class ProductIDs ["CSC TrustedSecure UC Certificate"] = "CSC TrustedSecure OV, Multiple Names", ["CSC TrustedSecure EV Certificate"] = "CSC TrustedSecure EV", ["CSC TrustedSecure Domain Validated SSL"] = "CSC TrustedSecure DV", - ["CSC TrustedSecure Domain Validated Wildcard SSL"] = "CSC TrustedSecure DV Wildcard", - ["CSC TrustedSecure Domain Validated UC Certificate"] = "CSC TrustedSecure DV, Multiple Names" + ["CSC Trusted Secure Domain Validated Wildcard SSL"] = "CSC TrustedSecure DV Wildcard", + ["CSC Trusted Secure Domain Validated UC Certificate"] = "CSC TrustedSecure DV, Multiple Names" }; } diff --git a/cscglobal-caplugin/RequestManager.cs b/cscglobal-caplugin/RequestManager.cs index 06f0b41..0c485ff 100644 --- a/cscglobal-caplugin/RequestManager.cs +++ b/cscglobal-caplugin/RequestManager.cs @@ -329,37 +329,6 @@ private string GetCertificateType(string productId) productId = canonicalProductId; } - switch (productId) - { - case "CSC TrustedSecure OV": - return "0"; - case "CSC TrustedSecure OV Wildcard": - return "1"; - case "CSC TrustedSecure OV, Multiple Names": - return "2"; - case "CSC TrustedSecure EV": - return "3"; - case "CSC TrustedSecure DV": - return "4"; - case "CSC TrustedSecure DV Wildcard": - return "5"; - case "CSC TrustedSecure DV, Multiple Names": - return "6"; - case "CSC TrustedSecure EV, Multiple Names": - return "7"; - case "CSC TrustedSecure OV Wildcard, Multiple Names": - return "8"; - case "CSC TrustedSecure DV Wildcard, Multiple Names": - return "9"; - } - - Logger.LogWarning($"Unrecognized product ID '{productId}'; defaulting certificate type to -1"); - return "-1"; - } - - private static readonly HashSet MultiNameCertificateTypes = new() { "2", "6", "7", "8", "9" }; - private static readonly HashSet EvCertificateTypes = new() { "3", "7" }; - public Notifications GetNotifications(EnrollmentProductInfo productInfo) { var notificationEmails = GetOptionalParam(productInfo, "Notification Email(s) Comma Separated"); diff --git a/integration-manifest.json b/integration-manifest.json index 9ae70c7..5b44242 100644 --- a/integration-manifest.json +++ b/integration-manifest.json @@ -5,6 +5,7 @@ "support_level": "kf-supported", "status": "pilot", "link_github": true, + "status": "production", "update_catalog": true, "description": "CSCGlobal CAPlugin for the AnyCA REST Gateway framework", "gateway_framework": "24.2.0", @@ -94,7 +95,14 @@ "CSC TrustedSecure DV, Multiple Names", "CSC TrustedSecure EV, Multiple Names", "CSC TrustedSecure OV Wildcard, Multiple Names", - "CSC TrustedSecure DV Wildcard, Multiple Names" + "CSC TrustedSecure DV Wildcard, Multiple Names", + "CSC TrustedSecure Premium Certificate", + "CSC TrustedSecure EV Certificate", + "CSC TrustedSecure UC Certificate", + "CSC TrustedSecure Premium Wildcard Certificate", + "CSC TrustedSecure Domain Validated SSL", + "CSC Trusted Secure Domain Validated Wildcard SSL", + "CSC Trusted Secure Domain Validated UC Certificate" ] } }