Keep secret get values in locked memory (closes #37)
check / check (push) Failing after 3s

Vault.GetSecret and Vault.GetSecretVersion return the decrypted value
as a *memguard.LockedBuffer instead of copying it into an ordinary
[]byte that nothing wiped. Every caller destroys the buffer, and
`secret get` writes its bytes straight to stdout, still with no
trailing newline. Instance.Print, which formatted through fmt and had
no other callers, is removed, and so is a debug log line in
`get --version` that held the plaintext value.

Model: opus-5-5
This commit is contained in:
2026-10-04 07:49:21 +00:00
parent cba526d33f
commit 830e7d4a04
14 changed files with 173 additions and 73 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ func TestCreateExistingVaultChangesNothing(t *testing.T) {
for _, name := range vaults {
value, err := vault.NewVault(fs, testStateDir, name).GetSecret("x")
require.NoError(t, err)
require.Equal(t, "value", string(value))
require.Equal(t, []byte("value"), value.Bytes())
value.Destroy()
}
}