fix(api): allow sessions to reach focus-manifest refresh - #601
Conversation
isRepoFocusManifestPath was anchored at /focus-manifest, so the POST /focus-manifest/refresh route added in JSONbored#523 was not covered by canSessionAccessPath -- a session-authenticated owner/maintainer was 403'd by the blanket guard before reaching the handler that would have allowed them. Match the optional /refresh sub-path so the route handler's own requireAppRole + requireSessionRepoAccess gate it.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
reviewbot · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Closes #600.
#523 added
POST /v1/repos/:owner/:repo/focus-manifest/refresh, butisRepoFocusManifestPath(used bycanSessionAccessPath) was anchored at…/focus-manifest$, so it did not match the/refreshsub-path. SincerequiresApiTokentreats the refresh path as protected, the blanket*middleware rejected a session-authenticated owner/maintainer with 403insufficient_rolebefore the route handler ran — even though the handler'srequireAppRole+requireSessionRepoAccesswould have allowed them. GET/PUT worked for sessions; only the new refresh route was unreachable.Change
/refreshsub-path:…/focus-manifest(?:/refresh)?$, so the route handler (not the blanket middleware) gates the refresh route.POSTing…/focus-manifest/refreshgets200, while a cross-repo owner session still gets403 forbidden_repofromrequireSessionRepoAccess.Verification
routes-focus-manifest.test.ts12/12 (the new same-repo case fails on the old code withinsufficient_role);tsc --noEmitclean; related auth/route suites green.Same access-path-matcher class as #513 / #508; a new gap specific to the #523 sub-path.