Add Microsoft Graph OAuth connector#43
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds Microsoft Graph device-code OAuth sign-in support end-to-end: new contract schemas/types/errors and RPC methods, a server-side connection service with token persistence/refresh and disconnect logic plus tests, websocket RPC handlers with scope-based redaction, server layer wiring, client-runtime command atoms, and a web settings UI section for managing the connection. ChangesMicrosoft Graph Connection
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ConnectionsSettingsUI
participant WsRpcLayer
participant MicrosoftGraphConnection
participant MicrosoftEndpoint
User->>ConnectionsSettingsUI: click Sign In
ConnectionsSettingsUI->>WsRpcLayer: microsoftGraphStartSignIn
WsRpcLayer->>MicrosoftGraphConnection: startSignIn()
MicrosoftGraphConnection->>MicrosoftEndpoint: request device code
MicrosoftEndpoint-->>MicrosoftGraphConnection: userCode, verificationUri
MicrosoftGraphConnection-->>ConnectionsSettingsUI: sign-in flow details
loop poll until connected
ConnectionsSettingsUI->>WsRpcLayer: microsoftGraphPollSignIn
WsRpcLayer->>MicrosoftGraphConnection: pollSignIn(flowId)
MicrosoftGraphConnection->>MicrosoftEndpoint: poll token endpoint
MicrosoftEndpoint-->>MicrosoftGraphConnection: pending/connected
MicrosoftGraphConnection-->>WsRpcLayer: status
WsRpcLayer-->>ConnectionsSettingsUI: status (redacted if write-only)
end
Estimated code review effort: 4 (Complex) | ~75 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Implemented the requested Microsoft Graph access control in commit What changed
Verification
|
Local Codex PR ReviewVerdict: Summary Notable Changes Review Notes Findings
Upstream Alignment
Security and Privacy
Risk Notes
Automated local Codex review for |
Summary
Adds a server-owned Microsoft Graph OAuth connector for T3 Code using Microsoft device-code sign-in from Settings -> Connections.
What changed
ServerSecretStore; access tokens stay in memory and refresh before server-side Graph calls.access:read; gates sign-in, poll, and disconnect withaccess:write.Notes
This intentionally does not add a generic client-facing Graph proxy. The internal Graph helper is server-only, GET-only, root-relative, and constrained to
https://graph.microsoft.com.This came from the three-way parallel feature workflow. The selected base was the product-complete implementation because it had the strongest Settings UX and the safest credential persistence model.
Validation
pnpm install --frozen-lockfilepnpm exec vp test run src/microsoftGraph/MicrosoftGraphConnection.test.ts --reporter=verbose --testTimeout=10000fromapps/serverpnpm exec vp test run src/server.test.ts -t "accepts websocket rpc handshake with a bootstrapped browser session cookie" --reporter=verbose --testTimeout=15000fromapps/servergit diff --checkpnpm exec vp checkpassed with 18 unrelated existing warningspnpm exec vp run typecheck/Users/davidbalderston/.agents/skills/autoreview/scripts/autoreview --mode localcleanLive Microsoft tenant sign-in was not exercised; tests use mocked Microsoft identity and Graph responses.
Summary by CodeRabbit