lncli: add new listpermissions command
This commit is contained in:
parent
830ce163c6
commit
3ce7f72cd4
@ -282,3 +282,26 @@ func deleteMacaroonID(ctx *cli.Context) error {
|
|||||||
printRespJSON(resp)
|
printRespJSON(resp)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var listPermissionsCommand = cli.Command{
|
||||||
|
Name: "listpermissions",
|
||||||
|
Category: "Macaroons",
|
||||||
|
Usage: "Lists all RPC method URIs and the macaroon permissions they " +
|
||||||
|
"require to be invoked.",
|
||||||
|
Action: actionDecorator(listPermissions),
|
||||||
|
}
|
||||||
|
|
||||||
|
func listPermissions(ctx *cli.Context) error {
|
||||||
|
client, cleanUp := getClient(ctx)
|
||||||
|
defer cleanUp()
|
||||||
|
|
||||||
|
request := &lnrpc.ListPermissionsRequest{}
|
||||||
|
response, err := client.ListPermissions(context.Background(), request)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
printRespJSON(response)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -303,6 +303,7 @@ func main() {
|
|||||||
bakeMacaroonCommand,
|
bakeMacaroonCommand,
|
||||||
listMacaroonIDsCommand,
|
listMacaroonIDsCommand,
|
||||||
deleteMacaroonIDCommand,
|
deleteMacaroonIDCommand,
|
||||||
|
listPermissionsCommand,
|
||||||
trackPaymentCommand,
|
trackPaymentCommand,
|
||||||
versionCommand,
|
versionCommand,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user