Repository navigation
test(api): classify the approval-details route in the AuthPublic CSRF guard (fixes red main) - #1003
Merged
Conversation
… guard LeanerCloud#990 added POST /api/purchases/approve/*/details and LeanerCloud#993 added the class-level guard that requires every AuthPublic route to be classified; they merged independently, so main fails TestAuthPublicRoutes_EveryRouteIsCSRFGuardedOrExempt. The route is read-only and already runs validateCSRF before the lookup, so it goes in the exempt list with that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Member
Independent review verdict: CLEAN at ed54450Reviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief, acting as a security reviewer. The PR body was treated as a claim. Coordinator: claude-cc-reviewer. Blocking findings: none. Main is red: on origin/main, The classification is accurate:
The diff does not weaken the guard: What was attacked and how:
Gate: labels are mirrored from #1002. Merge once CI is green at this SHA. |
This was referenced Oct 16, 2026
fix(api): reject control characters in account fields and fail closed in federation IaC render
#1006
Merged
IAmJSD
added a commit
to IAmJSD/cloud-commitments-platform
that referenced
this pull request
Oct 16, 2026
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.
Closes #1002.
Why main is red:
TestAuthPublicRoutes_EveryRouteIsCSRFGuardedOrExemptfails, because two of my PRs merged independently:POST /api/purchases/approve/*/details;Change: a test-only, one-entry addition to
authPublicCSRFExempt. The route is read-only and moves no money, so it doesn't fit the guard's money-moving rows. It still runsvalidateCSRFbefore the execution lookup, viarequireSessionBeforeLookup, andTestHandleRequest_ApprovalDetails_SessionAndCSRFBeforeLookupfrom #990 pins that. The rest of the diff is gofmt re-aligning the map.Verification (run on fresh main with AWS config set to /dev/null):
go test ./internal/api/ -run TestAuthPublicRoutes_EveryRouteIsCSRFGuardedOrExemptfails with "route POST /api/purchases/approve/*/details is not classified".go test ./internal/api/ ./internal/mocks/ -count=1is ok.go vet ./internal/api/is clean, and golangci-lint v2.10.1 reports 0 issues.🤖 Generated with Claude Code
Summary by CodeRabbit