This PR also introduces functionality to set outgoing headers on both grpc and http requests. Previously this was accomplished by individual clients (actually only mesh-geth-sdk was modified so far) defining context-creation behavior. Unfortunately, the request context plumbing was pretty ungainly and required each caller of this SDK to implement their own code for it.
Now the outgoing headers will be captured in the server middleware, stored by request ID, and set on outgoing http and grpc requests via the http.RoundTripper and grpc.UnaryClientInterceptor respectively
Upgrade go version to 1.19
In order to get a version of grpc with a metadata bugfix this PR upgrades the go version of this module
Notes to reviewers
All of the substantive changes here happen in the headerforwarder/ package.
Motivation
Some blockchain networks (looking at you, cosmos) use grpc to communicate with the blockchain node.
This PR makes updates to the
headerforwarder
package to make it easy to use with grpc clientsAdditional Improvements: Outgoing header forwarding
This PR also introduces functionality to set outgoing headers on both grpc and http requests. Previously this was accomplished by individual clients (actually only mesh-geth-sdk was modified so far) defining context-creation behavior. Unfortunately, the request context plumbing was pretty ungainly and required each caller of this SDK to implement their own code for it.
Now the outgoing headers will be captured in the server middleware, stored by request ID, and set on outgoing http and grpc requests via the
http.RoundTripper
andgrpc.UnaryClientInterceptor
respectivelyUpgrade go version to 1.19
In order to get a version of
grpc
with a metadata bugfix this PR upgrades the go version of this moduleNotes to reviewers
All of the substantive changes here happen in the
headerforwarder/
package.Other changes fall into two categories:
contextFromRequest
changes from v0.8.6templates/
,client/
, andserver/
directoriesgrpc
uses theatomic
package which isn't available in 1.18ioutil
as it was deprecated and thus failing linting