Skip to content

fix(tk): harden private key output and add address format coverage guard#22

Open
figitaki wants to merge 4 commits intonatefikru/eng-3860-consensus-demo-rustfrom
monad/pr19-zeke-amendments
Open

fix(tk): harden private key output and add address format coverage guard#22
figitaki wants to merge 4 commits intonatefikru/eng-3860-consensus-demo-rustfrom
monad/pr19-zeke-amendments

Conversation

@figitaki
Copy link
Copy Markdown

@figitaki figitaki commented Apr 7, 2026

Summary

  • stop emitting generated API private keys to stdout by default
  • add explicit opt-in private key file output
  • add address-format coverage guards so CLI/SDK drift gets caught

What changed

  • remove apiPrivateKey from normal JSON output
  • add --api-key-private-key-out <path> for explicit file export of auto-generated key material
  • create exported private key files with restrictive permissions on Unix (0600)
  • add address-format coverage/roundtrip tests in tk/src/commands/keys.rs

Validation

  • rustup run stable cargo test -p tk
  • rustup run stable cargo clippy -p tk --all-targets -- -D warnings (hits a pre-existing unrelated lint in auth/src/ssh/agent.rs)

natefikru and others added 4 commits April 1, 2026 00:03
Expose client() and organization_id() on TurnkeySigner. Add keys
create/delete, users create/delete, and policies create/delete
subcommands that call the Turnkey API via the Rust SDK. All commands
output JSON for script consumption. Move turnkey_client, serde_json,
hex, and turnkey_api_key_stamper to regular dependencies.
Delete main.rs. Add setup.sh and teardown.sh that use the new tk keys,
users, and policies commands. The entire demo now runs through shell
scripts and the tk CLI. Update README to document the new flow.
- keys delete: default delete_without_export to false (safe by default)
- policies create: reject allow policies with no condition or consensus
- setup.sh: write state.json incrementally, exclude private key from
  state, set umask 077 for agent.env, add ERR trap for partial cleanup
- teardown.sh: handle missing state.json and missing fields gracefully,
  pass --delete-without-export explicitly for key deletion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants