lnrpc: describe request replacement in API docs

This commit updates the comments in the proto file to mention the new
behavior of also being able to replace request messages.
This commit is contained in:
Oliver Gugger committed 2022-07-14 09:36:36 +02:00
1 parent 86c64abfe6
commit d604055ccc
3 files changed
+10 -14

No files matched your search

+4 -6
View File
@@ -16206,16 +16206,14 @@ type InterceptFeedback struct {
//response and the processing of it can continue. //response and the processing of it can continue.
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
// //
//A boolean indicating that the gRPC response should be replaced/overwritten. //A boolean indicating that the gRPC message should be replaced/overwritten.
//As its name suggests, this can only be used as a feedback to an intercepted //This boolean is needed because in protobuf an empty message is serialized as
//response RPC message and is ignored for feedback on any other message. This //a 0-length or nil byte slice and we wouldn't be able to distinguish between
//boolean is needed because in protobuf an empty message is serialized as a
//0-length or nil byte slice and we wouldn't be able to distinguish between
//an empty replacement message and the "don't replace anything" case. //an empty replacement message and the "don't replace anything" case.
ReplaceResponse bool `protobuf:"varint,2,opt,name=replace_response,json=replaceResponse,proto3" json:"replace_response,omitempty"` ReplaceResponse bool `protobuf:"varint,2,opt,name=replace_response,json=replaceResponse,proto3" json:"replace_response,omitempty"`
// //
//If the replace_response field is set to true, this field must contain the //If the replace_response field is set to true, this field must contain the
//binary serialized gRPC response message in the protobuf format. //binary serialized gRPC message in the protobuf format.
ReplacementSerialized []byte `protobuf:"bytes,3,opt,name=replacement_serialized,json=replacementSerialized,proto3" json:"replacement_serialized,omitempty"` ReplacementSerialized []byte `protobuf:"bytes,3,opt,name=replacement_serialized,json=replacementSerialized,proto3" json:"replacement_serialized,omitempty"`
} }
+4 -6
View File
@@ -4501,18 +4501,16 @@ message InterceptFeedback {
string error = 1; string error = 1;
/* /*
A boolean indicating that the gRPC response should be replaced/overwritten. A boolean indicating that the gRPC message should be replaced/overwritten.
As its name suggests, this can only be used as a feedback to an intercepted This boolean is needed because in protobuf an empty message is serialized as
response RPC message and is ignored for feedback on any other message. This a 0-length or nil byte slice and we wouldn't be able to distinguish between
boolean is needed because in protobuf an empty message is serialized as a
0-length or nil byte slice and we wouldn't be able to distinguish between
an empty replacement message and the "don't replace anything" case. an empty replacement message and the "don't replace anything" case.
*/ */
bool replace_response = 2; bool replace_response = 2;
/* /*
If the replace_response field is set to true, this field must contain the If the replace_response field is set to true, this field must contain the
binary serialized gRPC response message in the protobuf format. binary serialized gRPC message in the protobuf format.
*/ */
bytes replacement_serialized = 3; bytes replacement_serialized = 3;
} }
+2 -2
View File
@@ -4682,12 +4682,12 @@
}, },
"replace_response": { "replace_response": {
"type": "boolean", "type": "boolean",
"description": "A boolean indicating that the gRPC response should be replaced/overwritten.\nAs its name suggests, this can only be used as a feedback to an intercepted\nresponse RPC message and is ignored for feedback on any other message. This\nboolean is needed because in protobuf an empty message is serialized as a\n0-length or nil byte slice and we wouldn't be able to distinguish between\nan empty replacement message and the \"don't replace anything\" case." "description": "A boolean indicating that the gRPC message should be replaced/overwritten.\nThis boolean is needed because in protobuf an empty message is serialized as\na 0-length or nil byte slice and we wouldn't be able to distinguish between\nan empty replacement message and the \"don't replace anything\" case."
}, },
"replacement_serialized": { "replacement_serialized": {
"type": "string", "type": "string",
"format": "byte", "format": "byte",
"description": "If the replace_response field is set to true, this field must contain the\nbinary serialized gRPC response message in the protobuf format." "description": "If the replace_response field is set to true, this field must contain the\nbinary serialized gRPC message in the protobuf format."
} }
} }
}, },