Skip to content

Add secret helper for external key management#33

Closed
pelle wants to merge 10 commits intomainfrom
feat/credential-helper
Closed

Add secret helper for external key management#33
pelle wants to merge 10 commits intomainfrom
feat/credential-helper

Conversation

@pelle
Copy link
Copy Markdown
Contributor

@pelle pelle commented Feb 22, 2026

Summary

  • Add get_private_key(did) to AgentKeyManager and KeyManager trait for extracting raw private key bytes from both generated keys and stored JWK secrets
  • Add secret_helper module (tap-agent) with a git-like pattern for retrieving private keys from external secret stores (HashiCorp Vault, AWS KMS, 1Password, etc.)
  • Add from_secret_helper() factory on TapAgent for creating agents from external key sources
  • Add --secret-helper / TAP_SECRET_HELPER CLI flag to tap-cli, tap-http, and tap-mcp
  • Simplify WASM export_private_key() to use the new get_private_key() method

Secret Helper Protocol

The secret helper is invoked as <command> [args...] <did> and outputs JSON to stdout:

{"private_key": "abcdef...", "key_type": "Ed25519", "encoding": "hex"}

Supports hex and base64 encodings, and Ed25519, P256, Secp256k1 key types.

Test plan

  • get_private_key() tests: generated keys, storage-loaded keys, P256, Secp256k1, unknown DID, roundtrip
  • Secret helper tests: config parsing, output deserialization (hex/base64), mock script integration, roundtrip, error cases (command not found, non-zero exit, invalid JSON), DID discovery
  • cargo fmt --all --check
  • RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets --release
  • RUSTFLAGS="-D warnings" cargo test --workspace --lib --tests --release
  • cd tap-ts && npm ci && npm test (134/134 pass)

🤖 Generated with Claude Code

pelle and others added 7 commits February 22, 2026 13:40
Update workspace version and all inter-crate dependency versions from
0.5.0 to 0.6.0. Add clear installation instructions (crates.io, from
source, verify) to all CLI tool READMEs and `cargo add` sections to
library crate READMEs. Reorganize root README Getting Started with
explicit install paths and add tap-mcp to CLI tools listing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a git-like secret helper pattern that allows TAP agents to retrieve
private keys from external secret stores (HashiCorp Vault, AWS KMS, 1Password).

- Add get_private_key(did) to AgentKeyManager and KeyManager trait
- Add secret_helper module with SecretHelperConfig and discover_agent_dids
- Add from_secret_helper() factory on TapAgent
- Add --secret-helper / TAP_SECRET_HELPER flag to tap-cli, tap-http, tap-mcp
- Simplify WASM export_private_key() to use new get_private_key()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pelle pelle changed the base branch from release/0.6.0 to main February 22, 2026 14:55
pelle and others added 3 commits February 22, 2026 15:55
Drop file handles and call sync_all() before executing scripts
to prevent "Text file busy" errors on macOS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pelle pelle closed this Feb 23, 2026
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