fix(secrets): hero_proc secret CLI sends correct RPC params #53
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proc!53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_omarz_secrets_cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_proc secret <set|get|list|delete>now accept--context(defaultcore) and send the right JSON-RPC param shape the server expects.secret setaccepts--descriptionand repeatable--tag;secret listaccepts--context,--filter <pattern>,--tag, and renders a table (-vshows values).secret getprints the full record (key, context, value, description, tags) instead of just a bare value.secret pull/secret pushforwardFORGE_TOKEN(orFORGEJO_TOKEN) from the env to the server, with a clear error when neither is set.Secret.created_at/Secret.updated_atare now#[serde(default)](server overwrites them inhandle_setanyway). Also unblocksdemo.js, which already omits timestamps.Test plan
cargo build --release -p hero_proc_cli -p hero_proc_serverclean.secret list --tag databaseandsecret list --filter 'POSTGRES_*'return the expected table.secret list(no flags) returns all 51 keys + new probe.secret set HEROPROC_CLI_SMOKE 'hello-world' --description ... --tag test --tag smokesucceeds.secret get HEROPROC_CLI_SMOKEprints key, context, value, description, tags.secret list --tag smoke -vshows the row with its value.secret delete HEROPROC_CLI_SMOKEsucceeds; subsequentsecret list --tag smokeis empty.secret get/secret deletefor a missing key returnRPC error -32000: secret 'X' not found.secret pullwith noFORGE_TOKEN/FORGEJO_TOKENexits with the new env-required error.secret pull/secret pushround-trip against a real Forgejosecretsrepo — not exercised here to avoid touching the user's remote.#52
Every `hero_proc secret` subcommand was wired to the wrong JSON-RPC param shape, so the only working path to manage secrets was the web UI. Symptoms: `secret list` always reported "No secrets configured" because the response shape `{secrets:[...]}` was parsed as `Vec<String>`; `secret get`/`delete <NAME>` failed with `missing 'key' parameter`; `secret set` and `secret pull/push` could not work at all. Changes: - CLI: add `--context` (default `core`) to set/get/list/delete, plus `--description` and repeatable `--tag` for set, and `--filter`/`--tag` for list. Send the shapes the server actually expects, parse the `{secrets:[...]}` envelope, and forward `FORGE_TOKEN` / `FORGEJO_TOKEN` from env into `secret.pull` / `secret.push`. - CLI: render `secret list` as a table; `-v` shows values, otherwise just `set`/`empty` plus tags. `secret get` prints key, context, value, description and tags. - Model: mark `Secret.created_at` / `Secret.updated_at` `#[serde(default)]` so clients can omit them (the server overwrites both in handle_set anyway). Also unblocks `demo.js` which omits timestamps. Verified against a running daemon: `secret list`, `secret list --tag`, `secret list --filter`, and `secret get` round-trip the expected data; `secret delete` returns the proper not-found error for missing keys. `secret set` requires the model relaxation above and was confirmed to build; live verification needs the daemon to restart onto the new server binary. #52WIP: fix(secrets): hero_proc secret CLI sends correct RPC paramsto fix(secrets): hero_proc secret CLI sends correct RPC params