From 38c47e86f7b9476195c5e90b2844add6ec5b5762 Mon Sep 17 00:00:00 2001 From: Turtle Date: Mon, 17 May 2021 02:09:07 -0400 Subject: [PATCH] lncli: Add allow external permissions option to bakemacaroons cli call --- cmd/lncli/cmd_macaroon.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/lncli/cmd_macaroon.go b/cmd/lncli/cmd_macaroon.go index 45eb1f735..01fee4558 100644 --- a/cmd/lncli/cmd_macaroon.go +++ b/cmd/lncli/cmd_macaroon.go @@ -23,7 +23,7 @@ var bakeMacaroonCommand = cli.Command{ Category: "Macaroons", Usage: "Bakes a new macaroon with the provided list of permissions " + "and restrictions.", - ArgsUsage: "[--save_to=] [--timeout=] [--ip_address=] permissions...", + ArgsUsage: "[--save_to=] [--timeout=] [--ip_address=] [--allow_external_permissions] permissions...", Description: ` Bake a new macaroon that grants the provided permissions and optionally adds restrictions (timeout, IP address) to it. @@ -69,6 +69,10 @@ var bakeMacaroonCommand = cli.Command{ Name: "root_key_id", Usage: "the numerical root key ID used to create the macaroon", }, + cli.BoolFlag{ + Name: "allow_external_permissions", + Usage: "whether permissions lnd is not familiar with are allowed", + }, }, Action: actionDecorator(bakeMacaroon), } @@ -148,8 +152,9 @@ func bakeMacaroon(ctx *cli.Context) error { // Now we have gathered all the input we need and can do the actual // RPC call. req := &lnrpc.BakeMacaroonRequest{ - Permissions: parsedPermissions, - RootKeyId: rootKeyID, + Permissions: parsedPermissions, + RootKeyId: rootKeyID, + AllowExternalPermissions: ctx.Bool("allow_external_permissions"), } resp, err := client.BakeMacaroon(ctxc, req) if err != nil {