Added support for AWS Sigv4 for UrlLib3. (#547)

* WIP: Added support for AWS Sigv4 for UrlLib3.

Signed-off-by: dblock <dblock@amazon.com>

* Refactored common implementation.

Signed-off-by: dblock <dblock@amazon.com>

* Added sigv4 samples.

Signed-off-by: dblock <dblock@amazon.com>

* Updated CHANGELOG.

Signed-off-by: dblock <dblock@amazon.com>

* Add documentation.

Signed-off-by: dblock <dblock@amazon.com>

* Use the correct class in tests.

Signed-off-by: dblock <dblock@amazon.com>

* Renamed samples.

Signed-off-by: dblock <dblock@amazon.com>

* Split up requests and urllib3 unit tests.

Signed-off-by: dblock <dblock@amazon.com>

* Rename AWSV4Signer.

Signed-off-by: dblock <dblock@amazon.com>

* Clarified documentation of when to use Urllib3AWSV4SignerAuth vs. RequestHttpConnection.

Signed-off-by: dblock <dblock@amazon.com>

* Move fetch_url inside the signer class.

Signed-off-by: dblock <dblock@amazon.com>

* Added unit test for Urllib3AWSV4SignerAuth adding headers.

Signed-off-by: dblock <dblock@amazon.com>

* Added unit test for signing to include query string.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
This commit is contained in:
Daniel (dB.) Doubrovkine
2023-10-23 19:46:19 -04:00
committed by GitHub
parent fa8f3a7ae0
commit a1f942b6f9
19 changed files with 1677 additions and 1766 deletions
+14 -2
View File
@@ -45,7 +45,19 @@ docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensear
Tests require a live instance of OpenSearch running in docker.
This will start a new instance and run tests against the latest version of OpenSearch.
If you have one running.
```
python setup.py test
```
To run tests in a specific test file.
```
python setup.py test -s test_opensearchpy/test_connection.py
```
If you want to auto-start one, the following will start a new instance and run tests against the latest version of OpenSearch.
```
./.ci/run-tests
@@ -76,7 +88,7 @@ You can also run individual tests matching a pattern (`pytest -k [pattern]`).
```
./.ci/run-tests true 1.3.0 test_no_http_compression
test_opensearchpy/test_connection.py::TestUrllib3Connection::test_no_http_compression PASSED [ 33%]
test_opensearchpy/test_connection.py::TestUrllib3HttpConnection::test_no_http_compression PASSED [ 33%]
test_opensearchpy/test_connection.py::TestRequestsConnection::test_no_http_compression PASSED [ 66%]
test_opensearchpy/test_async/test_connection.py::TestAIOHttpConnection::test_no_http_compression PASSED [100%]
```