diff --git a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/ElasticSearch.Net.Aws.IntegrationTests.csproj b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/ElasticSearch.Net.Aws.IntegrationTests.csproj index 0382299..097a980 100644 --- a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/ElasticSearch.Net.Aws.IntegrationTests.csproj +++ b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/ElasticSearch.Net.Aws.IntegrationTests.csproj @@ -17,8 +17,7 @@ - - + diff --git a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PingTests.cs b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PingTests.cs index 5634ce2..6c638de 100644 --- a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PingTests.cs +++ b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PingTests.cs @@ -20,7 +20,7 @@ public void Ping_should_work() var pool = new SingleNodeConnectionPool(new Uri(TestConfig.Endpoint)); var config = new ConnectionConfiguration(pool, httpConnection); var client = new ElasticLowLevelClient(config); - var response = client.Ping(); + var response = client.Ping(); Assert.AreEqual(200, response.HttpStatusCode.GetValueOrDefault(-1)); } @@ -44,7 +44,7 @@ public void Random_encoded_url_should_work() var pool = new SingleNodeConnectionPool(new Uri(TestConfig.Endpoint)); var config = new ConnectionConfiguration(pool, httpConnection); var client = new ElasticLowLevelClient(config); - var response = client.Get(randomString, string.Join(",", Enumerable.Repeat(randomString, 2)), randomString); + var response = client.Get(randomString, string.Join(",", Enumerable.Repeat(randomString, 2)), randomString); Assert.AreEqual(404, response.HttpStatusCode.GetValueOrDefault(-1)); } @@ -55,7 +55,7 @@ public void Asterisk_encoded_url_should_work() var pool = new SingleNodeConnectionPool(new Uri(TestConfig.Endpoint)); var config = new ConnectionConfiguration(pool, httpConnection); var client = new ElasticLowLevelClient(config); - var response = client.Get("index*", "type", "id"); + var response = client.Get("index*", "type", "id"); Assert.AreEqual(404, response.HttpStatusCode.GetValueOrDefault(-1)); } } diff --git a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PostTests.cs b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PostTests.cs deleted file mode 100644 index 117e25f..0000000 --- a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.IntegrationTests/PostTests.cs +++ /dev/null @@ -1,46 +0,0 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using Elasticsearch.Net; -using Elasticsearch.Net.Aws; - -namespace IntegrationTests -{ - [TestFixture] - public class PostTests - { - private static string Region => TestConfig.Region; - - string _indexName; - ElasticLowLevelClient _client; - - [SetUp] - public void Setup() - { - var httpConnection = new AwsHttpConnection(Region); - var pool = new SingleNodeConnectionPool(new Uri(TestConfig.Endpoint)); - var config = new ConnectionConfiguration(pool, httpConnection); - _client = new ElasticLowLevelClient(config); - _indexName = $"unittest_{Guid.NewGuid().ToString("n")}"; - } - - [TearDown] - public void TearDown() - { - _client.IndicesDelete(_indexName); - } - - [Test] - public void SimplePost_should_work() - { - var id = Guid.NewGuid().ToString("n"); - var response = _client.Create(_indexName, "test", id, PostData.Serializable(new { message = "Hello, World!" })); - Assert.AreEqual(true, response.Success); - var getResponse = _client.Get(_indexName, "test", id); - Assert.AreEqual(true, getResponse.Success); - StringAssert.Contains("Hello, World!", getResponse.Body); - } - } -} diff --git a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.Tests/ElasticSearch.Net.Aws.Tests.csproj b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.Tests/ElasticSearch.Net.Aws.Tests.csproj index e3addf9..28f75e5 100644 --- a/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.Tests/ElasticSearch.Net.Aws.Tests.csproj +++ b/src/Elasticsearch.Net.Aws/ElasticSearch.Net.Aws.Tests/ElasticSearch.Net.Aws.Tests.csproj @@ -17,16 +17,10 @@ - - + - - - - - diff --git a/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws.csproj b/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws.csproj index b74a369..fa7ec36 100644 --- a/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws.csproj +++ b/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws.csproj @@ -1,11 +1,11 @@  - 6.1.0 + 2.5.8 net461;netstandard2.0 Elasticsearch.Net.Aws - Elasticsearch.Net.Aws - 6.1.0 + bcuff.Elasticsearch.Net.Aws-v2 + 2.5.8 Brandon Cuff Enables request signing necessary for using the AWS Elasticsearch service. Copyright 2015 @@ -14,9 +14,9 @@ Use AWSSDK.Core to get credentials instead of custom code. elasticsearch elastic search aws amazon https://github.com/bcuff/elasticsearch-net-aws - 6.1.0 - 6.1.0 - 6.1.0 + 2.5.8 + 2.5.8 + 2.5.8 @@ -27,7 +27,7 @@ - + @@ -39,8 +39,4 @@ - - - - diff --git a/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/SignV4Util.cs b/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/SignV4Util.cs index 792e1e7..943dd9b 100644 --- a/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/SignV4Util.cs +++ b/src/Elasticsearch.Net.Aws/Elasticsearch.Net.Aws/SignV4Util.cs @@ -157,18 +157,9 @@ private static void WriteSignedHeaders(Dictionary canonicalHeade } } -#if !NETSTANDARD private static NameValueCollection ParseQueryString(string query) => System.Web.HttpUtility.ParseQueryString(query); -#else - private static NameValueCollection ParseQueryString(string query) => - Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(query) - .Aggregate(new NameValueCollection(), (col, kv) => - { - kv.Value.ToList().ForEach(v => col.Add(kv.Key, v)); - return col; - }); -#endif + public static string GetCanonicalQueryString(this Uri uri) { if (string.IsNullOrWhiteSpace(uri.Query)) return string.Empty;