opensearch-project / opensearch-php

Official PHP Client for OpenSearch
Other
110 stars 58 forks source link

Add required header for SigV4 signing #119

Closed harshavamsi closed 1 year ago

harshavamsi commented 1 year ago

Description

Fixes missing header for Amazon OpenSearch Serverless

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov-commenter commented 1 year ago

Codecov Report

Merging #119 (0125698) into main (fa650c2) will increase coverage by 0.01%. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main     #119      +/-   ##
============================================
+ Coverage     23.89%   23.90%   +0.01%     
  Complexity     1936     1936              
============================================
  Files           245      245              
  Lines          6856     6857       +1     
============================================
+ Hits           1638     1639       +1     
  Misses         5218     5218              
Impacted Files Coverage Δ
src/OpenSearch/Handlers/SigV4Handler.php 84.90% <100.00%> (+0.29%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

harshavamsi commented 1 year ago

@dblock we've already added tests/changelog/user_guide in a prior PR. This just fixes an issue as part of that.

dblock commented 1 year ago

@dblock we've already added tests/changelog/user_guide in a prior PR. This just fixes an issue as part of that.

I don't think I agree ;)

  1. This code adds a new x-amz-content-sha256, there are no tests that require that this header is present and is correct. If someone removes this header inadvertently in a refactor or because they don't know that it's required by serverless, no tests will fail.
  2. ~There's no documentation that mentions that this library supports Serverless. So users don't know if it works.~
  3. ~There's no entry in CHANGELOG that says that serverless is now supported. Which is a change.~

I'll stay corrected on 2) and 3) which were added in #117, but you want to add this PR to the list still in CHANGELOG.

harshavamsi commented 1 year ago

@dblock @shyim this should be good now.

shouze commented 1 year ago

@harshavamsi thank you, using your fork make us able to user Amazon OpensSarch Serverless :tada: