lnrpc+rpcserver: support list/delete on marcaroon IDs

This commit is contained in:
yyforyongyu
2020-07-24 00:36:42 +08:00
parent f362f7670b
commit c0e2513350
13 changed files with 1383 additions and 756 deletions

12
lnd.go
View File

@@ -862,8 +862,8 @@ func genMacaroons(ctx context.Context, svc *macaroons.Service,
// access invoice related calls. This is useful for merchants and other
// services to allow an isolated instance that can only query and
// modify invoices.
invoiceMac, err := svc.Oven.NewMacaroon(
ctx, bakery.LatestVersion, nil, invoicePermissions...,
invoiceMac, err := svc.NewMacaroon(
ctx, macaroons.DefaultRootKeyID, invoicePermissions...,
)
if err != nil {
return err
@@ -879,8 +879,8 @@ func genMacaroons(ctx context.Context, svc *macaroons.Service,
}
// Generate the read-only macaroon and write it to a file.
roMacaroon, err := svc.Oven.NewMacaroon(
ctx, bakery.LatestVersion, nil, readPermissions...,
roMacaroon, err := svc.NewMacaroon(
ctx, macaroons.DefaultRootKeyID, readPermissions...,
)
if err != nil {
return err
@@ -896,8 +896,8 @@ func genMacaroons(ctx context.Context, svc *macaroons.Service,
// Generate the admin macaroon and write it to a file.
adminPermissions := append(readPermissions, writePermissions...)
admMacaroon, err := svc.Oven.NewMacaroon(
ctx, bakery.LatestVersion, nil, adminPermissions...,
admMacaroon, err := svc.NewMacaroon(
ctx, macaroons.DefaultRootKeyID, adminPermissions...,
)
if err != nil {
return err