Skip to content

ogar-dir-sim: mailbox hosts and locations; ogar-az: the user's OneDrive - #341

Merged
AdaWorldAPI merged 4 commits into
mainfrom
ccr-0455e606-wmtsor
Oct 10, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
ccr-0455e606-wmtsor

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

This follow-up to #340 carries the rework that was pushed after #340 had already merged with its first version. It is rebased onto main and contains exactly two commits.

What

ogar-dir-sim::deployment. ExchangeDeployment becomes Deployment { on_premises, online }.

  • MailboxHost names where a mailbox lives: ExchangeServer or Stalwart on-premises, or ExchangeOnline.

  • The constants are EXCHANGE_SERVER, ONLINE, EXCHANGE_HYBRID, STALWART and STALWART_WITH_ONLINE.

  • host_of(recipient) says where a recipient's mailbox lives:

    • an on-premises mailbox is on the on-premises host;
    • a remote mailbox that is not deprovisioned is in Exchange Online;
    • any other recipient, or a host the deployment doesn't include, has no mailbox.

    This is the question a mail server answers before it accepts a message as local or relays it.

  • The ExchangeGuid is compared only for Exchange Server together with Exchange Online, because Stalwart has no ExchangeGuid.

  • MailboxLocation { host, kind, mailbox_guid } and MailboxLocationType (seven values) carry what Get-MailboxLocation reports. Exchange names a location TenantGUID\MailboxGUID, which is the same pair Graph spells MBX:{guid}@{tenant}.

ogar-az::mailbox.

  • Pull::UserDrive reads GET /users/{id}/drive with Files.Read.All.
  • Pull::grant says how a permission is granted. Microsoft lists the drive read as delegated only; the mailbox reads take an application permission.
  • user_drive accepts a drive only when its owner.user.id is the user, and returns its id. Spear's drive scope can then address a user's OneDrive from the directory id. The upload itself is Spear's write.

Docs.

  • DIRECTORY-SIMULATION-POC.md V15 is rewritten for hosts and locations, with these open items:
    • lance-graph doesn't use the deployment yet.
    • Stalwart should answer Account only where host_of is Stalwart.
    • Spear's OneDrive upload isn't built yet.
  • DIRECTORY-ADAPTERS-POC.md §10 adds the drive read.

Tests

  • deployment.rs has 4 tests: the deployment table, host_of per deployment, location types, and purposes.
  • tests/mailbox.rs adds a drive test covering the URL, the permission, the delegated grant, the owner check and malformed bodies.
  • I disabled each new guard one at a time, and each turned a test red:
    • the drive owner check;
    • the delegated grant;
    • host_of's deprovisioned case;
    • host_of's online gate;
    • comparing ExchangeGuid only for Exchange Server.
  • After the rebase, fmt and clippy -D warnings are clean and the crate tests are green on Rust 1.99.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg


Generated by Claude Code

ExchangeDeployment becomes Deployment { on_premises host, online }:
Exchange Server or Stalwart on-premises, Exchange Online in the cloud.
host_of says where a recipient's mailbox is, the question a mail server
answers before accepting a message as local or relaying it. Stalwart has
no ExchangeGuid, so only Exchange Server with Exchange Online compares
one. MailboxLocation and MailboxLocationType carry what
Get-MailboxLocation reports (TenantGUID\MailboxGUID, the pair Graph
spells MBX:{guid}@{tenant}).

ogar-az adds Pull::UserDrive (GET /users/{id}/drive, Files.Read.All,
delegated per Microsoft) and user_drive, which accepts a drive only when
its owner is the user, so Spear can address a user's OneDrive from the
directory id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
…ters §10)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 90ecdb8d-734e-4db5-abb5-35bdbf503d86

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae403d and bf10563.


📒 Files selected for processing (6)
  • crates/ogar-az/src/mailbox.rs
  • crates/ogar-az/tests/mailbox.rs
  • crates/ogar-dir-sim/src/deployment.rs
  • crates/ogar-dir-sim/src/lib.rs
  • docs/DIRECTORY-ADAPTERS-POC.md
  • docs/DIRECTORY-SIMULATION-POC.md

 _________________________________________________________________
< You know what they call CodeRabbit in Paris? Royale with Debug. >
 -----------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 @coderabbitai help to get the list of available commands.

… drive by user id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 10, 2026 13:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:14:02.567277Z bf10563 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit d402cf7 into main Oct 10, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants