mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-12 22:59:38 +02:00
lncli: Add allow external permissions option to bakemacaroons cli call
This commit is contained in:
@@ -23,7 +23,7 @@ var bakeMacaroonCommand = cli.Command{
|
|||||||
Category: "Macaroons",
|
Category: "Macaroons",
|
||||||
Usage: "Bakes a new macaroon with the provided list of permissions " +
|
Usage: "Bakes a new macaroon with the provided list of permissions " +
|
||||||
"and restrictions.",
|
"and restrictions.",
|
||||||
ArgsUsage: "[--save_to=] [--timeout=] [--ip_address=] permissions...",
|
ArgsUsage: "[--save_to=] [--timeout=] [--ip_address=] [--allow_external_permissions] permissions...",
|
||||||
Description: `
|
Description: `
|
||||||
Bake a new macaroon that grants the provided permissions and
|
Bake a new macaroon that grants the provided permissions and
|
||||||
optionally adds restrictions (timeout, IP address) to it.
|
optionally adds restrictions (timeout, IP address) to it.
|
||||||
@@ -69,6 +69,10 @@ var bakeMacaroonCommand = cli.Command{
|
|||||||
Name: "root_key_id",
|
Name: "root_key_id",
|
||||||
Usage: "the numerical root key ID used to create the macaroon",
|
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),
|
Action: actionDecorator(bakeMacaroon),
|
||||||
}
|
}
|
||||||
@@ -150,6 +154,7 @@ func bakeMacaroon(ctx *cli.Context) error {
|
|||||||
req := &lnrpc.BakeMacaroonRequest{
|
req := &lnrpc.BakeMacaroonRequest{
|
||||||
Permissions: parsedPermissions,
|
Permissions: parsedPermissions,
|
||||||
RootKeyId: rootKeyID,
|
RootKeyId: rootKeyID,
|
||||||
|
AllowExternalPermissions: ctx.Bool("allow_external_permissions"),
|
||||||
}
|
}
|
||||||
resp, err := client.BakeMacaroon(ctxc, req)
|
resp, err := client.BakeMacaroon(ctxc, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user