mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
lnrpc+rpcperms: add ctx metadata pairs to RPCMiddlewareRequest
The MW interceptor works via a stream & sends requests to the interceptor via this stream. Sometimes, the interceptor might want to work with grpc metadata pairs that were sent via the context of the original request though and so in this commit, we ensure that for each request sent via the stream to the interceptr, the grpc metadata is sent along explicitly as well. This is done by adding a new `metadata_pairs` field to the RPCMiddlewareRequest proto message.
This commit is contained in:
@@ -5128,6 +5128,22 @@ message RPCMiddlewareRequest {
|
||||
intercept message.
|
||||
*/
|
||||
uint64 msg_id = 7;
|
||||
|
||||
/*
|
||||
The metadata pairs that were sent along with the original gRPC request via
|
||||
the golang context.Context using explicit [gRPC
|
||||
metadata](https://grpc.io/docs/guides/metadata/). Context values are not
|
||||
propagated via gRPC and so we send any pairs along explicitly here so that
|
||||
the interceptor can access them.
|
||||
*/
|
||||
map<string, MetadataValues> metadata_pairs = 9;
|
||||
}
|
||||
|
||||
message MetadataValues {
|
||||
/*
|
||||
The set of metadata values that correspond to the metadata key.
|
||||
*/
|
||||
repeated string values = 1;
|
||||
}
|
||||
|
||||
message StreamAuth {
|
||||
|
Reference in New Issue
Block a user