Complete assignment thoroughly: Target Worktree…
- User
Complete assignment thoroughly:
Target
Worktree
/Users/bnjoroge/preloop-gh-app-api-compat. Files:crates/preloop-runner-server/src/auth.rs,crates/preloop-runner-server/src/openapi.rs,crates/preloop-runner-server/src/dispatch_tests.rs. Do NOT edit other files.Change (five items, all verified open at head b4c00985)
- Duplicate /repos/ denial (P3) —
runner_surface_onlyin auth.rs (~line 350-385):DENIED_PREFIXESconst already contains"/repos/"(line ~352) AND there is a standalone|| path.starts_with("/repos/")branch (~line 378) with a comment about the dispatch API. Remove the standalone branch and its comment (the const already denies it; keep the const entry). Ensure the function still denies/repos/*(the const covers it). - OpenAPI missing 400 responses (P2) — openapi.rs: both dispatch operations (
workflow_dispatch_trigger~line 570-595 andrepository_dispatch_trigger~line 600-625) return 400 for malformed JSON (parse_object), but neither documents it. Add(status = 400, description = "Malformed JSON body", body = ApiErrorResponse)to BOTH responses lists, keeping the existing ordering (204, 400, 401, 403, 404, 409, 422 / 204, 400, 401, 403, 404, 422 for repo dispatch — match each operation's existing list; check the actual current response lists before editing and insert 400 after 204). - OpenAPI security scheme overstates permissions (P2) — the
github_dispatch_bearerscheme description (~line 213-222) says "Requiresactions: writeon the repository" — wrong for the two read endpoints (GET .../actions/workflows,GET .../actions/runs, which require only repository access) and wrong for repository_dispatch (requirescontents: write). Rewrite the description: dispatches require the endpoint's write permission (actions: writefor workflow dispatch,contents: writefor repository dispatch) on the repository; read endpoints require repository read access. Keep the credential list (installation token, own-App JWT, PAT, system token) intact. - PAT actor test not hermetic (P2) — dispatch_tests.rs ~line 655-670:
dispatch_with_pat_authenticatesholdsGITHUB_ENV_LOCKbut does not pinPRELOOP_GITHUB_API_URL; when the ambient environment sets it, the test resolves the PAT actor from that endpoint instead of exercising the unreachable-github.com fallback. Fix: replace the manual lock with the existing helper (see ~line 217 for its signature/return; other tests use — e.g. line 880). Keep the test's assertion ().
- Duplicate /repos/ denial (P3) —
Assistant
The summaries elided the key ranges. Let me locate the exact sections.
Assistant
Now reading the exact ranges for all five items.
Assistant
All five locations confirmed. Let me check the broadcast test name and comment style around the fixture consts.
Assistant
All context confirmed. The fixture consts use plain
//comments (no doc comments), so I'll match that style for the RD_BROKEN note. Now applying all edits — one patch per file.Assistant
All three patches applied. Verifying each edited region.
Assistant
All edits verified in place. One final coherence check: confirm no stray
/repos/references remain in auth.rs and the utoipa response ordering is exactly as specified.Assistant