MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestDecryptConfig_NoMasterKey

Function TestDecryptConfig_NoMasterKey

pkg/config/loader_test.go:466–477  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

464}
465
466func TestDecryptConfig_NoMasterKey(t *testing.T) {
467 os.Unsetenv("TRYSSH_MASTER_KEY")
468 clearMasterKeyForTest()
469
470 // Plaintext config — no prompt needed, no error
471 conf := &MainConfig{}
472 conf.Main.Passwords = []string{"plaintext"}
473
474 err := decryptConfig(conf)
475 assert.NoError(t, err)
476 assert.Equal(t, "plaintext", conf.Main.Passwords[0])
477}
478
479func TestDecryptConfig_EncryptedButNoKey(t *testing.T) {
480 os.Unsetenv("TRYSSH_MASTER_KEY")

Callers

nothing calls this directly

Calls 2

clearMasterKeyForTestFunction · 0.85
decryptConfigFunction · 0.85

Tested by

no test coverage detected