lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
487 stars 82 forks source link

cmd/litcli: add super macaroon helper commands #568

Closed ellemouton closed 1 year ago

ellemouton commented 1 year ago

This PR adds a few super macaroon related commands:

The supermacrootkey and issupermacaroon commands dont require a connection to LiTd.

ellemouton commented 1 year ago

cc @gkrizek

ellemouton commented 1 year ago

happy to add any other helpers in this area that would be useful :) ideas welcome!

ellemouton commented 1 year ago

i could maybe add a bakesupermac endpoint?

CRex15 commented 1 year ago

i could maybe add a bakesupermac endpoint?

That would be quite helpful. It was quite complicated and error prone trying to bake the super macaroon with the normal BakeMacaroon API as described here: https://github.com/lightninglabs/lightning-api-ng/issues/19. I think it would also help clarify that there is a difference between the two, which I was unaware of before running into that issue.

lightninglabs-deploy commented 1 year ago

@ellemouton, remember to re-request review from reviewers when ready

guggero commented 1 year ago

Ah, just one request: Can we please add the new RPC to one of the itests? Just to make sure authentication and everything works as expected.

ellemouton commented 1 year ago

Can we please add the new RPC to one of the itests? Just to make sure authentication and everything works as expected.

is this not covered by the existing test for litrpc.Proxy.GetInfo? since they are both for the same rpc service.

or do you mean that we should use the new endpoint to bake a macaroon in the itests & then test that that macaroon works for other endpoints?

guggero commented 1 year ago

is this not covered by the existing test for litrpc.Proxy.GetInfo? since they are both for the same rpc service.

Ah yes, you're right. So all the security restrictions should apply to the new call as well. SGTM.