Merge pull request #904 from Roasbeef/invoice-macaroon

rpc+lnd: add new invoice-only macaroon
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-03-21 15:27:31 -07:00
commit 7d14ed7a06
3 files changed
+107 -32

No files matched your search

+34 -4
View File
@@ -69,6 +69,10 @@ var (
Entity: "info",
Action: "read",
},
{
Entity: "invoices",
Action: "read",
},
}
// writePermissions is a slice of all entities that allow write
@@ -98,6 +102,32 @@ var (
Entity: "info",
Action: "write",
},
{
Entity: "invoices",
Action: "write",
},
}
// invoicePermissions is a slice of all the entities that allows a user
// to only access calls that are related to invoices, so: streaming
// RPC's, generating, and listening invoices.
invoicePermissions = []bakery.Op{
{
Entity: "invoices",
Action: "read",
},
{
Entity: "invoices",
Action: "write",
},
{
Entity: "address",
Action: "read",
},
{
Entity: "address",
Action: "write",
},
}
// permissions maps RPC calls to the permissions they require.
@@ -188,19 +218,19 @@ var (
Action: "write",
}},
"/lnrpc.Lightning/AddInvoice": {{
Entity: "offchain",
Entity: "invoices",
Action: "write",
}},
"/lnrpc.Lightning/LookupInvoice": {{
Entity: "offchain",
Entity: "invoices",
Action: "read",
}},
"/lnrpc.Lightning/ListInvoices": {{
Entity: "offchain",
Entity: "invoices",
Action: "read",
}},
"/lnrpc.Lightning/SubscribeInvoices": {{
Entity: "offchain",
Entity: "invoices",
Action: "read",
}},
"/lnrpc.Lightning/SubscribeTransactions": {{