Skip to content

Commit 80a869c

Browse files
added check for partial sync
2 parents abf0b2b + 7a79a12 commit 80a869c

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

docsource/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In order to enroll certificates the Keyfactor Command server must trust the CA c
1717

1818
## CA Connection
1919

20-
The certificate used by the gateway for authenticating into the Nexus Certificate Manager will need to be copied to a location on the Gateway Host that is accessble by the gateway service. The Certificate Path
20+
The certificate used by the gateway for authenticating into the Nexus Certificate Manager will need to be copied to a location on the Gateway Host that is accessible by the gateway service. The Certificate Path
2121

2222
## Certificate Template Creation Step
2323

nexus-certificate-manager-caplugin/NexusCertManagerCAPlugin.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public async Task<int> Revoke(string caRequestID, string hexSerialNumber, uint r
240240
}
241241

242242
/// <summary>
243-
/// Synchronize gets the list of certs from the CA and updates the status of each known cert to the latest; and adds missing cert info to the database ///
243+
/// Synchronize gets the list of certs from the CA and updates the status of each known cert to the latest, and adds missing cert info to the database.
244244
/// </summary>
245245
/// <param name="blockingBuffer">the database reader, passed by framework</param>
246246
/// <param name="lastSync">the time of last sync</param>
@@ -254,7 +254,7 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
254254

255255
try
256256
{
257-
// retreive the list of certs from Nexus CM
257+
// retrieve the list of certs from Nexus CM
258258
_logger.LogTrace("attempting to retrieve the list of cert names from Nexus CM");
259259
var certList = await _client.GetCertificateList(null, cancelToken);
260260
_logger.LogTrace($"successfully returned {certList.SearchHits} results.");
@@ -361,7 +361,7 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
361361
try
362362
{
363363
// see if we can open the file for reading..
364-
using (var fs = new FileStream((string)connectionInfo[Constants.AUTHCERTPATH], FileMode.Open, FileAccess.Read))
364+
using (var _ = new FileStream((string)connectionInfo[Constants.AUTHCERTPATH], FileMode.Open, FileAccess.Read))
365365
{
366366
// if we get this far, we can
367367
_logger.LogTrace($"successfully read the file at path {connectionInfo[Constants.AUTHCERTPATH]}");

nexus-certificate-manager-caplugin/NexusCertManagerClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Keyfactor.Extensions.CAPlugin.NexusCertManager
2222

2323
public class NexusCertManagerClient
2424
{
25-
ILogger _logger;
25+
private readonly ILogger _logger;
2626
private RestClient _restClient;
2727
private string _host;
2828
private string _authCertPath;
@@ -73,7 +73,7 @@ public NexusCertManagerClient(string hostAndPort, string authCertPath, string au
7373
{
7474
_logger.LogTrace("getting first available proc name for pkcs10 to submit with request..");
7575
var procs = await GetProceduresByMediaType(Constants.MEDIATYPE_PKCS10);
76-
procname = procs?.First();
76+
procname = procs?.FirstOrDefault();
7777
if (!string.IsNullOrEmpty(procname))
7878
{
7979
req.AddParameter("procname", procname);
@@ -91,7 +91,7 @@ public NexusCertManagerClient(string hostAndPort, string authCertPath, string au
9191
var response = await _restClient.ExecuteAsync(req, ct);
9292
_logger.LogTrace($"response status code: {response.StatusCode}");
9393
_logger.LogTrace($"response content: {response.Content}");
94-
_logger.LogTrace($"recieved a response, parsing the result");
94+
_logger.LogTrace($"received a response, parsing the result");
9595
var result = RestSharpResponseHandler.HandleCertificateBinaryResponse(response);
9696
return result;
9797
}

nexus-certificate-manager-caplugin/models/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static int GetStatusCodeFromNexusCADescription(string status)
6161
case "revoked":
6262
return (int)EndEntityStatus.REVOKED;
6363
default:
64-
return (int)EndEntityStatus.NEW; // set the status to "NEW" for any unknown description; to be evaluated as neededs
64+
return (int)EndEntityStatus.NEW; // set the status to "NEW" for any unknown description; to be evaluated as needed
6565
}
6666
}
6767

0 commit comments

Comments
 (0)