mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
multi: add RPC middleware interception
With the middleware handler in place, we now need to add a new gRPC interceptor to the interceptor chain that will send messages to the registered middlewares for each event that could be of interest to them.
This commit is contained in:
@@ -540,6 +540,23 @@ service Lightning {
|
||||
*/
|
||||
rpc CheckMacaroonPermissions (CheckMacPermRequest)
|
||||
returns (CheckMacPermResponse);
|
||||
|
||||
/*
|
||||
RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A
|
||||
gRPC middleware is software component external to lnd that aims to add
|
||||
additional business logic to lnd by observing/intercepting/validating
|
||||
incoming gRPC client requests and (if needed) replacing/overwriting outgoing
|
||||
messages before they're sent to the client. When registering the middleware
|
||||
must identify itself and indicate what custom macaroon caveats it wants to
|
||||
be responsible for. Only requests that contain a macaroon with that specific
|
||||
custom caveat are then sent to the middleware for inspection. The other
|
||||
option is to register for the read-only mode in which all requests/responses
|
||||
are forwarded for interception to the middleware but the middleware is not
|
||||
allowed to modify any responses. As a security measure, _no_ middleware can
|
||||
modify responses for requests made with _unencumbered_ macaroons!
|
||||
*/
|
||||
rpc RegisterRPCMiddleware (stream RPCMiddlewareResponse)
|
||||
returns (stream RPCMiddlewareRequest);
|
||||
}
|
||||
|
||||
message Utxo {
|
||||
|
Reference in New Issue
Block a user