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:
Elle Mouton
2025-04-20 10:25:46 +02:00
parent c9fe051b2f
commit e9fc852390
4 changed files with 918 additions and 775 deletions

View File

@@ -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 {