Skip to content

Harden JSON request decoding in Cloud plugin API handlers#179

Merged
nickmisasi merged 1 commit into
masterfrom
fix-null
Jul 24, 2026
Merged

Harden JSON request decoding in Cloud plugin API handlers#179
nickmisasi merged 1 commit into
masterfrom
fix-null

Conversation

@nickmisasi

Copy link
Copy Markdown
Contributor

Summary

Tighten JSON request body handling for Cloud plugin API endpoints so invalid request bodies are rejected with a client error instead of disrupting the plugin process. Adds regression coverage for the affected handlers.

Ticket Link

N/A (internally reported)

Release Note

NONE

Made with Cursor

Decode into value structs so malformed request bodies are rejected cleanly instead of crashing the plugin process.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mm-cloud-bot mm-cloud-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 691408cb-14c6-4ce6-992a-7de658493d76

📥 Commits

Reviewing files that changed from the base of the PR and between 6205b58 and b1c76d4.

📒 Files selected for processing (2)
  • server/api.go
  • server/api_test.go

📝 Walkthrough

Walkthrough

Three API handlers now decode JSON into concrete request structs. A table-driven regression test verifies that null request bodies produce 400 Bad Request responses without causing panics.

Changes

JSON request decoding

Layer / File(s) Summary
Concrete request decoding and regression coverage
server/api.go, server/api_test.go
The user-install, deletion-lock, and deletion-unlock handlers decode into struct values, while a table-driven test validates safe handling of null JSON bodies and the expected 400 Bad Request response.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: hardening JSON request decoding in Cloud plugin API handlers.
Description check ✅ Passed The description matches the changeset by describing stricter request handling and regression coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-null

Comment @coderabbitai help to get the list of available commands.

@nickmisasi nickmisasi self-assigned this Jul 23, 2026
@nickmisasi nickmisasi added the 3: Security Review Review requested from Security Team label Jul 23, 2026
@nickmisasi
nickmisasi enabled auto-merge (squash) July 24, 2026 02:55
@nickmisasi
nickmisasi merged commit 46ec969 into master Jul 24, 2026
8 checks passed
@nickmisasi
nickmisasi deleted the fix-null branch July 24, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3: Security Review Review requested from Security Team release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants