Repository navigation
Stop sendNotification being callable from the browser - #561
Merged
doomlab merged 1 commit intoOct 9, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 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.
Stage 3 (and last of the planned set) of closing the server-side access gap found while tracing #539. Stacked on #560 (which is on #559, on #558); retarget as each merges.
Problem
sendNotificationwas a Blitz mutation, so any signed-in user could call it directly and create a notification, with an official-looking message, for any user ids they chose, in any project. (Nothing in the browser called it. Only eight server-side mutations did.)Fix
Rather than adding checks to an endpoint that has no legitimate browser caller, it stops being an endpoint: the code moves, unchanged, to
src/notifications/utils/sendNotification.tsas a plain function, and the eight mutations that use it (task, comment, team, invite, project, approval) import it from there. The old file inmutations/is deleted. Their calls are unchanged (the function still accepts the context argument they pass). The input is still validated against the template schema.Testing
sendNotification.test.ts(5): creates the notification with the right recipients/project/route from STAPLE, validates the template data, rejects unknown templates and malformed input without writing.mutationsfolder is callable by any signed-in user). I checked it fails if the old file is put back.getJsonSchema.test.tserrors), lint and the whole suite (274 tests) pass.Still open from this audit
🤖 Generated with Claude Code