Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting#10562
Conversation
|
(I will add changelog entry right when Gradle check fails, since it should) |
|
Thank you @reta! There are a couple of areas that the security plugin is coupled to netty:
As far as I can see, there are no automated tests to verify the behavior amongst other http engines |
Which ones? |
Gradle Check (Jenkins) Run Completed with:
|
Compatibility status:Checks if related components are compatible with change 1c184e2 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #10562 +/- ##
=========================================
Coverage 71.16% 71.16%
- Complexity 58399 58403 +4
=========================================
Files 4844 4844
Lines 275289 275306 +17
Branches 40083 40086 +3
=========================================
+ Hits 195898 195928 +30
+ Misses 62997 62956 -41
- Partials 16394 16422 +28
|
…TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Discussed with @cwperks offline, we'll looking into that separately |
peternied
left a comment
There was a problem hiding this comment.
Thanks for making access to this more generic - I much prefer this approach rather than downstream 'peaking' of the types. Couple of minor comments around the new interface.
modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpChannel.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
|
@cwperks @peternied @Gaganjuneja thanks for the review folks, the attributes issue is more complicated, looking if we even need that, but in any case the solution would be different and it would make sense to have a dedicated pull request for it. |
Gradle Check (Jenkins) Run Completed with:
|
|
LGTM. |
Gradle Check (Jenkins) Run Completed with:
|
…TcpChannel and TrasportChannel without excessive typecasting (#10562) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Address code review comments Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Andriy Redko <andriy.redko@aiven.io> (cherry picked from commit c55e1b4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…TcpChannel and TrasportChannel without excessive typecasting (#10562) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Address code review comments Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Andriy Redko <andriy.redko@aiven.io> (cherry picked from commit c55e1b4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
…TcpChannel and TrasportChannel without excessive typecasting (#10562) (#10570) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting * Address code review comments --------- (cherry picked from commit c55e1b4) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> 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>
…TcpChannel and TrasportChannel without excessive typecasting (opensearch-project#10562) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Address code review comments Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
…TcpChannel and TrasportChannel without excessive typecasting (opensearch-project#10562) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Address code review comments Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
…TcpChannel and TrasportChannel without excessive typecasting (opensearch-project#10562) * Add the means to extract the contextual properties from HttpChannel, TcpChannel and TrasportChannel without excessive typecasting Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Address code review comments Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
While instrumenting the transports (both TCP and HTTP), we found out that
securityplugin heavily depends onnettytransport (in fact, it does not support anything else) but it is excessive typecasting the different transport object to theirNetty4Xxxequivalents for accessing handlers and attributes. It significantly complicates any instrumentation efforts and needs general mechanism to access contextual information without typecasting.Related Issues
Related to opensearch-project/security#3515
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.