lncli: print all permission actions
Due to a misunderstanding about how the entities/actions are encoded inside the macaroon, only the first action was printed per entity. Even though we add them as separate pairs in the macaroon service (for example "offchain:read" and "offchain:write"), they are grouped in the serialized macaroon ("offchain:read,write").
This commit is contained in:
parent
c704c5747a
commit
384ab9f616
@ -399,8 +399,12 @@ func printMacaroon(ctx *cli.Context) error {
|
|||||||
content.Caveats = append(content.Caveats, string(caveat.Id))
|
content.Caveats = append(content.Caveats, string(caveat.Id))
|
||||||
}
|
}
|
||||||
for _, op := range decodedID.Ops {
|
for _, op := range decodedID.Ops {
|
||||||
permission := fmt.Sprintf("%s:%s", op.Entity, op.Actions[0])
|
for _, action := range op.Actions {
|
||||||
content.Permissions = append(content.Permissions, permission)
|
permission := fmt.Sprintf("%s:%s", op.Entity, action)
|
||||||
|
content.Permissions = append(
|
||||||
|
content.Permissions, permission,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printJSON(content)
|
printJSON(content)
|
||||||
|
Loading…
Reference in New Issue
Block a user