Skip to content

Merge to main#44

Closed
indrora wants to merge 24 commits intomainfrom
dev-2.2
Closed

Merge to main#44
indrora wants to merge 24 commits intomainfrom
dev-2.2

Conversation

@indrora
Copy link
Member

@indrora indrora commented Feb 12, 2026

Merge dev-2.2 to main - Automated PR

Copilot AI review requested due to automatic review settings February 12, 2026 12:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Merge of dev-2.2 into main, adding support for DigiCert certificate duplication and additional enrollment/sync behaviors.

Changes:

  • Add “Duplicate” renewal behavior and client auth EKU option for SSL enrollments.
  • Adjust SMIME profile type defaults and tighten incremental sync date range behavior.
  • Update documentation/manifest and bump assembly/file versions.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
integration-manifest.json Adds IncludeClientAuthEKU param and updates ProfileType description.
docsource/configuration.md Documents how to enable “Duplicate” behavior via enrollment fields.
digicert-certcentral-caplugin/digicert-certcentral-caplugin.csproj Adds explicit AssemblyVersion/FileVersion.
digicert-certcentral-caplugin/Models/CertCentralCertType.cs Removes cached cert type lookups; always retrieves from API.
digicert-certcentral-caplugin/Constants.cs Adds config keys for Duplicate and IncludeClientAuthEKU.
digicert-certcentral-caplugin/Client/CertCentralClient.cs Adds client method to call DigiCert “duplicate” endpoint.
digicert-certcentral-caplugin/CertCentralCAPlugin.cs Implements duplicate flow, client auth EKU option, sync window logic, and SMIME profile handling.
digicert-certcentral-caplugin/API/OrderCertificate.cs Adds profile_option field to certificate request model.
digicert-certcentral-caplugin/API/Duplicate.cs Introduces request/response models for duplication calls.
README.md Documents IncludeClientAuthEKU and “Certificate Duplicates”.
CHANGELOG.md Adds entries through 2.2.0 describing the new features/fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +298 to +299
if (typeOfCert.Equals("ssl") && Convert.ToBoolean(productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH]))
{
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH] is accessed without checking the key exists, which can throw KeyNotFoundException when the flag isn’t provided. Consider guarding with ContainsKey and parsing via bool.TryParse (or using a safe default of false) so missing/invalid values don’t crash enrollment.

Suggested change
if (typeOfCert.Equals("ssl") && Convert.ToBoolean(productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH]))
{
bool includeClientAuth = false;
if (productInfo.ProductParameters.ContainsKey(CertCentralConstants.Config.INCLUDE_CLIENT_AUTH))
{
var includeClientAuthRaw = productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH];
if (!bool.TryParse(Convert.ToString(includeClientAuthRaw), out includeClientAuth))
{
_logger.LogWarning($"Could not parse '{CertCentralConstants.Config.INCLUDE_CLIENT_AUTH}' field as true or false. Treating as false. Value: {includeClientAuthRaw}");
includeClientAuth = false;
}
}
if (typeOfCert.Equals("ssl") && includeClientAuth)
{

Copilot uses AI. Check for mistakes.
public OrderResponse DuplicateCertificate(DuplicateRequest request)
{
string jsonRequest = JsonConvert.SerializeObject(request, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
Logger.LogTrace($"Duplicate request:\n{jsonRequest}");
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging the full serialized duplicate request can leak sensitive material (notably the CSR and potentially subject/SANs) into logs. Recommend redacting/omitting sensitive fields (e.g., certificate.csr) or logging only non-sensitive identifiers (order id, product id, CN) at trace level.

Suggested change
Logger.LogTrace($"Duplicate request:\n{jsonRequest}");
Logger.LogTrace("Duplicate certificate request initiated.");

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +10
<AssemblyVersion>2.1.2</AssemblyVersion>
<FileVersion>2.1.2</FileVersion>
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assembly/file version is set to 2.1.2, but the changelog in this PR includes 2.2.0 with the new duplicate feature. Align the project’s versioning with the release being merged (and consider setting Version/PackageVersion as well if this is packed/published), to avoid shipping 2.2.0 behavior under a 2.1.2 assembly version.

Suggested change
<AssemblyVersion>2.1.2</AssemblyVersion>
<FileVersion>2.1.2</FileVersion>
<AssemblyVersion>2.2.0</AssemblyVersion>
<FileVersion>2.2.0</FileVersion>
<Version>2.2.0</Version>
<PackageVersion>2.2.0</PackageVersion>

Copilot uses AI. Check for mistakes.
_logger.MethodEntry(LogLevel.Trace);

lastSync = lastSync.HasValue ? lastSync.Value.AddHours(-7) : DateTime.MinValue; // DigiCert issue with treating the timezone as mountain time. -7 to accomodate DST
// DigiCert issue with treating the timezone as mountain time. -7 hours to accomodate DST
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct spelling in comment: “accomodate” → “accommodate”.

Suggested change
// DigiCert issue with treating the timezone as mountain time. -7 hours to accomodate DST
// DigiCert issue with treating the timezone as mountain time. -7 hours to accommodate DST

Copilot uses AI. Check for mistakes.
throw new Exception($"Unexpected error downloading certificate {certId} for order {orderId}: {certificateChainResponse.Errors.FirstOrDefault()?.message}");
}
}
//Another check for duplicate PEMs to get arround issue with DigiCert API returning incorrect data sometimes on reissued/duplicate certs
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct spelling in comment: “arround” → “around”.

Suggested change
//Another check for duplicate PEMs to get arround issue with DigiCert API returning incorrect data sometimes on reissued/duplicate certs
//Another check for duplicate PEMs to get around issue with DigiCert API returning incorrect data sometimes on reissued/duplicate certs

Copilot uses AI. Check for mistakes.
Comment on lines 1629 to +1630
List<AnyCAPluginCertificate> certList = new List<AnyCAPluginCertificate>();
List<string> pemList = new List<string>();
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pemList.Contains(...) inside the loop makes duplicate detection O(n²) as the number of certs grows. Use a HashSet<string> for pemList to get O(1) lookups and simplify the “contains then add” logic.

Copilot uses AI. Check for mistakes.
Comment on lines +1652 to +1658
//Another check for duplicate PEMs to get arround issue with DigiCert API returning incorrect data sometimes on reissued/duplicate certs
if (pemList.Contains(certificate))
{
_logger.LogWarning($"Found duplicate PEM for ID {caReqId}. Skipping...");
continue;
}
pemList.Add(certificate);
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pemList.Contains(...) inside the loop makes duplicate detection O(n²) as the number of certs grows. Use a HashSet<string> for pemList to get O(1) lookups and simplify the “contains then add” logic.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new file includes unused using directives (System.Linq, System.Text, System.Threading.Tasks aren’t used in the shown code). Removing them reduces clutter and avoids warnings (especially if warnings are treated as errors in CI).

Suggested change
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Copilot uses AI. Check for mistakes.
@indrora indrora closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants