Skip to content

Commit

Permalink
fix #289
Browse files Browse the repository at this point in the history
release 1.7.2.1
  • Loading branch information
rajanadar committed Dec 7, 2022
1 parent 0ebb8d1 commit cb324ef
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.7.2.1 (December 07, 2022)

**BUG FIXES:**

* [GH-289] Fix InvalidOperationException related to Patch Content type for PatchSecretAsync method

## 1.7.2 (December 06, 2022)

**BREAKING CHANGE:**
Expand Down Expand Up @@ -574,6 +580,7 @@ there are no changes from 0.4.0.
* Initial release
* Parity with Hashicorp's Vault 0.4.1 Api features

[GH-289]: https://github.com/rajanadar/VaultSharp/issues/289
[GH-269]: https://github.com/rajanadar/VaultSharp/issues/269
[GH-286]: https://github.com/rajanadar/VaultSharp/issues/286
[GH-280]: https://github.com/rajanadar/VaultSharp/issues/280
Expand Down
Binary file not shown.
Binary file not shown.
10 changes: 7 additions & 3 deletions src/VaultSharp/Core/Polymath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ internal class Polymath
private const string AuthorizationHeaderKey = "Authorization";
private const string VaultTokenHeaderKey = "X-Vault-Token";
private const string VaultWrapTimeToLiveHeaderKey = "X-Vault-Wrap-TTL";
private const string ContentType = "Content-Type";

private const string VaultSharpV1Path = "v1/";

Expand Down Expand Up @@ -242,11 +241,16 @@ protected async Task<TResponse> MakeRequestAsync<TResponse>(string resourcePath,

case "PATCH":

// We cannot directly add content type for httpRequestMessage
// It is added via the RequestContent
// https://stackoverflow.com/a/70593566/1174414

httpRequestMessage = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri)
{
Content = requestContent
Content = requestData != null
? new StringContent(JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/merge-patch+json")
: null
};
headers.Add(ContentType, "application/merge-patch+json");

break;

Expand Down
6 changes: 3 additions & 3 deletions src/VaultSharp/VaultSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>VaultSharp.snk</AssemblyOriginatorKeyFile>
<Title>VaultSharp</Title>
<Version>1.7.2</Version>
<Version>1.7.2.1</Version>
<Authors>Raja Nadar</Authors>
<Copyright>Copyright © 2021 Raja Nadar. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/rajanadar/VaultSharp</PackageProjectUrl>
Expand All @@ -23,8 +23,8 @@
This library is built with .NET Standard 1.3, .NET Standard 2.0, .NET Standard 2.1, .NET Framework 4.5 4.6, 4.6.*, 4.7, 4.7.*, 4.8 &amp; .NET 5, .NET 6 and hence is cross-platform across .NET Core 1.x, 2.x, 3.x, .NET Frameworks 4.x, Xamarin iOS, Android, Mac, UWP etc.</Description>
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>1.7.2</AssemblyVersion>
<FileVersion>1.7.2</FileVersion>
<AssemblyVersion>1.7.2.1</AssemblyVersion>
<FileVersion>1.7.2.1</FileVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageIcon>icon.png</PackageIcon>

Expand Down
6 changes: 3 additions & 3 deletions test/VaultSharp.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,10 @@ private static void RunKeyValueV2Samples()
var kv2Secret = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretAsync(path, mountPoint: kv2SecretsEngine.Path).Result;
Assert.True(kv2Secret.Data.Data.Count == 2);

var subkeys = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretSubkeysAsync(path, mountPoint: kv2SecretsEngine.Path).Result;
Assert.True(subkeys.Data.Subkeys.Count > 0);
// var subkeys = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretSubkeysAsync(path, mountPoint: kv2SecretsEngine.Path).Result;
// Assert.True(subkeys.Data.Subkeys.Count > 0);

var paths2 = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretPathsAsync("", mountPoint: kv2SecretsEngine.Path).Result;
var paths2 = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretPathsAsync(path, mountPoint: kv2SecretsEngine.Path).Result;
Assert.True(paths2.Data.Keys.Count() == 1);

var kv2metadata = _authenticatedVaultClient.V1.Secrets.KeyValue.V2.ReadSecretMetadataAsync(path, mountPoint: kv2SecretsEngine.Path).Result;
Expand Down

0 comments on commit cb324ef

Please sign in to comment.