forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lightningnetwork#8188 from guggero/debug-rpcs
rpcserver+lncli: add ability to create encrypted debug information package
- Loading branch information
Showing
16 changed files
with
4,288 additions
and
3,289 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package lnd | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/lightningnetwork/lnd/chainreg" | ||
"github.com/lightningnetwork/lnd/routing" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var ( | ||
testPassword = "testpassword" | ||
redactedPassword = "[redacted]" | ||
) | ||
|
||
// TestConfigToFlatMap tests that the configToFlatMap function works as | ||
// expected on the default configuration. | ||
func TestConfigToFlatMap(t *testing.T) { | ||
cfg := DefaultConfig() | ||
cfg.BitcoindMode.RPCPass = testPassword | ||
cfg.BtcdMode.RPCPass = testPassword | ||
cfg.Tor.Password = testPassword | ||
cfg.DB.Etcd.Pass = testPassword | ||
cfg.DB.Postgres.Dsn = testPassword | ||
|
||
result, err := configToFlatMap(cfg) | ||
require.NoError(t, err) | ||
|
||
// Pick a couple of random values to check. | ||
require.Equal(t, DefaultLndDir, result["lnddir"]) | ||
require.Equal( | ||
t, fmt.Sprintf("%v", chainreg.DefaultBitcoinTimeLockDelta), | ||
result["bitcoin.timelockdelta"], | ||
) | ||
require.Equal( | ||
t, fmt.Sprintf("%v", routing.DefaultAprioriWeight), | ||
result["routerrpc.apriori.weight"], | ||
) | ||
require.Contains(t, result, "routerrpc.routermacaroonpath") | ||
|
||
// Check that sensitive values are not included. | ||
require.Equal(t, redactedPassword, result["bitcoind.rpcpass"]) | ||
require.Equal(t, redactedPassword, result["btcd.rpcpass"]) | ||
require.Equal(t, redactedPassword, result["tor.password"]) | ||
require.Equal(t, redactedPassword, result["db.etcd.pass"]) | ||
require.Equal(t, redactedPassword, result["db.postgres.dsn"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.