macaroons+rpcserver: Add new RPC call for checking macaroon permissions

This commit is contained in:
Turtle
2021-05-17 02:19:30 -04:00
parent 1ea6db1f26
commit d10a682fa9
9 changed files with 1000 additions and 571 deletions

View File

@@ -532,6 +532,14 @@ service Lightning {
*/
rpc ListPermissions (ListPermissionsRequest)
returns (ListPermissionsResponse);
/*
CheckMacaroonPermissions checks whether a request follows the constraints
imposed on the macaroon and that the macaroon is authorized to follow the
provided permissions.
*/
rpc CheckMacaroonPermissions (CheckMacPermRequest)
returns (CheckMacPermResponse);
}
message Utxo {
@@ -4006,3 +4014,13 @@ message Op {
string entity = 1;
repeated string actions = 2;
}
message CheckMacPermRequest {
bytes macaroon = 1;
repeated MacaroonPermission permissions = 2;
string fullMethod = 3;
}
message CheckMacPermResponse {
bool valid = 1;
}