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

add syncfilter config options to annotations #15

Merged
merged 1 commit into from
Aug 28, 2024
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
25 changes: 23 additions & 2 deletions digicert-certcentral-caplugin/CertCentralCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,27 @@
DefaultValue = false,
Type = "Boolean"
},
[CertCentralConstants.Config.SYNC_CA_FILTER] = new PropertyConfigInfo()
{
Comments = "If you list one or more CA IDs here (comma-separated), the sync process will only sync records from those CAs. If you want to sync all CA IDs, leave this field empty.",
Hidden = false,
DefaultValue = "",
Type = "String"
},
[CertCentralConstants.Config.FILTER_EXPIRED] = new PropertyConfigInfo()
{
Comments = "If set to 'true', syncing will apply a filter to not return orders that are expired for longer than specified in SyncExpirationDays.",
Hidden = false,
DefaultValue = false,
Type = "Boolean"
},
[CertCentralConstants.Config.SYNC_EXPIRATION_DAYS] = new PropertyConfigInfo()
{
Comments = "If FilterExpiredOrders is set to true, this setting determines how many days in the past to still return expired orders. For example, a value of 30 means the sync will return any certs that expired within the past 30 days. A value of 0 means the sync will not return any certs that expired before the current day. This value is ignored if FilterExpiredOrders is false.",
Hidden = false,
DefaultValue = 30,
Type = "Number"
},
[CertCentralConstants.Config.ENABLED] = new PropertyConfigInfo()
{
Comments = "Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available.",
Expand Down Expand Up @@ -404,7 +425,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 428 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 428 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 428 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 428 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 Down Expand Up @@ -498,7 +519,7 @@
/// </summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task Ping()

Check warning on line 522 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 522 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 522 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 522 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 Down Expand Up @@ -540,7 +561,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 564 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 564 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 564 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 564 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 Down Expand Up @@ -600,7 +621,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 624 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 624 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 624 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 624 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 @@ -618,9 +639,9 @@
List<string> skippedOrders = new List<string>();
int certCount = 0;

string syncCAstring = string.Join(",", _config.SyncCAFilter ?? new List<string>());
string syncCAstring = _config.SyncCAFilter ?? string.Empty;
_logger.LogTrace($"Sync CAs: {syncCAstring}");
List<string> caList = _config.SyncCAFilter ?? new List<string>();
List<string> caList = _config.SyncCAs;
caList.ForEach(c => c.ToUpper());


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

Check warning on line 764 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 764 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 764 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 764 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 Down Expand Up @@ -811,7 +832,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 835 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 835 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 835 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 835 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 Down
17 changes: 15 additions & 2 deletions digicert-certcentral-caplugin/CertCentralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,27 @@ public class CertCentralConfig

public CertCentralConfig()
{
SyncCAFilter = new List<string>();
}
public string APIKey { get; set; }
public string Region { get; set; } = "US";
public int? DivisionId { get; set; }
public bool? RevokeCertificateOnly { get; set; }
public bool Enabled { get; set; } = true;
public List<string> SyncCAFilter { get; set; }
public string SyncCAFilter { get; set; }
public List<string> SyncCAs
{
get
{
if (!string.IsNullOrEmpty(SyncCAFilter))
{
return SyncCAFilter.Split(',').ToList();
}
else
{
return new List<string>();
}
}
}
public bool? FilterExpiredOrders { get; set; }
public int? SyncExpirationDays { get; set; }
}
Expand Down
3 changes: 3 additions & 0 deletions digicert-certcentral-caplugin/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class Config
public const string RENEWAL_WINDOW = "RenewalWindowDays";
public const string REVOKE_CERT = "RevokeCertificateOnly";
public const string ENABLED = "Enabled";
public const string SYNC_CA_FILTER = "SyncCAFilter";
public const string FILTER_EXPIRED = "FilterExpiredOrders";
public const string SYNC_EXPIRATION_DAYS = "SyncExpirationDays";
}

public class RequestAttributes
Expand Down
Loading