From f38db6c0af970572d3d1325008b12de0b2160c47 Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Wed, 29 Oct 2025 11:01:50 -0400 Subject: [PATCH 1/7] assigning _certificateDataReader in initialize method --- hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs index 597cf95..1acd3e4 100644 --- a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs +++ b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs @@ -54,6 +54,7 @@ public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDa _caConfig = JsonSerializer.Deserialize(rawConfig); logger.MethodExit(LogLevel.Trace); _client = new HashicorpVaultClient(_caConfig); + _certificateDataReader = certificateDataReader; } /// From d730756da76629172a2e2a7792d2306f20e4e984 Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Wed, 29 Oct 2025 11:04:26 -0400 Subject: [PATCH 2/7] updated CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d155a..2786a1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.0.2 +* bug fix: _certDataReader is now initialized in the Initialize method + ## 1.0.1 * added retrieval of roles associated with enrolled certificates via metadata for Vault Enterprise users From c9bc2bb5d874513fefbc8903824138636c1c8c7f Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Wed, 29 Oct 2025 11:13:17 -0400 Subject: [PATCH 3/7] added additional logging in getCertificate --- hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs b/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs index 8edb068..2a9d69c 100644 --- a/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs +++ b/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs @@ -133,6 +133,10 @@ public async Task GetCertificate(string certSerial) { var response = await _vaultHttp.GetAsync($"cert/{certSerial}"); logger.LogTrace($"successfully received a response for certificate with serial number: {certSerial}"); + logger.LogTrace($"--response data--"); + logger.LogTrace($"cert string: {response.Certificate}"); + logger.LogTrace($"revocation time: {response.RevocationTime}"); + return response; } catch (Exception ex) From cf0070447d3ad5ed69fb8e66766029632126ea51 Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Mon, 10 Nov 2025 10:48:33 -0500 Subject: [PATCH 4/7] added additional logging for troubleshooting. --- .../Client/HashicorpVaultClient.cs | 8 +++-- hashicorp-vault-cagateway/Client/VaultHttp.cs | 33 ++++++++++++------- .../HashicorpVaultCAConnector.cs | 14 ++++---- .../hashicorp-vault-caplugin.csproj | 1 + readme_source.md | 2 +- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs b/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs index 2a9d69c..e565c6d 100644 --- a/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs +++ b/hashicorp-vault-cagateway/Client/HashicorpVaultClient.cs @@ -132,10 +132,12 @@ public async Task GetCertificate(string certSerial) try { var response = await _vaultHttp.GetAsync($"cert/{certSerial}"); + logger.LogTrace($"successfully received a response for certificate with serial number: {certSerial}"); logger.LogTrace($"--response data--"); logger.LogTrace($"cert string: {response.Certificate}"); logger.LogTrace($"revocation time: {response.RevocationTime}"); + return response; } @@ -193,7 +195,7 @@ public async Task PingServer() } /// - /// Retreives all serial numbers for issued certificates + /// Retrieves all serial numbers for issued certificates /// /// a list of the certificate serial number strings public async Task> GetAllCertSerialNumbers() @@ -251,7 +253,7 @@ public async Task> GetRoleNamesAsync() } /// - /// Retreives the metadata for the certificate + /// Retrieves the metadata for the certificate /// /// /// @@ -279,7 +281,7 @@ public async Task GetCertMetadata(string certSerial) } catch (Exception ex) { - logger.LogError($"an error occurred when attempting to retreive the certificate metadata: {ex.Message}"); + logger.LogError($"an error occurred when attempting to retrieve the certificate metadata: {ex.Message}"); throw; } finally { logger.MethodExit(); } diff --git a/hashicorp-vault-cagateway/Client/VaultHttp.cs b/hashicorp-vault-cagateway/Client/VaultHttp.cs index fda1eb2..94cc489 100644 --- a/hashicorp-vault-cagateway/Client/VaultHttp.cs +++ b/hashicorp-vault-cagateway/Client/VaultHttp.cs @@ -8,6 +8,7 @@ using Keyfactor.Extensions.CAPlugin.HashicorpVault.APIProxy; using Keyfactor.Logging; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using RestSharp; using RestSharp.Serializers.Json; using System; @@ -15,6 +16,7 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; +using JsonSerializer = Newtonsoft.Json.JsonSerializer; namespace Keyfactor.Extensions.CAPlugin.HashicorpVault.Client { @@ -35,13 +37,13 @@ public VaultHttp(string host, string mountPoint, string authToken, string nameSp _serializerOptions = new() { - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, + DefaultIgnoreCondition = JsonIgnoreCondition.Never, RespectNullableAnnotations = true, PropertyNameCaseInsensitive = true, - PreferredObjectCreationHandling = JsonObjectCreationHandling.Replace, + PreferredObjectCreationHandling = JsonObjectCreationHandling.Replace }; - var restClientOptions = new RestClientOptions($"{host.TrimEnd('/')}/v1") { ThrowOnAnyError = true }; + var restClientOptions = new RestClientOptions($"{host.TrimEnd('/')}/v1") { ThrowOnAnyError = true }; _restClient = new RestClient(restClientOptions, configureSerialization: s => s.UseSystemTextJson(_serializerOptions)); _mountPoint = mountPoint.TrimStart('/').TrimEnd('/'); // remove leading and trailing slashes @@ -69,19 +71,28 @@ public VaultHttp(string host, string mountPoint, string authToken, string nameSp public async Task GetAsync(string path, Dictionary parameters = null) { logger.MethodEntry(); - logger.LogTrace($"preparing to send GET request to {path} with parameters {JsonSerializer.Serialize(parameters)}"); - logger.LogTrace($"will attempt to deserialize the response into a {typeof(T)}"); + logger.LogTrace($"preparing to send GET request to {path} with parameters {JsonConvert.SerializeObject(parameters)}"); + try { var request = new RestRequest($"{_mountPoint}/{path}", Method.Get); - if (parameters != null) { request.AddJsonBody(parameters); } - - var response = await _restClient.ExecuteGetAsync(request); + if (parameters != null && parameters.Keys.Count > 0) { request.AddJsonBody(parameters); } + var response = await _restClient.ExecuteGetAsync(request); + logger.LogTrace($"raw response: {response.Content}"); + logger.LogTrace($"response status: {response.StatusCode}"); + + logger.LogTrace($"response error msg: {response.ErrorMessage}"); + response.ThrowIfError(); + if (string.IsNullOrEmpty(response.Content)) throw new Exception(response.ErrorMessage ?? "no content returned from Vault"); - return response.Data; + logger.LogTrace($"deserializing the response into a {typeof(T)}"); + var serialized = JsonConvert.DeserializeObject(response.Content); + + logger.LogTrace($"successfully deserialized the reponse"); + return serialized; } catch (Exception ex) { @@ -108,7 +119,7 @@ public async Task PostAsync(string path, dynamic parameters = default) var request = new RestRequest(resourcePath, Method.Post); if (parameters != null) { - string serializedParams = JsonSerializer.Serialize(parameters, _serializerOptions); + string serializedParams = JsonConvert.SerializeObject(parameters); logger.LogTrace($"serialized parameters (from {parameters.GetType()?.Name}): {serializedParams}"); request.AddJsonBody(serializedParams); } @@ -127,7 +138,7 @@ public async Task PostAsync(string path, dynamic parameters = default) if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) { - errorResponse = JsonSerializer.Deserialize(response.Content!); + errorResponse = JsonConvert.DeserializeObject(response.Content ?? "no content"); string allErrors = "(Bad Request)"; if (errorResponse?.Errors.Count > 0) { diff --git a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs index 1acd3e4..a38c09d 100644 --- a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs +++ b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs @@ -240,7 +240,7 @@ public async Task Synchronize(BlockingCollection blockin } catch (Exception ex) { - logger.LogError($"failed to retreive serial numbers: {LogHandler.FlattenException(ex)}"); + logger.LogError($"failed to retrieve serial numbers: {LogHandler.FlattenException(ex)}"); throw; } @@ -251,7 +251,7 @@ public async Task Synchronize(BlockingCollection blockin CertResponse certFromVault = null; var dbStatus = -1; - // first, retreive the details from Vault + // first, retrieve the details from Vault try { logger.LogTrace($"Calling GetCertificate on our client, passing serial number: {certSerial}"); @@ -259,7 +259,7 @@ public async Task Synchronize(BlockingCollection blockin } catch (Exception ex) { - logger.LogError($"Failed to retreive details for certificate with serial number {certSerial} from Vault. Errors: {LogHandler.FlattenException(ex)}"); + logger.LogError($"Failed to retrieve details for certificate with serial number {certSerial} from Vault. Errors: {LogHandler.FlattenException(ex)}"); throw; } logger.LogTrace($"converting {certSerial} to database trackingId"); @@ -269,7 +269,7 @@ public async Task Synchronize(BlockingCollection blockin // then, check for an existing local entry try { - logger.LogTrace($"attempting to retreive status of cert with tracking id {trackingId} from the database"); + logger.LogTrace($"attempting to retrieve status of cert with tracking id {trackingId} from the database"); dbStatus = await _certificateDataReader.GetStatusByRequestID(trackingId); } catch @@ -281,7 +281,7 @@ public async Task Synchronize(BlockingCollection blockin { logger.LogTrace($"adding cert with serial {trackingId} to the database. fullsync is {fullSync}, and the certificate {(dbStatus == -1 ? "does not yet exist" : "already exists")} in the database."); - logger.LogTrace("attempting to retreive the role name (productId) from the certificate metadata, if available"); + logger.LogTrace("attempting to retrieve the role name (productId) from the certificate metadata, if available"); var metaData = new MetadataResponse(); @@ -291,7 +291,7 @@ public async Task Synchronize(BlockingCollection blockin } catch (Exception) { - logger.LogTrace("an error occurred when attempting to retreive the metadata, continuing.."); + logger.LogTrace("an error occurred when attempting to retrieve the metadata, continuing.."); } var newCert = new AnyCAPluginCertificate @@ -423,7 +423,7 @@ public async Task ValidateCAConnectionInfo(Dictionary connection _client = new HashicorpVaultClient(config); - // attempt an authenticated request to retreive role names + // attempt an authenticated request to retrieve role names try { logger.LogTrace("making an authenticated request to the Vault server to verify credentials (listing role names).."); diff --git a/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj b/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj index 95991b8..c9566c1 100644 --- a/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj +++ b/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj @@ -37,6 +37,7 @@ + diff --git a/readme_source.md b/readme_source.md index 2b54786..836a7bb 100644 --- a/readme_source.md +++ b/readme_source.md @@ -95,7 +95,7 @@ Certificates issued for the Hashicorp Vault CA from within the Keyfactor Command 1. Create an entry for each of the PKI secrets engine roles you would like to use for issuing certificates from the Hashicorp Vault CA. 1. Navigate to the "Certificate Authorities" tab and click "Edit" 1. In the "Edit CA" window, navigate to the "Templates" tab. - 1. Create an association between each of the certificate profiles we just created with the PKI secrets engine roles retreived from Vault. + 1. Create an association between each of the certificate profiles we just created with the PKI secrets engine roles retrieved from Vault. ### Configure the CA in Keyfactor Command From c6d7450a24f203074421c1101988cccd1efe8f51 Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Thu, 13 Nov 2025 12:20:47 -0500 Subject: [PATCH 5/7] added a tracelog in the initialize method that should log the current version of the integration --- .../HashicorpVaultCAConnector.cs | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs index a38c09d..a956754 100644 --- a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs +++ b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs @@ -18,6 +18,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using System.Reflection; namespace Keyfactor.Extensions.CAPlugin.HashicorpVault { @@ -50,11 +51,22 @@ public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDa { logger.MethodEntry(LogLevel.Trace); string rawConfig = JsonSerializer.Serialize(configProvider.CAConnectionData); - logger.LogTrace($"serialized config: {rawConfig}"); _caConfig = JsonSerializer.Deserialize(rawConfig); logger.MethodExit(LogLevel.Trace); _client = new HashicorpVaultClient(_caConfig); _certificateDataReader = certificateDataReader; + + Assembly targetAssembly = typeof(HashicorpVaultCAConnector).Assembly; + + // Get the AssemblyName object + AssemblyName assemblyName = targetAssembly?.GetName(); + + // Get the Version object + Version version = assemblyName?.Version; + + logger.LogTrace($"-- {assemblyName?.Name ?? "unknown"} v{version} --"); + + logger.LogTrace($"serialized config: {rawConfig}"); } /// @@ -264,7 +276,7 @@ public async Task Synchronize(BlockingCollection blockin } logger.LogTrace($"converting {certSerial} to database trackingId"); - var trackingId = certSerial.Replace(":", "-"); // we store with '-'; hashi stores with ':' + var trackingId = certSerial.Replace(":", "-"); // we store with '-'; hashi stores with ':' // then, check for an existing local entry try @@ -284,12 +296,12 @@ public async Task Synchronize(BlockingCollection blockin logger.LogTrace("attempting to retrieve the role name (productId) from the certificate metadata, if available"); var metaData = new MetadataResponse(); - + try { metaData = await _client.GetCertMetadata(certSerial); } - catch (Exception) + catch (Exception) { logger.LogTrace("an error occurred when attempting to retrieve the metadata, continuing.."); } @@ -299,11 +311,11 @@ public async Task Synchronize(BlockingCollection blockin CARequestID = trackingId, Certificate = certFromVault.Certificate, Status = certFromVault.RevocationTime != null ? (int)EndEntityStatus.REVOKED : (int)EndEntityStatus.GENERATED, - RevocationDate = certFromVault.RevocationTime, + RevocationDate = certFromVault.RevocationTime, }; // if we were able to get the role name from metadata, we include it - if (!string.IsNullOrEmpty(metaData?.Role)) + if (!string.IsNullOrEmpty(metaData?.Role)) { newCert.ProductID = metaData.Role; } @@ -347,7 +359,7 @@ public async Task Synchronize(BlockingCollection blockin /// /// The information used to connect to the CA. public async Task ValidateCAConnectionInfo(Dictionary connectionInfo) - { + { logger.MethodEntry(); logger.LogTrace(message: $"Validating CA connection info: {JsonSerializer.Serialize(connectionInfo)}"); @@ -373,7 +385,7 @@ public async Task ValidateCAConnectionInfo(Dictionary connection // make sure an authentication mechanism is defined (either certificate or token) var token = connectionInfo[Constants.CAConfig.TOKEN] as string; - + //var cert = connectionInfo[Constants.CAConfig.CLIENTCERT] as string; var cert = string.Empty; // temporary until client cert auth into vault is implemented @@ -466,7 +478,7 @@ public Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary Date: Mon, 1 Dec 2025 14:12:53 -0500 Subject: [PATCH 6/7] Added missing fields for a wrapped response. Changed awaiting mechanism for getting product ID's. Added check for a null response. --- hashicorp-vault-cagateway/APIProxy/WrappedResponse.cs | 6 ++++++ hashicorp-vault-cagateway/Client/VaultHttp.cs | 7 ++++--- hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs | 7 +++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/hashicorp-vault-cagateway/APIProxy/WrappedResponse.cs b/hashicorp-vault-cagateway/APIProxy/WrappedResponse.cs index 44035ae..80051a2 100644 --- a/hashicorp-vault-cagateway/APIProxy/WrappedResponse.cs +++ b/hashicorp-vault-cagateway/APIProxy/WrappedResponse.cs @@ -12,6 +12,9 @@ namespace Keyfactor.Extensions.CAPlugin.HashicorpVault.APIProxy { public class WrappedResponse { + [JsonPropertyName("request_id")] + public string RequestId { get; set; } + [JsonPropertyName("lease_id")] public string LeaseId { get; set; } @@ -30,6 +33,9 @@ public class WrappedResponse [JsonPropertyName("mount_point")] public string MountPoint { get; set; } + [JsonPropertyName("mount_type")] + public string MountType { get; set; } + [JsonPropertyName("mount_running_plugin_version")] public string PluginVersion { get; set; } diff --git a/hashicorp-vault-cagateway/Client/VaultHttp.cs b/hashicorp-vault-cagateway/Client/VaultHttp.cs index 94cc489..eb122a1 100644 --- a/hashicorp-vault-cagateway/Client/VaultHttp.cs +++ b/hashicorp-vault-cagateway/Client/VaultHttp.cs @@ -89,10 +89,11 @@ public async Task GetAsync(string path, Dictionary paramet if (string.IsNullOrEmpty(response.Content)) throw new Exception(response.ErrorMessage ?? "no content returned from Vault"); logger.LogTrace($"deserializing the response into a {typeof(T)}"); - var serialized = JsonConvert.DeserializeObject(response.Content); + var deserialized = JsonConvert.DeserializeObject(response.Content); logger.LogTrace($"successfully deserialized the reponse"); - return serialized; + + return deserialized; } catch (Exception ex) { @@ -120,7 +121,7 @@ public async Task PostAsync(string path, dynamic parameters = default) if (parameters != null) { string serializedParams = JsonConvert.SerializeObject(parameters); - logger.LogTrace($"serialized parameters (from {parameters.GetType()?.Name}): {serializedParams}"); + logger.LogTrace($"deserialized parameters (from {parameters.GetType()?.Name}): {serializedParams}"); request.AddJsonBody(serializedParams); } diff --git a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs index a956754..008751b 100644 --- a/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs +++ b/hashicorp-vault-cagateway/HashicorpVaultCAConnector.cs @@ -440,7 +440,7 @@ public async Task ValidateCAConnectionInfo(Dictionary connection { logger.LogTrace("making an authenticated request to the Vault server to verify credentials (listing role names).."); var roleNames = await _client.GetRoleNamesAsync(); - logger.LogTrace($"successfule request: received a response containing {roleNames.Count} role names"); + logger.LogTrace($"successful request: received a response containing {roleNames?.Count} role names"); } catch (Exception ex) { @@ -583,7 +583,10 @@ public List GetProductIds() try { logger.LogTrace("requesting role names from vault.."); - var roleNames = _client.GetRoleNamesAsync().Result; + var roleNames = _client.GetRoleNamesAsync().GetAwaiter().GetResult(); + if (roleNames == null) { + throw new Exception("no role names returned, or deserialization failed."); + } logger.LogTrace($"got {roleNames.Count} role names from vault:"); foreach (var name in roleNames) { From b452a6696c9f0c528a0e3f3ca64b62d2cacff633 Mon Sep 17 00:00:00 2001 From: Joe VanWanzeele Date: Wed, 3 Dec 2025 10:47:20 -0500 Subject: [PATCH 7/7] swapped newtsonsoft json for system.text.json for consistent serialization. --- hashicorp-vault-cagateway/Client/VaultHttp.cs | 17 +++++----- .../Properties/launchSettings.json | 10 ------ .../hashicorp-vault-caplugin.csproj | 33 +++++-------------- 3 files changed, 17 insertions(+), 43 deletions(-) delete mode 100644 hashicorp-vault-cagateway/Properties/launchSettings.json diff --git a/hashicorp-vault-cagateway/Client/VaultHttp.cs b/hashicorp-vault-cagateway/Client/VaultHttp.cs index eb122a1..6f0ae03 100644 --- a/hashicorp-vault-cagateway/Client/VaultHttp.cs +++ b/hashicorp-vault-cagateway/Client/VaultHttp.cs @@ -8,7 +8,6 @@ using Keyfactor.Extensions.CAPlugin.HashicorpVault.APIProxy; using Keyfactor.Logging; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; using RestSharp; using RestSharp.Serializers.Json; using System; @@ -16,7 +15,6 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; -using JsonSerializer = Newtonsoft.Json.JsonSerializer; namespace Keyfactor.Extensions.CAPlugin.HashicorpVault.Client { @@ -38,8 +36,8 @@ public VaultHttp(string host, string mountPoint, string authToken, string nameSp _serializerOptions = new() { DefaultIgnoreCondition = JsonIgnoreCondition.Never, - RespectNullableAnnotations = true, PropertyNameCaseInsensitive = true, + RespectNullableAnnotations = true, PreferredObjectCreationHandling = JsonObjectCreationHandling.Replace }; @@ -71,7 +69,7 @@ public VaultHttp(string host, string mountPoint, string authToken, string nameSp public async Task GetAsync(string path, Dictionary parameters = null) { logger.MethodEntry(); - logger.LogTrace($"preparing to send GET request to {path} with parameters {JsonConvert.SerializeObject(parameters)}"); + logger.LogTrace($"preparing to send GET request to {path} with parameters {JsonSerializer.Serialize(parameters)}"); try { @@ -88,10 +86,11 @@ public async Task GetAsync(string path, Dictionary paramet response.ThrowIfError(); if (string.IsNullOrEmpty(response.Content)) throw new Exception(response.ErrorMessage ?? "no content returned from Vault"); - logger.LogTrace($"deserializing the response into a {typeof(T)}"); - var deserialized = JsonConvert.DeserializeObject(response.Content); + logger.LogTrace($"deserializing the response into a {typeof(T)}"); + + var deserialized = JsonSerializer.Deserialize(response.Content, _serializerOptions); - logger.LogTrace($"successfully deserialized the reponse"); + logger.LogTrace($"successfully deserialized the response"); return deserialized; } @@ -120,7 +119,7 @@ public async Task PostAsync(string path, dynamic parameters = default) var request = new RestRequest(resourcePath, Method.Post); if (parameters != null) { - string serializedParams = JsonConvert.SerializeObject(parameters); + string serializedParams = JsonSerializer.Serialize(parameters); logger.LogTrace($"deserialized parameters (from {parameters.GetType()?.Name}): {serializedParams}"); request.AddJsonBody(serializedParams); } @@ -139,7 +138,7 @@ public async Task PostAsync(string path, dynamic parameters = default) if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) { - errorResponse = JsonConvert.DeserializeObject(response.Content ?? "no content"); + errorResponse = JsonSerializer.Deserialize(response.Content ?? "no content"); string allErrors = "(Bad Request)"; if (errorResponse?.Errors.Count > 0) { diff --git a/hashicorp-vault-cagateway/Properties/launchSettings.json b/hashicorp-vault-cagateway/Properties/launchSettings.json deleted file mode 100644 index e6a1e54..0000000 --- a/hashicorp-vault-cagateway/Properties/launchSettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "profiles": { - "hashicorp-vault-caplugin": { - "commandName": "Project", - "remoteDebugEnabled": true, - "authenticationMode": "None", - "nativeDebugging": true - } - } -} \ No newline at end of file diff --git a/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj b/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj index c9566c1..79b075c 100644 --- a/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj +++ b/hashicorp-vault-cagateway/hashicorp-vault-caplugin.csproj @@ -33,15 +33,15 @@ - - - - - - - - - + + + + + + + + + @@ -49,19 +49,4 @@ Always - - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - \ No newline at end of file