Problem
The Outlook HTTP adapter currently hardcodes Microsoft Graph URLs below /me/calendars/{calendarID} for all operations:
- list/calendar view
- create
- update
- delete
This prevents using CalendarSync with a shared or delegated Microsoft 365 mailbox when the OAuth principal is a delegate and the calendar belongs to another mailbox. Shared mailboxes commonly have no interactive sign-in of their own.
Reproduction
- Grant user A access to the calendar of mailbox B.
- Authenticate the
outlook_http adapter as user A.
- Configure the calendar ID from mailbox B.
- Run CalendarSync for a timeframe that contains events in B.
Observed in a real deployment:
- CalendarSync requested
/me/calendars/{B-calendar-id}/CalendarView.
- The source adapter reported zero loaded events and the run completed successfully.
- A direct Graph request using the same delegated principal and timeframe against
/users/{B-UPN}/calendars/{B-calendar-id}/calendarView returned the expected events.
No tokens, calendar IDs, or mailbox identities are included here.
Expected behavior
Allow an Outlook adapter to optionally address an explicit mailbox/user while preserving /me as the default for existing configurations.
For example:
source:
adapter:
type: "outlook_http"
calendar: "[calendar-id]"
config:
user: "shared-mailbox@example.com"
oAuth:
clientId: "[client-id]"
tenantId: "[tenant-id]"
Suggested URL behavior:
- no
config.user: /me/calendars/{calendarID}/...
config.user set: /users/{url-escaped-user}/calendars/{calendarID}/...
The value could accept either a user principal name or an Entra object ID.
Implementation scope
A small backward-compatible change should be sufficient:
- Parse an optional Outlook
user/mailbox adapter config value.
- Centralize construction of the Graph calendar base path.
- Use that path consistently in
ListEvents, CreateEvent, UpdateEvent, and DeleteEvent.
- Keep the current
/me behavior unchanged when the option is absent.
- Add HTTP tests for both
/me and /users/{id} paths across CRUD operations.
- Ensure the calendar/auth identity used for metadata hashing or storage does not collide across explicitly configured mailboxes, without changing hashes for existing
/me configurations.
- Document the required Microsoft Graph delegated permissions for shared/delegated calendars (
Calendars.Read.Shared or Calendars.ReadWrite.Shared) and the corresponding mailbox delegation. Application permissions could remain out of scope for the initial patch.
Microsoft documents direct access to a shared/delegated owner's mailbox using the owner's ID or UPN here:
https://learn.microsoft.com/en-us/graph/outlook-get-shared-events-calendars
Relation to existing issue
This is related to #199, but narrower: it does not require multiple source adapters in one process or service-account support. It only adds an explicit Microsoft Graph mailbox context to one Outlook adapter instance.
If this direction is acceptable, I am willing to prepare a focused PR with tests and documentation.
Problem
The Outlook HTTP adapter currently hardcodes Microsoft Graph URLs below
/me/calendars/{calendarID}for all operations:This prevents using CalendarSync with a shared or delegated Microsoft 365 mailbox when the OAuth principal is a delegate and the calendar belongs to another mailbox. Shared mailboxes commonly have no interactive sign-in of their own.
Reproduction
outlook_httpadapter as user A.Observed in a real deployment:
/me/calendars/{B-calendar-id}/CalendarView./users/{B-UPN}/calendars/{B-calendar-id}/calendarViewreturned the expected events.No tokens, calendar IDs, or mailbox identities are included here.
Expected behavior
Allow an Outlook adapter to optionally address an explicit mailbox/user while preserving
/meas the default for existing configurations.For example:
Suggested URL behavior:
config.user:/me/calendars/{calendarID}/...config.userset:/users/{url-escaped-user}/calendars/{calendarID}/...The value could accept either a user principal name or an Entra object ID.
Implementation scope
A small backward-compatible change should be sufficient:
user/mailboxadapter config value.ListEvents,CreateEvent,UpdateEvent, andDeleteEvent./mebehavior unchanged when the option is absent./meand/users/{id}paths across CRUD operations./meconfigurations.Calendars.Read.SharedorCalendars.ReadWrite.Shared) and the corresponding mailbox delegation. Application permissions could remain out of scope for the initial patch.Microsoft documents direct access to a shared/delegated owner's mailbox using the owner's ID or UPN here:
https://learn.microsoft.com/en-us/graph/outlook-get-shared-events-calendars
Relation to existing issue
This is related to #199, but narrower: it does not require multiple source adapters in one process or service-account support. It only adds an explicit Microsoft Graph mailbox context to one Outlook adapter instance.
If this direction is acceptable, I am willing to prepare a focused PR with tests and documentation.