Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log subject and sans on enroll call #17

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
6 changes: 6 additions & 0 deletions digicert-certcentral-caplugin/CertCentralCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
public async Task<EnrollmentResult> Enroll(string csr, string subject, Dictionary<string, string[]> san, EnrollmentProductInfo productInfo, RequestFormat requestFormat, EnrollmentType enrollmentType)
{
_logger.MethodEntry(LogLevel.Trace);
_logger.LogDebug($"Enrolling for certificate with subject {subject}");
foreach (var sanlist in san)
{
string sans = string.Join(",", sanlist.Value);
_logger.LogDebug($"SANs type \"{sanlist.Key}\": {sans}");
}
OrderResponse orderResponse = new OrderResponse();
CertCentralCertType certType = CertCentralCertType.GetAllTypes(_config).FirstOrDefault(x => x.ProductCode.Equals(productInfo.ProductID));
OrderRequest orderRequest = new OrderRequest(certType);
Expand Down Expand Up @@ -404,7 +410,7 @@
/// </summary>
/// <param name="caRequestID">The gateway request ID of the record to retrieve, in the format 'orderID-certID'</param>
/// <returns></returns>
public async Task<AnyCAPluginCertificate> GetSingleRecord(string caRequestID)

Check warning on line 413 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 413 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);
// Split ca request id into order and cert id
Expand All @@ -426,7 +432,7 @@
if (status == (int)EndEntityStatus.GENERATED || status == (int)EndEntityStatus.REVOKED)
{
// We have a status where there may be a cert to download, try to download it
CertificateChainResponse certificateChainResponse = client.GetCertificateChain(new CertificateChainRequest(certId));

Check warning on line 435 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 435 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
if (certificateChainResponse.Status == CertCentralBaseResponse.StatusType.SUCCESS)
{
if (certificateChainResponse.Intermediates.Count > 0)
Expand Down Expand Up @@ -498,7 +504,7 @@
/// </summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task Ping()

Check warning on line 507 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 507 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);
if (!_config.Enabled)
Expand All @@ -520,7 +526,7 @@
{
throw new Exception($"Error attempting to ping DigiCert: {string.Join("\n", response.Errors)}");
}

Check warning on line 529 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 529 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
_logger.LogDebug("Successfully pinged DigiCert API.");
}
catch (Exception e)
Expand All @@ -540,7 +546,7 @@
/// <returns></returns>
/// <exception cref="COMException"></exception>
/// <exception cref="Exception"></exception>
public async Task<int> Revoke(string caRequestID, string hexSerialNumber, uint revocationReason)

Check warning on line 549 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 549 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);
int orderId = Int32.Parse(caRequestID.Substring(0, caRequestID.IndexOf('-')));
Expand All @@ -562,7 +568,7 @@
_logger.LogTrace("Making request to Revoke");
RevokeCertificateResponse revokeResponse;
if (_config.RevokeCertificateOnly.HasValue && _config.RevokeCertificateOnly.Value)
{

Check warning on line 571 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 571 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
_logger.LogInformation($"Attempting to revoke certificate with CA Request Id {caRequestID} and serial number {hexSerialNumber}. RevokeCertificateOnly is true, so revoking single certificate.");
revokeResponse = client.RevokeCertificate(new RevokeCertificateRequest(certId) { comments = Conversions.RevokeReasonToString(revocationReason) });
}
Expand Down Expand Up @@ -600,7 +606,7 @@
/// <param name="cancelToken"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockingBuffer, DateTime? lastSync, bool fullSync, CancellationToken cancelToken)

Check warning on line 609 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 609 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);

Expand All @@ -622,7 +628,7 @@
_logger.LogTrace($"Sync CAs: {syncCAstring}");
List<string> caList = _config.SyncCAFilter ?? new List<string>();
caList.ForEach(c => c.ToUpper());

Check warning on line 631 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 631 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

if (fullSync)
{
Expand Down Expand Up @@ -740,7 +746,7 @@
/// </summary>
/// <param name="connectionInfo"></param>
/// <returns></returns>
public async Task ValidateCAConnectionInfo(Dictionary<string, object> connectionInfo)

Check warning on line 749 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 749 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);
try
Expand All @@ -763,7 +769,7 @@
string apiKey = connectionInfo.ContainsKey(CertCentralConstants.Config.APIKEY) ? (string)connectionInfo[CertCentralConstants.Config.APIKEY] : string.Empty;
if (string.IsNullOrWhiteSpace(apiKey))
{
errors.Add("The API Key is required.");

Check warning on line 772 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 772 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
}

_logger.LogTrace("Checking the region.");
Expand Down Expand Up @@ -811,7 +817,7 @@
/// <param name="connectionInfo"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary<string, object> connectionInfo)

Check warning on line 820 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 820 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
_logger.MethodEntry(LogLevel.Trace);
// Set up.
Expand All @@ -834,7 +840,7 @@
CertificateTypesResponse productIdResponse = client.GetAllCertificateTypes();
if (productIdResponse.Status != CertCentralBaseResponse.StatusType.SUCCESS)
{
throw new AnyCAValidationException($"The product types could not be retrieved from the server. The following errors occurred: {string.Join(" ", productIdResponse.Errors.Select(x => x.message))}");

Check warning on line 843 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 843 in digicert-certcentral-caplugin/CertCentralCAPlugin.cs

View workflow job for this annotation

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

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
}

// Get product and check if it exists.
Expand Down
Loading