mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-02 19:44:03 +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:
3
lnd.go
3
lnd.go
@ -352,7 +352,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, interceptor signal.Interceptor) error
|
||||
// Create a new RPC interceptor that we'll add to the GRPC server. This
|
||||
// will be used to log the API calls invoked on the GRPC server.
|
||||
interceptorChain := rpcperms.NewInterceptorChain(
|
||||
rpcsLog, cfg.NoMacaroons,
|
||||
rpcsLog, cfg.NoMacaroons, cfg.RPCMiddleware.Mandatory,
|
||||
)
|
||||
if err := interceptorChain.Start(); err != nil {
|
||||
return err
|
||||
@ -582,6 +582,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, interceptor signal.Interceptor) error
|
||||
macaroonService, err = macaroons.NewService(
|
||||
dbs.macaroonDB, "lnd", walletInitParams.StatelessInit,
|
||||
macaroons.IPLockChecker,
|
||||
macaroons.CustomChecker(interceptorChain),
|
||||
)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("unable to set up macaroon "+
|
||||
|
Reference in New Issue
Block a user