mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-19 13:18:36 +02:00
Since the code for creating and using a macaroon service is the same for multiple projects (pool, loop, faraday & litd), the code has been unified in lndclient. So this commit removes the macaroon service code and instead uses the lndclient code. Since the default key for the macaroon db is now a shared secret with LND, faraday requires LND's admin macaroon so that this secret can be derived. So this commit also updates all references of LND's `readme` macaroon to the `admin` macaroon.
29 lines
910 B
Go
29 lines
910 B
Go
package frdrpcserver
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
// faradayMacaroonLocation is the value we use for the faraday
|
|
// macaroons' "Location" field when baking them.
|
|
faradayMacaroonLocation = "faraday"
|
|
|
|
// macDatabaseOpenTimeout is how long we wait for acquiring the lock on
|
|
// the macaroon database before we give up with an error.
|
|
macDatabaseOpenTimeout = time.Second * 5
|
|
)
|
|
|
|
var (
|
|
|
|
// macDbDefaultPw is the default encryption password used to encrypt the
|
|
// faraday macaroon database. The macaroon service requires us to set a
|
|
// non-nil password so we set it to an empty string. This will cause the
|
|
// keys to be encrypted on disk but won't provide any security at all as
|
|
// the password is known to anyone.
|
|
//
|
|
// TODO(guggero): Allow the password to be specified by the user. Needs
|
|
// create/unlock calls in the RPC. Using a password should be optional
|
|
// though.
|
|
macDbDefaultPw = []byte("")
|
|
)
|