Skip to content

Commit 517b598

Browse files
committed
multi: export funcs for baking super macaroons
1 parent 59cc505 commit 517b598

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

session_rpcserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (s *sessionRpcServer) resumeSession(sess *session.Session) error {
124124
readOnly := sess.Type == session.TypeMacaroonReadonly
125125
mac, err := s.superMacBaker(
126126
ctx, sess.MacaroonRootKey, &session.MacaroonRecipe{
127-
Permissions: getAllPermissions(readOnly),
127+
Permissions: GetAllPermissions(readOnly),
128128
},
129129
)
130130
if err != nil {

subserver_permissions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ func getAllMethodPermissions() map[string][]bakery.Op {
7373
return result
7474
}
7575

76-
// getAllPermissions retrieves all the permissions needed to bake a super
76+
// GetAllPermissions retrieves all the permissions needed to bake a super
7777
// macaroon.
78-
func getAllPermissions(readOnly bool) []bakery.Op {
78+
func GetAllPermissions(readOnly bool) []bakery.Op {
7979
dedupMap := make(map[string]map[string]bool)
8080

8181
for _, methodPerms := range getAllMethodPermissions() {

terminal.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (g *LightningTerminal) Run() error {
229229
superMacBaker: func(ctx context.Context, rootKeyID uint64,
230230
recipe *session.MacaroonRecipe) (string, error) {
231231

232-
return bakeSuperMacaroon(
232+
return BakeSuperMacaroon(
233233
ctx, g.basicClient, rootKeyID,
234234
recipe.Permissions, recipe.Caveats,
235235
)
@@ -504,11 +504,11 @@ func (g *LightningTerminal) startSubservers() error {
504504
// Create a super macaroon that can be used to control lnd,
505505
// faraday, loop, and pool, all at the same time.
506506
ctx := context.Background()
507-
superMacaroon, err := bakeSuperMacaroon(
507+
superMacaroon, err := BakeSuperMacaroon(
508508
ctx, g.basicClient, session.NewSuperMacaroonRootKeyID(
509509
[4]byte{},
510510
),
511-
getAllPermissions(false), nil,
511+
GetAllPermissions(false), nil,
512512
)
513513
if err != nil {
514514
return err
@@ -1129,9 +1129,9 @@ func (g *LightningTerminal) createRESTProxy() error {
11291129
return nil
11301130
}
11311131

1132-
// bakeSuperMacaroon uses the lnd client to bake a macaroon that can include
1132+
// BakeSuperMacaroon uses the lnd client to bake a macaroon that can include
11331133
// permissions for multiple daemons.
1134-
func bakeSuperMacaroon(ctx context.Context, lnd lnrpc.LightningClient,
1134+
func BakeSuperMacaroon(ctx context.Context, lnd lnrpc.LightningClient,
11351135
rootKeyID uint64, perms []bakery.Op, caveats []macaroon.Caveat) (string,
11361136
error) {
11371137

0 commit comments

Comments
 (0)