-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better support wrapping of TransportChannel #3769
Better support wrapping of TransportChannel #3769
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
src/main/java/org/opensearch/security/ssl/transport/SecuritySSLRequestHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3769 +/- ##
==========================================
+ Coverage 65.24% 65.28% +0.03%
==========================================
Files 297 297
Lines 21129 21133 +4
Branches 3451 3452 +1
==========================================
+ Hits 13786 13796 +10
+ Misses 5643 5640 -3
+ Partials 1700 1697 -3
|
See steps to reproduce here: #3771 (comment) I have confirmed that this fix will ensure that When PA instantiates a PATransportChannel it does not copy the version from the original TransportChannel. Since it doesn't copy the version from the original, it will go with the default from TransportChannel which is the value of |
src/main/java/org/opensearch/security/ssl/transport/SecuritySSLRequestHandler.java
Show resolved
Hide resolved
LGTM |
src/main/java/org/opensearch/security/ssl/transport/SecuritySSLRequestHandler.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/ssl/transport/SecuritySSLRequestHandler.java
Show resolved
Hide resolved
…InnerChannel to account for PA interceptor (#3769) ### Description Ensure that channel.getVersion() is called after extraction of inner channel. Signed-off-by: Craig Perkins <cwperx@amazon.com> (cherry picked from commit 481b373) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Backport 481b373 from #3769. --------- Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Craig Perkins <cwperx@amazon.com>
…InnerChannel to account for PA interceptor (opensearch-project#3769) ### Description Ensure that channel.getVersion() is called after extraction of inner channel. Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Description
Performance Analyzer (PA) sets up a transport interceptor that wraps a TransportChannel. The security plugin has logic to extract the inner channel so that the rest of SecuritySSLRequestHandler uses the original channel. There is logic before the inner channel extraction to determine whether to use JDK Serialization if the incoming message was received from a node running OS <= 2.10. That code relies on
channel.getVersion()
to get the version of the node that transmitted the transport request, but when the channel is wrapped its not delegating to the original channel in PA. This PR moves the logic after the extraction of the inner channel to ensure thatchannel.getVersion()
correctly returns the version from the transmitting node.Bug fix
Issues Resolved
Testing
Will update with testing steps
Check List
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.