Repository navigation
fix(kit): a content CLI from a config shows and checks its write keys; WordPress keeps passwords out - #205
Merged
Conversation
…; WordPress keeps passwords out Ports the review fixes of wordpress-cli 0.1.0 into what new --from-config writes: - src/config.ts of a content CLI with writes passes cli-core's content write keys, their ask levels and their extra checks, so --dry-run shows what a write checks (FIND-2820). The api group's create and update of the written route, found from SOURCE.writes, check posts.create and posts.update too, and the posts commands name the api key their write also checks (WC-PERM-22). - A wp-json CLI leaves out the application-passwords route, whose POST answers a new password in clear (SEC-202), and its plugin, settings, user, comment, template, widget, menu and navigation writes ask by default. - The content options test checks each write's result and the deny on the api path; the wp-json api test checks every option's value, a second page with --all, and the writes that ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- posts delete's preview names the api key of the written route's delete too: with posts.delete set to allow the run still asked through it. - The service name is passed in, not read back; the SAMPLE comment stays above API. - Tests: --dry-run of posts create and posts delete --allow-delete names each key it checks; every WordPress write that asks is tested, a permission that also needs a publish key included; the non-content WordPress config keeps its site-wide asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The two reviews of wordpress-cli 0.1.0 found gaps in what
new --from-configwrites, fixed by hand in that CLI. This moves the fixes into the kit, so the next content or WordPress CLI starts with them.What
contentsource withwrites,src/config.tspasses cli-core'sCONTENT_WRITE_KEYS,CONTENT_WRITE_DEFAULTSandcontentAlsoChecks. Before,posts create --dry-runsaidallowfor a write that asks, and--allow-deletedid not nameposts.delete.force.SOURCE.writes) also checkposts.createandposts.update, so a deny on apostscommand stops the raw write. Thepostscommands' preview names the api key their write also checks, delete included./wp/v2/users/{user_id}/application-passwordswhen the index has it: its POST answers a new password in clear, and the index marks no field secret.ask, with or without a content source. Only the routes the index has are named.--dry-runkeys, and thatposts.create: denystops the api write. The wp-json api test checks every option's value, a second page with--all, and every write that asks.changes/fragment.Pages are not mapped to
posts.*here, as the kit only knows the routesource.writesnames. wordpress-cli maps them by hand.Testing
kit/e2e.shWordPress case run locally: lint, generate, ci:quick, contracts:check, test:coverage, docs:check passed.pnpm vitest run kit/test/from-config.test.ts kit/test/new.test.ts: 73 passed.🤖 Generated with Claude Code