-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Introduce gRPC Interceptor Chain for transport-grpc #19005
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
Introduce gRPC Interceptor Chain for transport-grpc #19005
Conversation
❌ Gradle check result for 722ee62: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
722ee62
to
fbee539
Compare
❌ Gradle check result for fbee539: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for ca590a9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
6433438
to
99bbac2
Compare
❌ Gradle check result for 99bbac2: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 14301f8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
14301f8
to
6a01d57
Compare
❌ Gradle check result for 6a01d57: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for b924e76: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 8492d65: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 52dc73c: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 5e22c55: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
5e22c55
to
0ed5ca9
Compare
❌ Gradle check result for 0ed5ca9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e05670e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 2ef40bc: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 0951394: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
5cd49dc
to
02e7cd7
Compare
Signed-off-by: Aparajita Pandey <[email protected]>
Signed-off-by: Aparajita Pandey <[email protected]>
Signed-off-by: Aparajita Pandey <[email protected]>
❌ Gradle check result for 020a0aa: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
…ct#19005) * Introduce Interceptor to Grpc Plugin - Signed-off-by: Aparajita Pandey <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * This is a combination of 7 commits. Add testcases for gRPC Interceptor Signed-off-by: Aparajita Pandey <[email protected]> Ran spotlessAppy Signed-off-by: Aparajita Pandey <[email protected]> refactor Signed-off-by: Aparajita Pandey <[email protected]> spotlesssCheck Signed-off-by: Aparajita Pandey <[email protected]> check if it verified Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain check if it verified Signed-off-by: Aparajita Pandey <[email protected]> revert Signed-off-by: Aparajita Pandey <[email protected]> empty commit Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> testCases Signed-off-by: Aparajita Pandey <[email protected]> logger Signed-off-by: Aparajita Pandey <[email protected]> Resolve Conflict Signed-off-by: Aparajita Pandey <[email protected]> javadoc Signed-off-by: Aparajita Pandey <[email protected]> * javadoc Signed-off-by: Aparajita Pandey <[email protected]> * cleanuo Signed-off-by: Aparajita Pandey <[email protected]> * move GrpcInterceptor Interface to spi Signed-off-by: Aparajita Pandey <[email protected]> * move GrpcInterceptor Interface to spi Signed-off-by: Aparajita Pandey <[email protected]> * build.gradle fixes Signed-off-by: Aparajita Pandey <[email protected]> * GrpcInterceptorChain refactoring Signed-off-by: Aparajita Pandey <[email protected]> * GrpcInterceptorChain refactoring Signed-off-by: Aparajita Pandey <[email protected]> * rebase Signed-off-by: Aparajita Pandey <[email protected]> * coverage Signed-off-by: Aparajita Pandey <[email protected]> * spotless Signed-off-by: Aparajita Pandey <[email protected]> * Add logic to throw exception on workload group deletion with associated rules (opensearch-project#19502) Signed-off-by: Kaushal Kumar <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * add documentation about debug-server-jvm in testing.md (opensearch-project#19567) Signed-off-by: Vigya Sharma <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * Adds a mapper for context aware segments grouping criteria (opensearch-project#19233) * Adds Context aware grouping mapper The change also stores grouping criteria for each doc in parsed context Signed-off-by: Tejas Shah <[email protected]> * Adds a test for ContextAwareGroupingScript Signed-off-by: Tejas Shah <[email protected]> * Adds ContextAwareGroupingScript support in mockScriptEngine to fix integ tests Signed-off-by: Tejas Shah <[email protected]> * Corrects CHANGELOG.md Signed-off-by: Tejas Shah <[email protected]> * Fixes LangPainlessClientYamlTestSuiteIT Signed-off-by: Tejas Shah <[email protected]> --------- Signed-off-by: Tejas Shah <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * Refactor README.md and GrpcInterceptorChain Constructor Signed-off-by: Aparajita Pandey <[email protected]> * UpdateREADME & switch to implmentation Signed-off-by: Aparajita Pandey <[email protected]> * refactoring Signed-off-by: Aparajita Pandey <[email protected]> * refactoring Signed-off-by: Aparajita Pandey <[email protected]> * Address PR review comments - Changed SPI dependencies from api to implementation - Made OrderedGrpcInterceptor a nested interface inside GrpcInterceptorProvider - Updated README with build.gradle extension declaration examples - Simplified duplicate order handling documentation Signed-off-by: Aparajita Pandey <[email protected]> * empty commit Signed-off-by: Aparajita Pandey <[email protected]> * resolve conflict Signed-off-by: Aparajita Pandey <[email protected]> --------- Signed-off-by: Aparajita Pandey <[email protected]> Signed-off-by: Kaushal Kumar <[email protected]> Signed-off-by: Vigya Sharma <[email protected]> Signed-off-by: Tejas Shah <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> Co-authored-by: Kaushal Kumar <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Tejas Shah <[email protected]>
…ct#19005) * Introduce Interceptor to Grpc Plugin - Signed-off-by: Aparajita Pandey <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * This is a combination of 7 commits. Add testcases for gRPC Interceptor Signed-off-by: Aparajita Pandey <[email protected]> Ran spotlessAppy Signed-off-by: Aparajita Pandey <[email protected]> refactor Signed-off-by: Aparajita Pandey <[email protected]> spotlesssCheck Signed-off-by: Aparajita Pandey <[email protected]> check if it verified Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain check if it verified Signed-off-by: Aparajita Pandey <[email protected]> revert Signed-off-by: Aparajita Pandey <[email protected]> empty commit Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> Added GrpcInterceptorChain Signed-off-by: Aparajita Pandey <[email protected]> testCases Signed-off-by: Aparajita Pandey <[email protected]> logger Signed-off-by: Aparajita Pandey <[email protected]> Resolve Conflict Signed-off-by: Aparajita Pandey <[email protected]> javadoc Signed-off-by: Aparajita Pandey <[email protected]> * javadoc Signed-off-by: Aparajita Pandey <[email protected]> * cleanuo Signed-off-by: Aparajita Pandey <[email protected]> * move GrpcInterceptor Interface to spi Signed-off-by: Aparajita Pandey <[email protected]> * move GrpcInterceptor Interface to spi Signed-off-by: Aparajita Pandey <[email protected]> * build.gradle fixes Signed-off-by: Aparajita Pandey <[email protected]> * GrpcInterceptorChain refactoring Signed-off-by: Aparajita Pandey <[email protected]> * GrpcInterceptorChain refactoring Signed-off-by: Aparajita Pandey <[email protected]> * rebase Signed-off-by: Aparajita Pandey <[email protected]> * coverage Signed-off-by: Aparajita Pandey <[email protected]> * spotless Signed-off-by: Aparajita Pandey <[email protected]> * Add logic to throw exception on workload group deletion with associated rules (opensearch-project#19502) Signed-off-by: Kaushal Kumar <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * add documentation about debug-server-jvm in testing.md (opensearch-project#19567) Signed-off-by: Vigya Sharma <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * Adds a mapper for context aware segments grouping criteria (opensearch-project#19233) * Adds Context aware grouping mapper The change also stores grouping criteria for each doc in parsed context Signed-off-by: Tejas Shah <[email protected]> * Adds a test for ContextAwareGroupingScript Signed-off-by: Tejas Shah <[email protected]> * Adds ContextAwareGroupingScript support in mockScriptEngine to fix integ tests Signed-off-by: Tejas Shah <[email protected]> * Corrects CHANGELOG.md Signed-off-by: Tejas Shah <[email protected]> * Fixes LangPainlessClientYamlTestSuiteIT Signed-off-by: Tejas Shah <[email protected]> --------- Signed-off-by: Tejas Shah <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> * Refactor README.md and GrpcInterceptorChain Constructor Signed-off-by: Aparajita Pandey <[email protected]> * UpdateREADME & switch to implmentation Signed-off-by: Aparajita Pandey <[email protected]> * refactoring Signed-off-by: Aparajita Pandey <[email protected]> * refactoring Signed-off-by: Aparajita Pandey <[email protected]> * Address PR review comments - Changed SPI dependencies from api to implementation - Made OrderedGrpcInterceptor a nested interface inside GrpcInterceptorProvider - Updated README with build.gradle extension declaration examples - Simplified duplicate order handling documentation Signed-off-by: Aparajita Pandey <[email protected]> * empty commit Signed-off-by: Aparajita Pandey <[email protected]> * resolve conflict Signed-off-by: Aparajita Pandey <[email protected]> --------- Signed-off-by: Aparajita Pandey <[email protected]> Signed-off-by: Kaushal Kumar <[email protected]> Signed-off-by: Vigya Sharma <[email protected]> Signed-off-by: Tejas Shah <[email protected]> Signed-off-by: Aparajita Pandey <[email protected]> Co-authored-by: Kaushal Kumar <[email protected]> Co-authored-by: Vigya Sharma <[email protected]> Co-authored-by: Tejas Shah <[email protected]>
Description
This change introduces a gRPC Interceptor Chain into the transport-grpc module. The chain allows multiple interceptors to be applied in a defined order for every gRPC request. It lays the foundation for future needs (e.g., profiling, observability, logging), where ServerInterceptor provides a convenient hook.
Each interceptor can perform logic such as authentication, logging, or metrics collection before the request reaches the actual service. Interceptors are discovered using a provider interface and validated to ensure no duplicate order values.
If all interceptors succeed, the request proceeds to the service.
If any interceptor throws an exception, the chain logs the error, closes the call with an INTERNAL status, and stops further processing. This ensures a strict fail-fast model where faulty interceptors cannot be bypassed.This design makes gRPC extension points in OpenSearch opensearch-project/security#5379.
Related Issues
Resolves #5379
Test Plan
The changes are covered with unit tests to check interceptor ordering, duplicate detection, and error handling. Example scenarios include:
transport-grpc
extension using gRPCInterceptorCheck 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.