Use common dispatcher for public client outbound #2 #4537
Merged
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.
What changed?
Same as #4523, but with fixed middleware pointer, which required the revert #4534.
authMiddleware was stored as a pointer, which is not equal to nil which is checked when wrapping a middleware here: https://github.com/yarpc/yarpc-go/blob/dev/api/middleware/outbound.go#L59
Also updated unit test to ensure true nil is used when auth is not configured.
Stop using
DispatcherProvider
for creating public client. Instead use common dispatcher from rpc.Factory.Builder for public client outbound was created which also includes auth middleware initialization. It was previously located within server.go itself. Moving it here allows consolidating all logic related logic in one place and covering it with unit tests.
Why?
To eventually delete
DispatcherProvider
entirely.How did you test it?
Existing tests and new unit tests.
Potential risks
Release notes
Documentation Changes