lnrpc+rpcperms+lntest: add unique MW message ID

This commit adds a new unique intercept message ID that is different for
each message sent to an RPC middleware. This will allow us to re-purpose
the existing request ID field into its original intention, which was to
have a unique ID for a full gRPC request/response pair or gRPC stream as
a whole.
This commit is contained in:
Oliver Gugger committed 2021-11-08 15:00:29 +01:00
1 parent 54584aabb6
commit 9a28a4a9ff
5 files changed
+519 -484

No files matched your search

+18 -6
View File
@@ -4175,8 +4175,10 @@ message CheckMacPermResponse {
message RPCMiddlewareRequest {
/*
The unique ID of the intercepted request. Useful for mapping request to
response when implementing full duplex message interception.
The unique ID of the intercepted original gRPC request. Useful for mapping
request to response when implementing full duplex message interception. For
streaming requests, this will be the same ID for all incoming and outgoing
middleware intercept messages of the _same_ stream.
*/
uint64 request_id = 1;
@@ -4231,6 +4233,16 @@ message RPCMiddlewareRequest {
*/
RPCMessage response = 6;
}
/*
The unique message ID of this middleware intercept message. There can be
multiple middleware intercept messages per single gRPC request (one for the
incoming request and one for the outgoing response) or gRPC stream (one for
each incoming message and one for each outgoing response). This message ID
must be referenced when responding (accepting/rejecting/modifying) to an
intercept message.
*/
uint64 msg_id = 7;
}
message StreamAuth {
@@ -4270,11 +4282,11 @@ message RPCMessage {
message RPCMiddlewareResponse {
/*
The unique ID of the intercepted request that this response refers to. Must
always be set when giving feedback to an intercept but is ignored for the
initial registration message.
The request message ID this response refers to. Must always be set when
giving feedback to an intercept but is ignored for the initial registration
message.
*/
uint64 request_id = 1;
uint64 ref_msg_id = 1;
/*
The middleware can only send two types of messages to lnd: The initial