Skip to content

feat(integrations): add Dynamics 365 CRM - #6714

Open
BillLeoutsakosvl346 wants to merge 3 commits into
stagingfrom
feat/microsoft-dynamics-365
Open

feat(integrations): add Dynamics 365 CRM#6714
BillLeoutsakosvl346 wants to merge 3 commits into
stagingfrom
feat/microsoft-dynamics-365

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a ten-operation Microsoft Dynamics 365 CRM block backed by eight isolated CRM tool modules
  • add environment-bound Microsoft Dataverse OAuth while preserving legacy Dataverse credentials and flows
  • enforce credential-derived environments, strict response parsing, redirect-safe bearer handling, and bounded one-page pagination
  • preserve the exact Dataverse nextLink while pairing it with the page size required for the next request
  • align Opportunity Close and Case Resolution optionality and description limits with Microsoft metadata

Compatibility and safety

  • supported Dynamics UI paths prevent credential rebinding; equivalent server-side enforcement is tracked in #6716 and remains a merge prerequisite
  • existing microsoft_dataverse_* implementations and documentation are unchanged; shared generated registries change additively to register Dynamics
  • a narrowly gated credential-selector policy enforces Dynamics environment matching; no data selectors or selector API routes were added
  • adds no Desktop, service-account, migration, credential-framework, custom OAuth-route, or shared-transport work
  • limits this version to delegated OAuth for public-cloud Dataverse environments

Validation

  • focused Dynamics/OAuth/executor suite at exact head: 340 passed
  • exact-head CI: 25,512 passed / 41 skipped; build, lint/test, CodeQL, Greptile, Cursor Bugbot, Vercel, companion, and GitGuardian are green
  • local full repository bun run test: Sim reported 25,507 passed / 46 skipped; setup and all other package suites also passed
  • type-check, lint, all 26 audits, API/client/request boundaries, canvas, metadata, catalog, migrations, and git diff --check passed
  • lifecycle action contracts are statically matched to Microsoft documentation; live mutations remain UNVERIFIED because no authorized disposable sandbox was available
  • nonempty callback scope sets that contain no resource-qualified scope remain an intentional compatibility risk pending sanitized live callback evidence

Merge prerequisite

Do not merge until #6716 lands and this branch is rebased onto that platform fix.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 15, 2026 1:37am

Request Review

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches OAuth linking, callback scope validation, credential identity binding, and token resolution for Microsoft Dataverse—security-sensitive auth paths alongside a large new CRM surface. PR description also flags a merge dependency on server-side credential rebinding enforcement (#6716).

Overview
Adds a Microsoft Dynamics 365 CRM integration and workflow block with ten CRM-focused operations (list/get/create/update/search on standard tables, list owners, assign, qualify lead, close opportunity/case), backed by dedicated microsoft_dynamics_365_* tools while the generic Microsoft Dataverse block stays available for custom tables and delete.

Environment-bound OAuth is new for Dynamics paths: connect/reconnect flows collect a public-cloud Dataverse environment URL, request per-environment Microsoft scopes, validate link/callback scopes in auth, and persist an internal environment marker so credentials are not rebound across environments. Legacy unbound Dataverse credentials keep working; workflow credential selection enforces a matching environment when the block depends on environmentUrl. Token resolution projects instanceUrl from bound scopes for CRM calls.

Docs, integrations catalog, and icon mappings register microsoft_dynamics_365; connect modals, credential detail reconnect, and OAuth return handling wire in the Dataverse environment field and dedicated connect hook.

Reviewed by Cursor Bugbot for commit a2842cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a Microsoft Dynamics 365 CRM integration with environment-bound Dataverse OAuth, ten block operations, and eight registered tools.

  • Canonicalizes supported Dynamics environment aliases to their Web API origins.
  • Adds bounded pagination with opaque nextLink continuation support and aligned lifecycle-action metadata.
  • Prevents OAuth authorization from being forwarded when Dynamics requests follow redirects.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported redirect credential-disclosure path is fixed.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/tools/microsoft_dynamics_365/create_record.ts The prior redirect credential-disclosure issue is fixed by enabling authorization stripping.
apps/sim/tools/microsoft_dynamics_365/dynamics_crm.test.ts A table-driven regression test covers the redirect policy across all eight Dynamics tools.
apps/sim/tools/index.ts The tool transport forwards the redirect-auth policy to the secure HTTP implementation.
apps/sim/lib/core/security/input-validation.server.ts Redirect handling removes both supported Authorization header casings before following the validated target.
apps/sim/blocks/blocks/microsoft_dynamics_365.ts Defines the ten-operation CRM block and maps its operations to the eight registered tools.

Reviews (4): Last reviewed commit: "fix(integrations): align Dynamics paging..." | Re-trigger Greptile

Comment thread apps/sim/tools/microsoft_dynamics_365/create_record.ts
Comment thread apps/sim/lib/oauth/microsoft-dataverse.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile please re-review the latest commit.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread apps/sim/tools/microsoft_dynamics_365/list_records.ts
@BillLeoutsakosvl346
BillLeoutsakosvl346 force-pushed the feat/microsoft-dynamics-365 branch from d757dd4 to 2a508dd Compare August 15, 2026 00:15
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile please re-review the rebased latest commit.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2a508dd. Configure here.

@BillLeoutsakosvl346
BillLeoutsakosvl346 force-pushed the feat/microsoft-dynamics-365 branch from 2a508dd to a2842cf Compare August 15, 2026 01:32
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile please re-review the latest exact-head commit. The update preserves the opaque Dataverse nextLink with a paired page-size contract and aligns Opportunity Close/Case Resolution metadata limits.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a2842cf. Configure here.

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.

1 participant