Repository navigation
fix(api): sharing a calendar mails nobody unless sharing.notify allows it - #16
Merged
Merged
Conversation
…s it Google's acl.insert/patch/update take sendNotifications, which defaults to true, so `api calendar-acl-insert` (and `api call calendar.acl.*`) mailed the person a calendar was shared with. Since NEED-1857 these methods run at `ask` over MCP, so an agent could share the owner's calendar and mail a stranger. The owner's rule (WC-PERM-22): anything that mails other people is its own permission key, default deny, checked on every path. New key `sharing.notify` (deny). An acl insert/patch/update whose sendNotifications is absent or true needs it; at deny/readonly the call is refused before any request, with a hint to pass --send-notifications false or allow the key. The request is never rewritten. acl.delete mails nobody (Google: "no notifications on access removal") and is unaffected. --dry-run lists the key with its level; at ask one question names both keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
Raised in #14 ("Not in this PR"): sharing a calendar through
gcal apimails the person it is shared with.Why
acl.insert,acl.patchandacl.updatetakesendNotifications, and the Discovery snapshot (spec/google/calendar.json) says "Optional. The default is True." (Acl: insert).ask, which runs without a question. So an agent could share the owner's calendar and mail a stranger.deny, checked on every path. gcal already does this for attendees withevents.notify.What
sharing.notify, defaultdeny(src/config.ts,src/api-keys.ts).events.notify: a domain plus.notify, not tied to one path.sharingis the word--grant sharingalready uses.api.calendar.acl.notify:api.<method>keys mirror Google's methods one to one, and there is nocalendar.acl.notifymethod.api calendar-acl-insert | patch | updateandapi call calendar.acl.{insert,patch,update}need it whensendNotificationsis absent or true. Atdenyorreadonlythe call is refused before any request. The refusal names the key and its level and says to pass--send-notifications false(send_notifications: "false"over MCP,"sendNotifications": falseinapi call --params) or allow the key.acl.deleteis not affected: Google says "there are no notifications on access removal".--dry-runlistssharing.notifywith its level. Atdenythe preview refuses, as it does forevents.notify. Ataskone question names both keys.configuration.md,security.md(an agent can still share without mail, using--send-notifications false), the skill, CHANGELOG.test-matrix.mdregenerated.Testing
src/api.test.ts, over the CLI and MCP:true, patch, update,api callinsert with no param,api callpatch with"true"falsegoes through, and Google getssendNotifications=falseask; atallowthe request is sent unchanged"false"--send-notifications false.ci:quick,lint,test:coverage(262 tests),generate:check,contracts:check,test:matrix:check,docs:check,package:check,standards:check,security:no-leak.🤖 Generated with Claude Code