-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Problem
-
The init wizard requests API keys (step 1) before the vault backend is selected (step 4). Keys are collected but never persisted — config is written with
Nonevalues for all secrets. -
After init, the wizard prints instructions referencing
zeph vault set <KEY> <VALUE>(init.rs:447), but this subcommand does not exist. Users withagebackend have no way to populate the vault without manually creating age-encrypted JSON files. -
When
envbackend is selected, collecting keys during init is pointless — they should come from environment variables at runtime. Whenagebackend is selected, keys should be stored viavault setafter init.
Plan
Phase 1: Fix init wizard key collection flow
- Move vault backend selection to step 1 (before provider selection)
- If
envbackend: skip API key prompts entirely, only show env var instructions at the end - If
agebackend: skip API key prompts during init, instruct user to runzeph vault setafter init completes - Remove dead code collecting keys into
WizardStatethat are never persisted
Phase 2: Implement vault CLI subcommands
Add Vault variant to Command enum in main.rs with subcommands:
zeph vault set <KEY> <VALUE> — encrypt and store a secret
zeph vault get <KEY> — decrypt and print a secret
zeph vault list — list stored secret keys (no values)
zeph vault rm <KEY> — remove a secret from vault
zeph vault init — generate age keypair and empty vault file
Implementation:
- Extend
AgeVaultProviderwith write operations (decrypt → modify HashMap → re-encrypt → write) vault initgenerates x25519 keypair viaagecrate, writes identity file and empty encrypted vaultvault set/rmrequire--vault-keyand--vault-pathflags (or env/config equivalents)vault listprints keys only, never values- All write operations use atomic file replacement (write to temp + rename)
Phase 3: Wire init wizard to vault set
- After writing config.toml, if
agebackend was selected andvault inithas not been run, offer to run it automatically - Then prompt user to store collected secrets via
vault setcalls
Files to modify
src/main.rs— addVaultsubcommand toCommandenumsrc/init.rs— reorder steps, remove premature key collectioncrates/zeph-core/src/vault.rs— add write/init operations toAgeVaultProvider
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels