Skip to content

Add tk init, tk whoami, and version flag#15

Draft
natefikru wants to merge 1 commit intonate/pr1-wallet-authfrom
nate/pr2-init-whoami
Draft

Add tk init, tk whoami, and version flag#15
natefikru wants to merge 1 commit intonate/pr1-wallet-authfrom
nate/pr2-init-whoami

Conversation

@natefikru
Copy link
Copy Markdown

Summary

  • tk init validates credentials, finds or creates an Ed25519 wallet account, and persists signing config atomically with 0600 permissions
  • API private key accepted only via TURNKEY_API_PRIVATE_KEY env var (no CLI flag) to prevent shell history exposure
  • tk whoami displays authenticated Turnkey identity, suggests tk init on config failure
  • tk --version flag
  • config set blocks turnkey.apiPrivateKey to prevent accidental secret exposure
  • Atomic config writes via tempfile::NamedTempFile + rename

Test plan

  • cargo test --all passes (pre-existing agent test failure excluded)
  • cargo build --all-targets clean
  • Init creates wallet when none exist (wiremock test)
  • Init uses existing Ed25519 wallet (wiremock test)
  • Whoami displays identity (wiremock test)
  • Whoami suggests init on missing config
  • Config set blocks apiPrivateKey

PR 2 of 3 (base: nate/pr1-wallet-auth)

tk init validates credentials, finds or creates an Ed25519 wallet
account, and persists the resolved signing config atomically with
0600 permissions. The API private key is accepted only via environment
variable to prevent shell history exposure.

tk whoami displays the authenticated Turnkey identity. On config
failure it suggests running tk init.

config set blocks turnkey.apiPrivateKey to prevent accidental secret
exposure through command line arguments.
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.

1 participant