mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
macaroons: add IP lock macaroon constraint
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
a6b9155150
commit
679e86174f
@@ -85,6 +85,9 @@ func getClientConn(ctx *cli.Context) *grpc.ClientConn {
|
||||
// TODO(aakselrod): add better anti-replay protection.
|
||||
macaroons.TimeoutConstraint(ctx.GlobalInt64("macaroontimeout")),
|
||||
|
||||
// Lock macaroon down to a specific IP address.
|
||||
macaroons.IPLockConstraint(ctx.GlobalString("macaroonip")),
|
||||
|
||||
// ... Add more constraints if needed.
|
||||
}
|
||||
|
||||
@@ -134,6 +137,10 @@ func main() {
|
||||
Value: 60,
|
||||
Usage: "anti-replay macaroon validity time in seconds",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "macaroonip",
|
||||
Usage: "if set, lock macaroon to specific IP address",
|
||||
},
|
||||
}
|
||||
app.Commands = []cli.Command{
|
||||
newAddressCommand,
|
||||
|
||||
Reference in New Issue
Block a user