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

This commit is contained in:
Turtle committed 2021-09-14 16:26:28 -05:00
1 parent 1ea6db1f26
commit d10a682fa9
9 files changed
+1000 -571

No files matched your search

+59
View File
@@ -1563,6 +1563,39 @@
]
}
},
"/v1/macaroon/checkpermissions": {
"post": {
"summary": "CheckMacaroonPermissions checks whether a request follows the constraints\nimposed on the macaroon and that the macaroon is authorized to follow the\nprovided permissions.",
"operationId": "Lightning_CheckMacaroonPermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/lnrpcCheckMacPermResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/lnrpcCheckMacPermRequest"
}
}
],
"tags": [
"Lightning"
]
}
},
"/v1/macaroon/ids": {
"get": {
"summary": "lncli: `listmacaroonids`\nListMacaroonIDs returns all root key IDs that are in use.",
@@ -3622,6 +3655,32 @@
}
}
},
"lnrpcCheckMacPermRequest": {
"type": "object",
"properties": {
"macaroon": {
"type": "string",
"format": "byte"
},
"permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/lnrpcMacaroonPermission"
}
},
"fullMethod": {
"type": "string"
}
}
},
"lnrpcCheckMacPermResponse": {
"type": "object",
"properties": {
"valid": {
"type": "boolean"
}
}
},
"lnrpcCloseStatusUpdate": {
"type": "object",
"properties": {