Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement macaroon-permission-based client loading #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jalavosus
Copy link

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

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

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.
@jalavosus
Copy link
Author

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

@jalavosus
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant