Repository navigation
ogar-az: Graph mailbox and OneDrive reads; ogar-dir-sim: mailbox hosts and locations - #340
Conversation
…deployment shapes
ogar-az::mailbox names the Graph reads a mailbox takes (mailboxSettings,
settings/exchange, admin/exchange/mailboxes folders and items), each a
GET with its least-privileged application permission, and encodes one
user's results into a DirRecord of kind Mailbox: userPurpose and
primaryMailboxId raw, plus the mailbox GUID decoded strictly from the
observed MBX:{guid}@{tenant} spelling. No HTTP, no writes.
ogar-dir-sim::deployment adds ExchangeDeployment (on-premises, online,
hybrid: which source is authoritative for what) and MailboxPurpose
(Graph's userPurpose, mapped to RemoteKind).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
…§10) and deployment shapes (plan V15) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Add Carrot credits or activate Agent usage billing to use Autofix |
What
ogar-az::mailbox. Graph doesn't report a mailbox as a property ofuser; each piece takes its own read, with its own permission. This module names those reads asPulls. Every one is aGETagainst v1.0 with the least-privileged permission Microsoft documents:MailboxSettings/users/{id}/mailboxSettingsMailboxSettings.ReadExchangeSettings/users/{id}/settings/exchangeUser.Read.AllMailboxFolders/admin/exchange/mailboxes/{mailboxId}/foldersMailboxFolder.Read.AllMailboxItems/admin/exchange/mailboxes/{mailboxId}/folders/{folderId}/itemsMailboxItem.Read.AllUserDrive/users/{id}/driveFiles.Read.All, delegatedPull::grantsays how the permission is granted. The mailbox reads take an application permission. Microsoft lists reading a user's drive as delegated only.encode_mailboxturns one user's two settings reads into aDirRecordof kindAzKind::Mailbox. The record is keyed by the Graph user id (the mailbox'sExternalDirectoryObjectId) and holds:userPurpose, as returned by Graph;primaryMailboxId, as returned by Graph;primaryMailboxId.MBX:{guid}@{tenant}. The tenant part must equal the record's tenant. Any other spelling keeps the raw value and decodes nothing.user_driveaccepts a drive only when its owner is that user. It returns the drive id, which Spear's drive scope needs to address uploads.The module performs no HTTP and no writes.
examples/mailbox_ingest.rsprints the reads with their permissions and encodes saved response bodies.ogar-dir-sim::deployment.MailboxHostis where a mailbox lives:ExchangeServerorStalwarton-premises, orExchangeOnline.Deployment { on_premises, online }names the on-premises host (or none) and whether Exchange Online is present. Its constants areEXCHANGE_SERVER,ONLINE,EXCHANGE_HYBRID,STALWARTandSTALWART_WITH_ONLINE.ExchangeGuidis compared only for Exchange Server together with Exchange Online, because Stalwart has noExchangeGuid.host_of(recipient)is where that recipient's mailbox lives. A mail server needs this before it accepts a message as local or relays it.MailboxLocation { host, kind, mailbox_guid }andMailboxLocationType(seven values) carry whatGet-MailboxLocationreports. Exchange names a locationTenantGUID\MailboxGUID, the same pair Graph spellsMBX:{guid}@{tenant}.MailboxPurposeis Graph'suserPurpose, mapped ontoRemoteKind.Docs.
DIRECTORY-ADAPTERS-POC.md§10 covers the Graph reads.DIRECTORY-SIMULATION-POC.mdV15 covers hosts and locations, with these open items:EXCHANGE_HYBRID.Accounteven for a mailbox that lives in Exchange Online. UnderSTALWART_WITH_ONLINEit should answerAccountonly wherehost_ofisStalwart.Not done here
MBX:GUID is theExchangeGuidshould be confirmed againstGet-EXOMailbox -Properties ExchangeGuid.Mailbox.ReadWrite.All. No permission by that name exists. Mailbox content is covered byMailboxFolder.*andMailboxItem.*, and only their read variants are used here.Tests
tests/mailbox.rshas 8 tests anddeployment.rshas 4.ExchangeSettingspermission;userPurpose;host_of;ExchangeGuidonly for Exchange Server, and only in the earlier version, comparing it only for the hybrid deployment.fmtandclippy -D warningsare clean on Rust 1.99.0.ogar-from-schema'sdo_arm/sgotests fail the same way onmainhere: they need an OGIT checkout this container doesn't have.🤖 Generated with Claude Code
https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg