REST: Baking macaroon array lnrpcMacaroonPermission
type
#6786
-
BackgroundI am trying to bake a macaroon with custom permissions and cannot find the right type to include in the body. Your environment
Steps to reproduceTell us how to reproduce this issue. Please provide stacktraces and links to code in question. Expected behaviourReturn a macaroon on the REST interface.
Actual behaviourReturns: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
How are you running/building the REST query? I ran the following command on a local LND node:
and it returned:
|
Beta Was this translation helpful? Give feedback.
-
Building it on the frontend with axios.
|
Beta Was this translation helpful? Give feedback.
-
I just tried successfully running: axios({
method: 'POST',
url: "https://localhost:8091/v1/macaroon",
headers: {
'Grpc-Metadata-macaroon': macaroon,
'Content-Type': 'application/json'
},
data: {"permissions": [{"entity": "offchain", "action": "read"}]},
withCredentials: false,
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
}).then(function (response: any) {
console.log(response.data);
}).catch(function (error: any) {
console.log(error);
});
// returns
// {
// macaroon: '0201036...'
// } NOTE: Using |
Beta Was this translation helpful? Give feedback.
I just tried successfully running:
NOTE: Using
body
did not work for me, instead I was usingdata
.I also just tried axios for the first time, so I'm unsure of all intermediate steps you ar…