feat: add create-wiki-page safe output#61
Conversation
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Looks good overall — solid security posture with a couple of correctness/testing concerns worth addressing. Findings🐛 Bugs / Logic Issues
|
|
@copilot 🐛 Bugs / Logic Issues src/tools/create_wiki_page.rs:29-50 — path = "/" passes validation |
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Addressed all three points in ecd27a0: Bug (TOCTOU / upsert): The PUT now sends Guard tests: Added clarifying doc-comments to Bare-slash path: Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds
create-wiki-pageas a new safe output tool, complementingedit-wiki-page. Creation fails if the page already exists (directing the agent to useedit-wiki-pageinstead), whileedit-wiki-pagefails if the page doesn't exist.Changes
src/tools/create_wiki_page.rs— New tool implementation mirroringedit-wiki-page:wiki-name,wiki-project,path-prefix,title-prefix,commentIf-Match: ""for atomic create-only semantics (412 from the API is surfaced as a clean conflict failure, closing the TOCTOU race)/and slash-only paths in addition to the standard checks (empty, null bytes,..)"Created by agent"src/compile/common.rs— Addedcreate-wiki-pagetoWRITE_REQUIRING_SAFE_OUTPUTS; compilation fails withoutpermissions.writesrc/execute.rs— Dispatch case forcreate-wiki-pagesrc/mcp.rs— Exposescreate-wiki-pageas an MCP tool with identical sanitization pipeline toedit-wiki-pageExample front matter
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.