Accept custom interceptors in ConfigClient and AsyncConfigClient#105
Merged
Conversation
…figClient Both clients now accept an optional `interceptors` list for injecting logging, tracing, or metrics interceptors without monkeypatching. For ConfigClient, user-supplied interceptors are placed outermost in the grpc.intercept_channel chain (before the internal AuthInterceptor). For AsyncConfigClient, interceptors are forwarded to the grpc.aio channel constructor. Closes #68 Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConfigClient, user interceptors are placed outermost in thegrpc.intercept_channelchain so they wrap around the SDK's internal auth interceptorAsyncConfigClient, interceptors are forwarded to thegrpc.aiochannel constructorTest plan
ConfigClient: custom interceptor appears inintercept_channelcall argsConfigClient: user interceptors are ordered beforeAuthInterceptor(outermost)ConfigClient: custom interceptors work when no auth metadata is configuredAsyncConfigClient: interceptors kwarg forwarded tocreate_aio_channelAsyncConfigClient:Nonedefault when no interceptors providedAsyncConfigClient: multiple interceptors preserved in orderCloses #68