fix: disable API v1 write methods (closes #112) #115
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
notplanned
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#115
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/disable-api-write-methods"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Remove API v1 write methods (POST /apps, DELETE /apps/{id}, POST /apps/{id}/deploy) that used cookie-based session auth without CSRF protection.
Read-only endpoints, login, and whoami are retained.
Closes #112
make check output
Remove POST /apps, DELETE /apps/{id}, and POST /apps/{id}/deploy from the API v1 route group. These endpoints used cookie-based session auth without CSRF protection, creating a CSRF vulnerability. Read-only endpoints (GET /apps, GET /apps/{id}, GET /apps/{id}/deployments), login, and whoami are retained. Removed handlers: HandleAPICreateApp, HandleAPIDeleteApp, HandleAPITriggerDeploy, along with apiCreateRequest struct and validateCreateRequest function. Updated tests to use service layer directly for app creation in remaining read-only endpoint tests.Code Review: PR #115 — Disable API v1 Write Methods
Result: ✅ LGTM — Ready for merge
Checklist
POST /apps,DELETE /apps/{id},POST /apps/{id}/deployHandleAPICreateApp,HandleAPIDeleteApp,HandleAPITriggerDeploy,validateCreateRequest,apiCreateRequestinternal/server/routes.gocontext,appservice in api.go)apiRequesthelper narrowed toapiGet— clean simplificationmake checkpasses cleanly (all tests pass, build succeeds, lint clean)Clean, focused removal of CSRF-vulnerable write endpoints. No regressions.