filecoin-project / filecoin-project/filecoin-pin

test(cli): prove a session private key never reaches any output

Open
#712 0 comments 0 reactions 0 assignees View on GitHub
team/filecoin-pin team/fs-wg
Dominant language
TypeScript
Stars
26
Forks
21
Avg merge
5d 18h
Merged PRs (30d)
27

Description

### Description

No test proves a session private key never reaches stdout, stderr, the logger, telemetry, or the rerun hint. The key is copied into `process.env.SESSION_KEY` by auto-load and by `--credentials-file`, and the upload paths log raw error objects. Today's guarantee rests on reading the code, not on a check that fails when someone adds a log line.

### Impact

A regression would write a private key into CI logs, agent transcripts, or Sentry. Nobody would notice until a key was misused.

### Expected behavior

A unit test that plants a sentinel private key through each credential path (`SESSION_KEY` env, `--credentials-file`, the saved session file) and drives the paths that print the most: `login` with a saved session, `balance`, `add` failing its funds preflight, `import` failing its preflight, an RPC error with `--verbose`, and a telemetry flush failure. The test captures every log sink and fails if the sentinel, or any 64-hex string, appears.

### Additional context

Raised in the Sep 8 safety review of the login stack (#699 to #703), which added the redacted rerun hint and the credentials-file allowlist. Related: #697, #711.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.