lndclient icon indicating copy to clipboard operation
lndclient copied to clipboard

Implement macaroon-permission-based client loading

Open jalavosus opened this issue 5 years ago • 2 comments

This commit changes core behavior of LndServices; instead of relying on macaroons for all rpc clients to be available, it instead checks the permissions of loaded macaroon files, and determines which clients can be loaded from there.

If a read-only macaroon is not available for client compatibility checking, or admin permissions are not available for a Lightning client, the initialization function will return an error.

Pull Request Checklist

  • [x] PR is opened against correct version branch.
  • [x] Version compatibility matrix in the README and minimal required version in lnd_services.go are updated.

jalavosus avatar Jan 10 '21 05:01 jalavosus

This PR would work really nicely with the behavior implemented in #35, and would allow for more selective client usage.

jalavosus avatar Jan 10 '21 05:01 jalavosus

I also acknowledge that this implementation is kinda messy, and any suggestions for cleaning it up are very much welcome.

jalavosus avatar Jan 10 '21 05:01 jalavosus