Skip to content

Detect Apache5HttpClient in AWS SDK transport body-method guardrail#1970

Merged
reta merged 2 commits into
opensearch-project:mainfrom
baekgyu-kim:1903
May 3, 2026
Merged

Detect Apache5HttpClient in AWS SDK transport body-method guardrail#1970
reta merged 2 commits into
opensearch-project:mainfrom
baekgyu-kim:1903

Conversation

@baekgyu-kim
Copy link
Copy Markdown
Contributor

Description

  • This PR updates AwsSdk2Transport body-method guardrail to recognize AWS SDK Apache5HttpClient in addition to the existing Apache v4 client.
  • It prevents Apache5 users from hitting AWS SDK internal errors for request bodies on methods such as GET or DELETE, and reuses the existing guardrail behavior instead.
  • This change also adds focused unit coverage for Apache v4/v5 detection and non-Apache clients.

Issues Resolved

Closes #1903 .

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.

Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>
Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>
@nmck257
Copy link
Copy Markdown

nmck257 commented May 3, 2026

This achieves my goals from #1903; will defer to the maintainers for review / approval :)

@reta
Copy link
Copy Markdown
Collaborator

reta commented May 3, 2026

This achieves my goals from #1903; will defer to the maintainers for review / approval :)

Thanks @baekgyu-kim , the change makes sense

@reta reta merged commit ca838c7 into opensearch-project:main May 3, 2026
45 checks passed
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 3.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/opensearch-java/backport-3.x 3.x
# Navigate to the new working tree
pushd ../.worktrees/opensearch-java/backport-3.x
# Create a new branch
git switch --create backport/backport-1970-to-3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ca838c784c6cc4faa37ac97348ecfccf3821cb92
# Push it to GitHub
git push --set-upstream origin backport/backport-1970-to-3.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-java/backport-3.x

Then, create a pull request where the base branch is 3.x and the compare/head branch is backport/backport-1970-to-3.x.

reta pushed a commit to reta/opensearch-java that referenced this pull request May 3, 2026
…pensearch-project#1970)

* Detect Apache5HttpClient in AWS SDK transport body-method guardrail

Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>

* ADD CHANGELOG

Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>

---------

Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>
(cherry picked from commit ca838c7)
Signed-off-by: Andriy Redko <drreta@gmail.com>
@baekgyu-kim
Copy link
Copy Markdown
Contributor Author

Thanks @nmck257 for opening the issue and confirming that this PR addresses it.
Thanks @reta for reviewing the change and confirming the approach.

Have a good day 👍

Xtansia pushed a commit that referenced this pull request May 12, 2026
…1970) (#1971)

* Detect Apache5HttpClient in AWS SDK transport body-method guardrail



* ADD CHANGELOG



---------


(cherry picked from commit ca838c7)

Signed-off-by: Baekgyu <baekgyukim.dev@gmail.com>
Signed-off-by: Andriy Redko <drreta@gmail.com>
Co-authored-by: Baekgyu Kim <baekgyukim.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Update throws-logic for Apache Http Client to also cover 5

3 participants