Skip to content

Commit

Permalink
fixes iam bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rajanadar committed Apr 20, 2019
1 parent 75560ba commit 4b37602
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 0.11.1001 (Unknown)

**BUG FIXES:**

* Fixes default path of KeyValue version 1 to be kv.
* Fixes a bug with IAM Login, for the shorter overload of the ```IAMAWSAuthMethodInfo``` class. Fixes [GH-61].

**DOC IMPROVEMENTS:**

* Fixes [GH-57]. Replaced the use of ```var``` in docs with type info, where the type is hard to infer.
Expand Down
25 changes: 13 additions & 12 deletions src/VaultSharp/V1/AuthMethods/AWS/IAMAWSAuthMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public class IAMAWSAuthMethodInfo : AbstractAWSAuthMethodInfo
/// <summary>
/// Initializes a new instance of the <see cref="IAMAWSAuthMethodInfo"/> class.
/// </summary>
/// <param name="requestHeaders">
/// <para>[required]</para>
/// The Base64-encoded, JSON-serialized representation of the sts:GetCallerIdentity HTTP request headers.
/// The JSON serialization assumes that each header key maps to either a string value or an array of string
/// values (though the length of that array will probably only be one).
/// If the iam_server_id_header_value is configured in Vault for the aws auth mount,
/// then the headers must include the X-Vault-AWS-IAM-Server-ID header,
/// its value must match the value configured, and the header must be included in the signed headers.
/// This is required when using the iam auth method.
/// Please see <see cref="https://github.com/rajanadar/VaultSharp/blob/master/README.md#aws-auth-method---iam"/> on how to construct this.
/// </param>
/// <param name="httpRequestMethod">
/// <para>[required]</para>
/// The HTTP method used in the signed request.
Expand All @@ -89,16 +100,6 @@ public class IAMAWSAuthMethodInfo : AbstractAWSAuthMethodInfo
/// which is the base64 encoding of Action=GetCallerIdentity&Version=2011-06-15.
/// This is required when using the iam auth method.
/// </param>
/// <param name="requestHeaders">
/// <para>[required]</para>
/// The Base64-encoded, JSON-serialized representation of the sts:GetCallerIdentity HTTP request headers.
/// The JSON serialization assumes that each header key maps to either a string value or an array of string
/// values (though the length of that array will probably only be one).
/// If the iam_server_id_header_value is configured in Vault for the aws auth mount,
/// then the headers must include the X-Vault-AWS-IAM-Server-ID header,
/// its value must match the value configured, and the header must be included in the signed headers.
/// This is required when using the iam auth method.
/// </param>
/// <param name="nonce">
/// <para>[required/optional]</para>
/// The nonce to be used for subsequent login requests.
Expand All @@ -124,8 +125,8 @@ public class IAMAWSAuthMethodInfo : AbstractAWSAuthMethodInfo
/// of the IAM principal authenticated..
/// If a matching role is not found, login fails.
/// </param>
public IAMAWSAuthMethodInfo(string httpRequestMethod = "POST", string requestUrl = "aHR0cHM6Ly9zdHMuYW1hem9uYXdzLmNvbS8=", string requestBody = "QWN0aW9uPUdldENhbGxlcklkZW50aXR5JlZlcnNpb249MjAxMS0wNi0xNQ==", string requestHeaders = "QWN0aW9uPUdldENhbGxlcklkZW50aXR5JlZlcnNpb249MjAxMS0wNi0xNQ==", string nonce = null, string roleName = null)
: this(AuthMethodType.AWS.Type, httpRequestMethod, requestUrl, requestBody, requestHeaders, nonce, roleName)
public IAMAWSAuthMethodInfo(string requestHeaders, string httpRequestMethod = "POST", string requestUrl = "aHR0cHM6Ly9zdHMuYW1hem9uYXdzLmNvbS8=", string requestBody = "QWN0aW9uPUdldENhbGxlcklkZW50aXR5JlZlcnNpb249MjAxMS0wNi0xNQ==", string nonce = null, string roleName = null)
: this(AuthMethodType.AWS.Type, requestHeaders, httpRequestMethod, requestUrl, requestBody, nonce, roleName)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/VaultSharp/V1/SecretsEngines/SecretsEngineDefaultPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class SecretsEngineDefaultPaths
public const string Cubbyhole = "cubbyhole";
public const string Database = "database";
public const string GoogleCloud = "gcp";
public const string KeyValueV2 = "secret";
public const string KeyValueV1 = "kv";
public const string KeyValueV1 = "secret";
public const string KeyValueV2 = "kv";
public const string Identity = "identity";
public const string Nomad = "nomad";
public const string PKI = "pki";
Expand Down
7 changes: 3 additions & 4 deletions src/VaultSharp/VaultSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>VaultSharp.snk</AssemblyOriginatorKeyFile>
<Version>0.11.1000</Version>
<Version>0.11.1001</Version>
<Authors>Raja Nadar</Authors>
<Copyright>Copyright © 2019 Raja Nadar. All rights reserved.</Copyright>
<PackageIconUrl>https://raw.githubusercontent.com/rajanadar/VaultSharp/master/VaultSharpIcon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/rajanadar/VaultSharp</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/rajanadar/VaultSharp/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/rajanadar/VaultSharp</RepositoryUrl>
<PackageTags>c# vault hashicorp .net netcore netstandard api secret consul kv ldap aws ec2 iam userpass</PackageTags>
<PackageReleaseNotes>https://github.com/rajanadar/VaultSharp/blob/master/CHANGELOG.md</PackageReleaseNotes>
Expand All @@ -22,8 +21,8 @@
* This library is built with .NET Standard 1.3 &amp; .NET 4.5 and hence is cross-platform across .NET Core 1.0, .NET 4.5 and more, Xamarin iOS, Android, Mac, UWP etc.</Description>
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>0.11.1000.0</AssemblyVersion>
<FileVersion>0.11.1000.0</FileVersion>
<AssemblyVersion>0.11.1001.0</AssemblyVersion>
<FileVersion>0.11.1001.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down

0 comments on commit 4b37602

Please sign in to comment.