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 (
7
7
"github.com/lightninglabs/faraday"
8
8
"github.com/lightninglabs/faraday/frdrpc"
9
9
"github.com/lightninglabs/faraday/frdrpcserver"
10
+ "github.com/lightninglabs/faraday/frdrpcserver/perms"
10
11
"github.com/lightninglabs/lndclient"
11
12
"github.com/lightningnetwork/lnd/lnrpc"
12
13
"google.golang.org/grpc"
14
+ "gopkg.in/macaroon-bakery.v2/bakery"
13
15
)
14
16
15
17
// faradaySubServer implements the SubServer interface.
@@ -108,3 +110,11 @@ func (f *faradaySubServer) ServerErrChan() chan error {
108
110
func (f * faradaySubServer ) MacPath () string {
109
111
return f .cfg .MacaroonPath
110
112
}
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 8
8
"github.com/lightningnetwork/lnd/lnrpc"
9
9
"github.com/lightningnetwork/lnd/macaroons"
10
10
"google.golang.org/grpc"
11
+ "gopkg.in/macaroon-bakery.v2/bakery"
11
12
)
12
13
13
14
// SubServer defines an interface that should be implemented by any sub-server
@@ -53,4 +54,8 @@ type SubServer interface {
53
54
// MacPath returns the path to the sub-server's macaroon if it is not
54
55
// running in remote mode.
55
56
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
56
61
}
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ import (
7
7
"github.com/lightninglabs/lndclient"
8
8
"github.com/lightninglabs/loop"
9
9
"github.com/lightninglabs/loop/loopd"
10
+ "github.com/lightninglabs/loop/loopd/perms"
10
11
"github.com/lightninglabs/loop/looprpc"
11
12
"github.com/lightningnetwork/lnd/lnrpc"
12
13
"google.golang.org/grpc"
14
+ "gopkg.in/macaroon-bakery.v2/bakery"
13
15
)
14
16
15
17
// loopSubServer implements the SubServer interface.
@@ -118,3 +120,11 @@ func (l *loopSubServer) ServerErrChan() chan error {
118
120
func (l * loopSubServer ) MacPath () string {
119
121
return l .cfg .MacaroonPath
120
122
}
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 (
6
6
restProxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
7
7
"github.com/lightninglabs/lndclient"
8
8
"github.com/lightninglabs/pool"
9
+ "github.com/lightninglabs/pool/perms"
9
10
"github.com/lightninglabs/pool/poolrpc"
10
11
"github.com/lightningnetwork/lnd/lnrpc"
11
12
"google.golang.org/grpc"
13
+ "gopkg.in/macaroon-bakery.v2/bakery"
12
14
)
13
15
14
16
// poolSubServer implements the SubServer interface.
@@ -108,3 +110,11 @@ func (p *poolSubServer) ServerErrChan() chan error {
108
110
func (p * poolSubServer ) MacPath () string {
109
111
return p .cfg .MacaroonPath
110
112
}
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