Repository navigation
fix(rpc): reject alarm websiteIds outside the organization - #1112
izadoesdev merged 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@ANSHSINGH050404 is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
5dedc50 to
84d0749
Compare
88cd02a
into
databuddy-analytics:staging
Fixes #1110
Summary
Prevent alarms from being attached to websites belonging to another organization by validating website ownership before creating or updating an alarm.
Changes
requireAlarmWebsiteto validate that a website exists, is not deleted, and belongs to the same organization as the alarm.withWorkspacevariant, which would change authorization behavior by granting member roles the ability to create alarms they cannot currently create.BAD_REQUESTfor missing or foreign websites, following the existingapikeysand insight-generation precedents and avoiding a website-existence oracle.Regression Tests
Added
alarms.website-ownership.test.tscovering:nullwebsite IDs on creation.Verification
with-workspaceand API-key ownership tests: 36/36 passedEnvironment note: The local pre-push test suite still fails on four pre-existing
apps/linksshutdown tests involvingBun.spawn(process.execPath)and Windows paths containing spaces. The changes were pushed using--no-verify; CI remains the final verification gate.AI Disclosure
Diagnosed and implemented with AI assistance (Muse Spark via OpenCode). The changes were human-verified using the checks listed above.
Summary by cubic
Fixes #1110. Alarm create and update now reject website IDs outside the alarm's organization, closing the cross-org attachment path.
requireAlarmWebsitecheck, run before any write, that verifies the website belongs to the alarm's organization and is not deleted.NOT_FOUNDinstead ofBAD_REQUEST, avoiding a website-existence oracle.nullwebsiteIdallowed on create and update, so org-wide and unlinked alarms still work.Written for commit 84d0749. Summary will update on new commits.