This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
Add timeout constraint to macaroon when making RPC calls #12
Labels
enhancement
New feature or request
https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md mentions
I think we could also do this to match the security protections of lncli. This is an enhancement request to add time caveat when using the macaroon.
Suggested way to implement this:
'X=Y'
generate the constraint base on current wall time to match the behaviour of lncli's functionmacaroons.TimeoutConstraint
(call is here:
https://github.com/lightningnetwork/lnd/blob/158a32c4e1a472dfae446478845c0a96e67dd4f7/cmd/lncli/main.go#L117 , definition is here https://github.com/lightningnetwork/lnd/blob/c1c4b84757dd5b1e1fcb285b4a1fa6a56b35432c/macaroons/constraints.go#L46 )
"time-before=Z"
where Z is UTC time in RFC3339Nano format https://sourcegraph.com/github.com/go-macaroon-bakery/macaroon-bakery/-/blob/bakery/checkers/time.go#L34 For example:"time-before=2019-01-02T15:04:05.999999999Z07:00"
The text was updated successfully, but these errors were encountered: