Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions cscglobal-caplugin.Tests/CSCGlobalCAPluginTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,20 @@ public async Task Enroll_RenewOrReissue_NullExpirationDate_FallsBackToGetSingleR
var result = await plugin.Enroll("csr", "CN=test", new Dictionary<string, string[]>(), productInfo,
RequestFormat.PKCS10, EnrollmentType.RenewOrReissue);

Assert.Equal((int)EndEntityStatus.EXTERNALVALIDATION, result!.Status);
mockClient.Verify(c => c.SubmitReissueAsync(It.IsAny<ReissueRequest>()), 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]
Expand Down
12 changes: 10 additions & 2 deletions cscglobal-caplugin/CSCGlobalCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,16 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
//done
public List<string> 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
Expand Down
4 changes: 2 additions & 2 deletions cscglobal-caplugin/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
}

Expand Down
31 changes: 0 additions & 31 deletions cscglobal-caplugin/RequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,39 +327,8 @@
if (productId != null && ProductIDs.legacyProductIdAliases.TryGetValue(productId, out var canonicalProductId))
{
productId = canonicalProductId;
}

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

Check failure on line 330 in cscglobal-caplugin/RequestManager.cs

View workflow job for this annotation

GitHub Actions / call-starter-workflow / call-dotnet-build-and-release-workflow / dotnet-build-and-release

} expected

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<string> MultiNameCertificateTypes = new() { "2", "6", "7", "8", "9" };
private static readonly HashSet<string> EvCertificateTypes = new() { "3", "7" };

public Notifications GetNotifications(EnrollmentProductInfo productInfo)
{
var notificationEmails = GetOptionalParam(productInfo, "Notification Email(s) Comma Separated");
Expand Down
10 changes: 9 additions & 1 deletion integration-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
}
}
Expand Down
Loading