Repository navigation
✨ meetings: email invites with an allowlist of proven calendar emails (Betty C2 part 4) - #18431
Conversation
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. hive/awaiting-ci: rebased onto v5 (conflicts in boot_inbox.go and api-reference docs resolved, citations re-fixed). CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 Review findings from Correctness review (head de34d7e) — one in-scope defect. Delivery-level
|
Mutation testing⏱️ The 900s mutation budget ran out, so 3 package(s) were not fully mutated and the results below do not cover them:
1 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
There was a problem hiding this comment.
Intent alignment (PR title + diff as contract; no linked issue): 1 in-scope gap.
Trust rule is evaluated once per delivery, not per invite. The PR body says an invite is scheduled at once only when From "is the invite's organizer". handleMeetingsInvites (src/pkg/dashboard/api_meetings_email.go, the trusted := false; for _, inv := range d.Invites {... break} loop) sets trusted = true as soon as ANY invite in the delivery has Organizer == From. IngestInvites then passes that single flag to every invite (eventFromInvite(inv, del, trusted) → Trusted: trusted, src/cmd/hive/meetings_email.go). An allowlisted sender can attach a second VEVENT whose organizer is someone else, or has no organizer, and it is scheduled immediately instead of awaiting_approval. That bypasses the owner approval the PR promises for everything that isn't allowlisted-organizer mail. The tests listed in the body cover only single-invite deliveries.
Suggested fix, in eventFromInvite:
Source: schedule.SourceEmail, InvitedBy: d.Auth.From,
Trusted: trusted && inv.Organizer != nil && strings.EqualFold(inv.Organizer.Email, d.Auth.From),
(add strings is already imported in that file). Add a test with a two-invite delivery where only the first is organized by From; the second must come back awaiting_approval.
Everything else matches the body: existing-meeting changes and CANCELs are gated on the stored organizer, config flags and routes are present, and the docs and openapi additions are in scope. Reviewed head de34d7e.
— hive: agent=adjudicator-3 backend=claude model=claude-sonnet-5-5 claude=2.1.325
|
hive/scanner: merge conflict with v5 (DIRTY) and the baseline check says the branch is 5 commits behind v5 (MERGE_BASE). Failing: testutil-guard, dashboard/rest test shards, coverage. Please merge v5 and re-check before diagnosing the test failures; not pushing to a non-hive branch. 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
de34d7e to
b5a0474
Compare
There was a problem hiding this comment.
Decision needed: @clubanderson should a trusted delivery auto-schedule only the invites whose own organizer equals the authenticated From, or is whole-delivery trust intended?
The email-invite trust rule is decided once per delivery but applied to every invite in it. The PR body says an invite is auto-scheduled only when From is the invite's organizer, and the code does not enforce that per invite.
src/pkg/dashboard/api_meetings_email.go(handleMeetingsInvites): the loop setstrusted = s.mailTrusted(d.Auth)andbreaks as soon as one invite hasOrganizer.Email == d.Auth.From.src/cmd/hive/meetings_email.go(IngestInvites→eventFromInvite): that single boolean is stamped asTrusted: trustedon every invite in the delivery, andAllowlistApprover.NeedsApprovalthen returns false for each.- Consequence: an allowlisted, DMARC-aligned user who sends one invite they organize plus a second with a different or missing organizer gets the second scheduled at once, with its join link, platform and passcode, and no owner approval.
TestEventFromInviteWithoutOrganizerassertsTrustedstays true for an invite with no organizer, so the test pins this behaviour rather than catching it. - The existing-meeting path is stricter and looks right: changes apply only when
del.Auth.Alignedand the stored organizer equalsFrom.
The likely fix is a per-invite check in eventFromInvite or IngestInvites, so Trusted = trusted && inv.Organizer != nil && EqualFold(inv.Organizer.Email, From), with a mixed-organizer delivery test. This touches auth and an outbound-join side effect, so I'm routing it to a human instead of calling it a defect.
Not verified: I read the dashboard handler, the ingest adapter and AllowlistApprover. I did not read mailallow.go in depth (code expiry, per-user limits), so I have no claim about it either way.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325
|
scanner: CI triage — baseline check says this is PR-local (not a shared incident). 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
hive/scanner: CI failure is PR-local (baseline check: FIX_DIFF). 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
scanner: CI failure is PR-local (baseline check: isolated, FIX_DIFF). 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
hive/scanner triage: the baseline check says this is PR-local ( Suggested fix: add the two keys to the Settings dialog, or to that test's allowlist if they are deliberately env/config-only. 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
… (Betty C2, part 4) POST /api/meetings/invites takes hive-mx invites the hub relayed and signed (verifyRelayedRequest) and ingests them into the Calendar: an invite whose From address passed DMARC alignment, is its organizer and is a proven calendar email of a user on the live access list is scheduled at once (schedule.AllowlistApprover, Event.Trusted); everything else awaits approval and attendees never approve. A change or CANCEL for a meeting already on the calendar applies only when authenticated as its organizer. New pkg/mailallow: per-user calendar emails with proof codes in connector-state/email/allowlist.json. GET/POST/DELETE /api/meetings/calendar-emails lists, adds (with the instruction to mail the code to hive@<host>) and removes them; POST /api/meetings/calendar-emails/proof proves an address from a relayed proof mail when it is DMARC aligned for that exact address. Removing a user's access revokes their addresses. meetings.email.invites_enabled and files_enabled (HIVE_MEETINGS_EMAIL_*), openapi.json, api-reference, meetings.md and env-vars.md. Part of #18391, #18395. Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
7e2f859 to
e598128
Compare
|
New changes are detected. LGTM label has been removed. |
…s in the next PR Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 7fc5034. |
Part 4 of #18395 (Betty C2, email in; plan #18391 "Allowlist" and "Spoke schedule"). Uses #18423 (wire contract), #18429 (hub relay and
verifyRelayedRequest) and #18399 (schedule.Ingest).Invites
POST /api/meetings/invites(relay-signed, inisPublicPath, fails closed without the relay key) ingests the invites of a hive-mx delivery into the Calendar with platform, join link, native meeting id and passcode.Frompassed DMARC alignment,Fromis the invite's organizer, andFromis a proven calendar email of a user on the livedashboard.authorized_users(owner, read-write or read). Everything else isawaiting_approval; attendees never approve. Newschedule.AllowlistApprover(wired in cmd/hive) reads a per-delivery, never-storedEvent.Trusted.409when invites (meetings.email.invites_enabled) or meetings are off, so the sender gets a bounce;422when nothing in the delivery is schedulable.Calendar emails (new
pkg/mailallow)connector-state/email/allowlist.json(0600), at most 10 per user, each with a 24-hour proof code (hive-proof-+ 12 base32).GET/POST/DELETE /api/meetings/calendar-emailsfor the signed-in user (identity fromX-Hive-User, any role); add returns the code and the instruction "Send an email from that address to hive@ within the subject";?all=1gives the owner the whole allowlist (no codes); the owner may remove anyone's address.POST /api/meetings/calendar-emails/proof(relay-signed) proves the address whose code is in the subject only when the mail came from it with DMARC alignment; failures are recorded on the address and answered422(the sender's server bounces it).Config, docs
meetings.email.invites_enabledandmeetings.email.files_enabled(default on;HIVE_MEETINGS_EMAIL_*),dashboard_import_allowlist.txt(mailallow, mailin/wire), openapi.json, api-reference (citations fixed withcheck-docs-citations.py --fix), meetings.md ("Who can invite Betty", "Proving calendar emails"), env-vars.md.Tests: mailallow store (add/prove/revoke/expiry/limits/persistence), the relay endpoints (signature, delivery id binding, replay, size, kind), the trust decision table, proof outcomes, the calendar-emails API by role, and the cmd/hive ingest adapter against a real scheduler (trusted vs awaiting, stale SEQUENCE, forged update/cancel/override ignored, organizer cancel applied, invalid invites).
🤖 Generated with Claude Code