mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
terminal: allow super macaroons in remote mode
This commit is contained in:
parent
36c524db71
commit
fcb4e2ac61
1 changed files with 10 additions and 5 deletions
15
terminal.go
15
terminal.go
|
|
@ -649,11 +649,16 @@ func (g *LightningTerminal) ValidateMacaroon(ctx context.Context,
|
|||
return err
|
||||
}
|
||||
|
||||
// If we're in integrated mode, we're using a super macaroon internally,
|
||||
// which we can just pass straight to lnd for validation. But the user
|
||||
// might still be using a specific macaroon, which should be handled the
|
||||
// same as before.
|
||||
if g.cfg.LndMode == ModeIntegrated && session.IsSuperMacaroon(macHex) {
|
||||
// If we're using a super macaroon, we just make sure it is valid and
|
||||
// contains all the permissions needed. If we get to this point, we're
|
||||
// either in integrated lnd mode where this is the only macaroon
|
||||
// validation function, and we're done after the check. Or we're in
|
||||
// remote lnd mode but the request is for an in-process daemon which we
|
||||
// can validate here. Any request for a remote sub-daemon goes through
|
||||
// the proxy and its director and any super macaroon will be converted
|
||||
// to a daemon specific macaroon before directing the call to the remote
|
||||
// daemon. Those calls don't land here.
|
||||
if session.IsSuperMacaroon(macHex) {
|
||||
macBytes, err := hex.DecodeString(macHex)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue