Skip to content

Commit 84df1bf

Browse files
committed
terminal: don't verify macaroon for whitelisted calls
1 parent 705bf12 commit 84df1bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

terminal.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,12 @@ func (g *LightningTerminal) RegisterRestSubserver(ctx context.Context,
964964
func (g *LightningTerminal) ValidateMacaroon(ctx context.Context,
965965
requiredPermissions []bakery.Op, fullMethod string) error {
966966

967+
// If the URL being queried has been whitelisted, then no macaroon
968+
// validation is required for the query.
969+
if g.permsMgr.IsWhiteListedURL(fullMethod) {
970+
return nil
971+
}
972+
967973
macHex, err := macaroons.RawMacaroonFromContext(ctx)
968974
if err != nil {
969975
return err

0 commit comments

Comments
 (0)