Add secrets list and rm to the CLI - #38
dantheuber wants to merge 5 commits into
Conversation
Complete the write-only `millwright secrets` group with `list` and `rm`,
following the shape of `repo list` / `repo remove`.
- `secrets list [--scope <scope>] [--all-scopes]` prints secret names only,
sorted; values are never fetched or printed (the listing never asks SSM to
decrypt and ignores the returned ciphertext). `--all-scopes` walks the whole
`secrets/` prefix and prints `<scope> <name>` lines, and does not need an
origin remote.
- `secrets rm <name> [--scope <scope>]` deletes one parameter, reports the
path removed, and throws a CommandError (exit 1) when nothing was deleted.
- Both pre-check the name with `isSecretNameSegment` before discovery and
default the scope from the cwd `origin` remote exactly like `secrets set`;
the shared pre-check and scope resolution are factored into helpers in
secrets.ts. `set` keeps its `promptSecret` dep; list/rm take the narrower
`SecretsScopeDeps`.
- New `secretFromParameterName` inverse in millwright-state ssm-paths.ts so
`list` inverts parameter names the same way `repo list` does; a recursive
listing of `secrets/acme/` is filtered to the exact scope so `acme/api`
secrets do not leak into a listing of scope `acme`.
- Docs: README secrets section, the "Secrets not resolving" step 1 in
docs/operations.md now answers "is it written?" with `secrets list`, and
the CLI surface note in okf-bundle/interfaces/cli.md.
Files: packages/millwright-cli/src/{secrets,cli,index}.ts,
packages/millwright-state/src/{ssm-paths,index}.ts, tests in
packages/millwright-cli/test/{secrets,cli}.test.ts and
packages/millwright-state/test/ssm-paths.test.ts.
cb-jeeves
left a comment
There was a problem hiding this comment.
Adds secrets list and secrets rm on top of the existing secrets set, with a secretFromParameterName inverse in millwright-state to turn parameter names back into scope + name. The shape matches repo list / repo remove, the listing never asks SSM to decrypt, and rm fails with a useful message when nothing was deleted. This is close to mergeable; three suggestions below, none blocking.
The submit pass ran on claude-opus-5 after its primary model failed.
The correctness pass ran on claude-opus-5 after its primary model failed; maintainability pass ran on claude-opus-5 after its primary model failed; ux-dx pass ran on claude-opus-5 after its primary model failed.
…tering - secrets list: --all-scopes now conflicts with --scope instead of silently dropping it, so a stale --scope cannot widen the listing by accident - alias SecretsListEntry to SecretParameterParts so the row type tracks the inverse in millwright-state - add tests for the nested-scope case the scope filter exists for, and for the option conflict
|
Responded to review round 1, pushed 64b35f9:
|
cb-jeeves
left a comment
There was a problem hiding this comment.
All three findings from round 1 are addressed in 64b35f9: --all-scopes now conflicts with --scope, the nested-scope filter has tests on both sides, and SecretsListEntry aliases SecretParameterParts.
The submit pass ran on claude-opus-5 after its primary model failed.
The correctness pass ran on claude-opus-5 after its primary model failed; maintainability pass ran on claude-opus-5 after its primary model failed; ux-dx pass ran on claude-opus-5 after its primary model failed.
This branch assembles the listed issues for review.
Issues in this consist
secrets listandsecrets rmto the CLI #37 Addsecrets listandsecrets rmto the CLICloses #37
What & why
Completes the write-only
millwright secretscommand group by addinglistandrm, mirroring the existingrepo list/repo removeshape. Operators can now enumerate stored secret names and delete individual parameters from the CLI instead of going through SSM directly.Changes
secrets list [--scope <scope>] [--all-scopes]— prints secret names only (sorted); values are never fetched or decrypted.--all-scopeswalks the wholesecrets/prefix, printing<scope> <name>lines, and doesn't require an origin remote.secrets rm <name> [--scope <scope>]— deletes one parameter, reports the removed path, and exits 1 viaCommandErrorwhen nothing was deleted.isSecretNameSegment) and scope resolution (defaulting from the cwdoriginremote, same assecrets set) factored into helpers insecrets.ts;setkeeps itspromptSecretdependency whilelist/rmuse the narrowerSecretsScopeDeps.secretFromParameterNameinverse inmillwright-state'sssm-paths.ts, used bylistto invert parameter names the same wayrepo listdoes. Recursive listing undersecrets/acme/is filtered to the exact scope soacme/apisecrets don't leak into a listing of scopeacme.docs/operations.md, and the CLI surface note inokf-bundle/interfaces/cli.md.Review notes
--all-scopesprefix walk and the scope-filtering logic insecretFromParameterNameagainst nested scope names.