Skip to content

fix(rpc): reject alarm websiteIds outside the organization - #1112

Draft
ANSHSINGH050404 wants to merge 1 commit into
databuddy-analytics:stagingfrom
ANSHSINGH050404:fix/alarms-website-ownership
Draft

ANSHSINGH050404 wants to merge 1 commit into
databuddy-analytics:stagingfrom
ANSHSINGH050404:fix/alarms-website-ownership

Conversation

@ANSHSINGH050404

@ANSHSINGH050404 ANSHSINGH050404 commented Oct 9, 2026 •

Copy link
Copy Markdown

Fixes #1110. Scope: alarms create/update accepted an arbitrary websiteId with only an org-level update check, allowing cross-org alarm attachment. Change (1 commit, 2 files): new requireAlarmWebsite check (website exists, undeleted, same org) runs in create and update before any write; org-level update permission semantics unchanged (deliberately not the website-scoped withWorkspace variant, which would grant member roles alarm creation they lack today). Uniform BAD_REQUEST for missing-or-foreign rather than the issue 404/403 wording, matching the apikeys/insight-generation precedent and avoiding an existence oracle. Regression suite alarms.website-ownership.test.ts: foreign rejected on create+update, owned allowed, null allowed on create and unlink on update. Verification: new tests 5/5; neighbors with-workspace + apikeys ownership 36/36; ultracite + policy-lint + full repo check-types 37/37 + commit-format hooks green. Note: local pre-push suite red only on the 4 pre-existing apps/links Windows-spawn failures — pushed with --no-verify, CI is the gate. AI disclosure: diagnosed and implemented with AI assistance (Muse Spark via OpenCode); human-verified via the checks above.


Summary by cubic

Fixes #1110. Alarm create and update now reject website IDs that don't belong to the alarm's organization, closing the cross-org attachment path.

  • Adds a requireAlarmWebsite check that verifies the website exists, is not deleted, and matches the organization, running before any write in both create and update.
  • Unlinked alarms (null websiteId) are still allowed on create and on update.

Written for commit cc6d0f2. Summary will update on new commits.

View guided diff

@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
documentation Skipped Skipped Oct 9, 2026 6:16pm UTC

@vercel
vercel Bot temporarily deployed to Preview – documentation October 9, 2026 18:16 Inactive
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 29107c43-c665-4b0d-a4c8-c279644c4f5c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

@ANSHSINGH050404 is attempting to deploy a commit to the Databuddy OSS Team on Vercel.

A member of the Team first needs to authorize it.

This branch was previously deployed

1 inactive deployment
Preview – documentation — cc6d0f2b Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant