Implement macaroon-permission-based client loading
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.goare updated.
This PR would work really nicely with the behavior implemented in #35, and would allow for more selective client usage.
I also acknowledge that this implementation is kinda messy, and any suggestions for cleaning it up are very much welcome.