File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ import (
77 "github.com/lightninglabs/faraday"
88 "github.com/lightninglabs/faraday/frdrpc"
99 "github.com/lightninglabs/faraday/frdrpcserver"
10+ "github.com/lightninglabs/faraday/frdrpcserver/perms"
1011 "github.com/lightninglabs/lndclient"
1112 "github.com/lightningnetwork/lnd/lnrpc"
1213 "google.golang.org/grpc"
14+ "gopkg.in/macaroon-bakery.v2/bakery"
1315)
1416
1517// faradaySubServer implements the SubServer interface.
@@ -108,3 +110,11 @@ func (f *faradaySubServer) ServerErrChan() chan error {
108110func (f * faradaySubServer ) MacPath () string {
109111 return f .cfg .MacaroonPath
110112}
113+
114+ // Permissions returns a map of all RPC methods and their required macaroon
115+ // permissions to access the sub-server.
116+ //
117+ // NOTE: this is part of the SubServer interface.
118+ func (f * faradaySubServer ) Permissions () map [string ][]bakery.Op {
119+ return perms .RequiredPermissions
120+ }
Original file line number Diff line number Diff line change 88 "github.com/lightningnetwork/lnd/lnrpc"
99 "github.com/lightningnetwork/lnd/macaroons"
1010 "google.golang.org/grpc"
11+ "gopkg.in/macaroon-bakery.v2/bakery"
1112)
1213
1314// SubServer defines an interface that should be implemented by any sub-server
@@ -53,4 +54,8 @@ type SubServer interface {
5354 // MacPath returns the path to the sub-server's macaroon if it is not
5455 // running in remote mode.
5556 MacPath () string
57+
58+ // Permissions returns a map of all RPC methods and their required
59+ // macaroon permissions to access the sub-server.
60+ Permissions () map [string ][]bakery.Op
5661}
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ import (
77 "github.com/lightninglabs/lndclient"
88 "github.com/lightninglabs/loop"
99 "github.com/lightninglabs/loop/loopd"
10+ "github.com/lightninglabs/loop/loopd/perms"
1011 "github.com/lightninglabs/loop/looprpc"
1112 "github.com/lightningnetwork/lnd/lnrpc"
1213 "google.golang.org/grpc"
14+ "gopkg.in/macaroon-bakery.v2/bakery"
1315)
1416
1517// loopSubServer implements the SubServer interface.
@@ -118,3 +120,11 @@ func (l *loopSubServer) ServerErrChan() chan error {
118120func (l * loopSubServer ) MacPath () string {
119121 return l .cfg .MacaroonPath
120122}
123+
124+ // Permissions returns a map of all RPC methods and their required macaroon
125+ // permissions to access the sub-server.
126+ //
127+ // NOTE: this is part of the SubServer interface.
128+ func (l * loopSubServer ) Permissions () map [string ][]bakery.Op {
129+ return perms .RequiredPermissions
130+ }
Original file line number Diff line number Diff line change @@ -6,9 +6,11 @@ import (
66 restProxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
77 "github.com/lightninglabs/lndclient"
88 "github.com/lightninglabs/pool"
9+ "github.com/lightninglabs/pool/perms"
910 "github.com/lightninglabs/pool/poolrpc"
1011 "github.com/lightningnetwork/lnd/lnrpc"
1112 "google.golang.org/grpc"
13+ "gopkg.in/macaroon-bakery.v2/bakery"
1214)
1315
1416// poolSubServer implements the SubServer interface.
@@ -108,3 +110,11 @@ func (p *poolSubServer) ServerErrChan() chan error {
108110func (p * poolSubServer ) MacPath () string {
109111 return p .cfg .MacaroonPath
110112}
113+
114+ // Permissions returns a map of all RPC methods and their required macaroon
115+ // permissions to access the sub-server.
116+ //
117+ // NOTE: this is part of the SubServer interface.
118+ func (p * poolSubServer ) Permissions () map [string ][]bakery.Op {
119+ return perms .RequiredPermissions
120+ }
You can’t perform that action at this time.
0 commit comments