Repository navigation
Conversation
Covers the security features from XPRNetwork#39, which had no tests: - key:list / key:get never print private keys, report empty wallets, and document --reveal-private / --force / the reveal password - key:reveal-setup refuses to run without an interactive terminal; key:reveal-disable is a no-op on a fresh wallet - encryptor round-trips with a random IV and rejects the wrong key - reveal-password hashing uses a fresh salt, power-of-two scrypt N, and verifies only the exact password - the "I UNDERSTAND" confirmation phrase stays stable Command tests spawn bin/dev with a temp HOME, so they run from source and never touch the user's real wallet config. Claude-Session: https://claude.ai/code/session_01PsSVdfBGzbRD6i9BwVosdN
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds tests for the key-security features from #39 (
key:list,key:get,key:reveal-setup,key:reveal-disable, the encryptor, and reveal-password hashing), which had no coverage. Tests only, no source changes.This is the first of a few smaller PRs replacing #41.
test/commands/key.test.ts: spawnsbin/devwith a tempHOME, so tests run fromsrc(no build needed) and never read or write the real wallet config. Asserts that private keys are never printed, that empty wallets are handled, that the flags are documented in help, thatreveal-setuprefuses to run without a TTY, and thatreveal-disableis a no-op on a fresh wallet.test/encryptor.test.ts,test/reveal-password.test.ts: unit tests in the samenode:assertstyle asmsig-utils.test.ts.test/helpers/cli.ts: a small spawn runner plus the isolated-HOME helper.Testing
nyc mocha "test/**/*.test.ts"gives 98 passing: the existing 82 plus 16 new.@oclif/test@1relies onmodule.parent. That's a separate issue, and a follow-up PR handles it.posttestlint already fails repo-wide on master (~3,000 pre-existing errors), sonpm testexits non-zero both before and after this PR.