refactor(server): rename CSRFGuardHandlerPlugin to SimpleCsrfProtectionHandlerPlugin - #1780
Conversation
…onHandlerPlugin The old name overpromised: the plugin only blocks HTML-initiated requests (navigations, forms, embeds) via Sec-Fetch-Mode, which is a first line of defense rather than complete CSRF protection. "Simple" makes the partial scope explicit.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/nest
@orpc/next
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Important
The old name was already published, so the "never released" justification for dropping it without a deprecated alias is inaccurate — please confirm a hard-breaking rename is intended.
Reviewed changes — This run reviewed the full diff of 7 files: a rename of the server plugin CSRFGuardHandlerPlugin → SimpleCsrfProtectionHandlerPlugin, its internal name ~csrf-guard → ~simple-csrf-protection, the source/test file renames under packages/server/src/plugins/, and the docs page move to /docs/plugins/simple-csrf-protection with warning copy + sidebar and RPC handler reference updates.
- Rename the plugin class, internal plugin name, and export in
packages/server/src/plugins/ - Rename source/test files and update the plugin export + export test
- Move the docs page and update all references, link, and JSDoc
@see
⚠️ Deprecated-alias decision rests on a wrong premise
The PR body says no deprecated alias is kept "since the old name was never released." Git history contradicts that: csrf-guard.ts was added in #1763 (db548c81) and the export was live in the tree when chore: release v2.0.0-beta.24 (5965f879) was cut on 2026-08-03 — so CSRFGuardHandlerPlugin was shipped in the published @orpc/server@2.0.0-beta.24. Removing the export outright (rather than keeping a deprecated alias) will hard-break any downstream consumer on that beta who imported it.
Since this is a pre-release 2.0.0-beta line, a hard break may well be acceptable — but the stated reason is factually wrong, and the surviving consequence (a compile/import break for beta consumers on upgrade) should be a conscious choice rather than an accidental one. Recommend either keeping a lightweight deprecated alias, or explicitly acknowledging in the PR body that 2.0.0-beta.24 consumers will break and that this is intended.
The mechanical rename itself is complete and clean: grep finds no remaining CSRFGuard / csrf-guard references anywhere in the tree, and all five simple-csrf references are consistent.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Renames
CSRFGuardHandlerPlugintoSimpleCsrfProtectionHandlerPlugin. The old name overpromised: the plugin only blocks HTML-initiated requests (navigations, form submissions, embeds) viaSec-Fetch-Mode, a first line of defense rather than complete CSRF protection. "Simple" makes that partial scope explicit.Changes
~simple-csrf-protection), and source/test filenames renamed; no deprecated alias since the old name was never released./docs/plugins/simple-csrf-protection; intro now says "first line of defense" instead of claiming full protection. Sidebar and RPC handler doc references updated.Testing
pnpm type:checkclean; no references to the old name remain.