mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
macaroons: futher abstract NewService from root key store impl
In this commit, we modify the `macaroons.NewService` consturctor to accept the main interface rather than the raw DB. This allows us to use other backends other than bolt or the kvdb interface to store the macaroon root keys. We also create a new ExtendedRootKeyStore interface that implements some of the more advanced features we use such as macaroon encryption and password rotation.
This commit is contained in:
@@ -807,8 +807,12 @@ func (u *UnlockerService) ChangePassword(ctx context.Context,
|
||||
// then close it again.
|
||||
// Attempt to open the macaroon DB, unlock it and then change
|
||||
// the passphrase.
|
||||
rootKeyStore, err := macaroons.NewRootKeyStorage(u.macaroonDB)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
macaroonService, err := macaroons.NewService(
|
||||
u.macaroonDB, "lnd", in.StatelessInit,
|
||||
rootKeyStore, "lnd", in.StatelessInit,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user