Closed sezaru closed 6 years ago
Sorry for the late reply, I stopped receiving mail notifications for some reason.
Basically, there's no standard on how to pass macaroons around. Normally when using HTTP you'd either put them in HTTP header or in the query string, and the macaroon itself is opaque to the transport protocol and thus requires no explicit support.
I can see that lnd gRPC suggests that you pass the macaroon in request's metadata. So it seems that using grpc-elixir you'd just make a request as follows:
Your.Stub.call(channel, request, metadata: %{macaroon: :macaroon.serialize(m)})
Wow @kzemek ,Thanks a lot for that explanation and for the code of how to use it with LND that was much appreciated!
That totally answers my question, so I will close the issue.
Thanks again!
Sorry if this is a dumb question, but does you know any http2 client that supports your macaroons library as a means to do authentication?
In my specific case, I'm trying to connect to a GRPC server which uses macaroon (LND), if I disable macaroon authentication I can connect with it using this GRPC library for elixir https://github.com/tony612/grpc-elixir which uses
gun
internally to do the http2 connection.Looking at
gun
documentation, It seems I would need to provide the macaroon in the transport_opt (same place I put my ca_cert). But since the documentation doesn't say anything about macaroon, I'm not sure how to use it withgun
(or another http2 client).Do you know how or plan to add support to one of these http2 (or GRPC directly) libraries?
It would be nice to be able to do something like that (nodejs code):