MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestDebugLogFilePermsAreOwnerOnly

Function TestDebugLogFilePermsAreOwnerOnly

internal/tui/tui_test.go:681–692  ·  view source on GitHub ↗

TestDebugLogFilePermsAreOwnerOnly: the log captures every prompt and tool-call payload: bash args can carry heredoc secrets, so a world-readable log leaks them. 0o600 only.

(t *testing.T)

Source from the content-addressed store, hash-verified

679// payload: bash args can carry heredoc secrets, so a world-readable log leaks
680// them. 0o600 only.
681func TestDebugLogFilePermsAreOwnerOnly(t *testing.T) {
682 dir := t.TempDir()
683 OpenDebugLog(dir)
684 t.Cleanup(CloseDebugLog)
685 st, err := os.Stat(filepath.Join(dir, "log.txt"))
686 if err != nil {
687 t.Fatal(err)
688 }
689 if got := st.Mode().Perm(); got != 0o600 {
690 t.Fatalf("log.txt perms = %v, want 0o600", got)
691 }
692}
693
694// TestVerboseLogCapturesTurnRecords drives a realistic two-round turn (reasoning
695// → bash tool call → final answer) with logging on, and asserts the verbose

Callers

nothing calls this directly

Calls 1

OpenDebugLogFunction · 0.85

Tested by

no test coverage detected