Repository navigation
Request: cleanly separate Enterprise Edition code from the MIT core (plugin or ee/ boundary)
#17104
Replies: 1 comment
|
Following up, since this request received no response and the opposite direction has shipped since. #16678 (license key checks) was merged on 16 Oct and released in v2.22.1 on 23 Oct. Concretely, in the published 2.22.1 packages:
To be clear, nobody here disputes Medusa's right to sell Enterprise features. The problem is twofold. RBAC is not an Enterprise feature. Separating "who may view orders" from "who may capture a payment" is basic hygiene for any shop with more than one admin. A store with two staff members needs it as much as a corporation does. SSO and advanced policy authoring can be Enterprise; basic roles and permissions belong in the core every Medusa store runs on. The packaging is inadequate. Shipping licensed code and license enforcement inside packages the community installs as its MIT core is not an adequate way to do open core:
Our options today are buying a license for a basic security control, re-implementing permissions ourselves, or freezing at 2.18. None of these is what "MIT core" led us to expect. We'd ask the team to answer the original questions, in particular:
A clear boundary (separate Enterprise packages, or an |
Uh oh!
There was an error while loading. Please reload this page.
Summary
First, thank you for Medusa. The v2 architecture (modules, workflows, the module SDK) is excellent, and I fully understand the need to fund the project through commercial offerings. This request is not about whether Enterprise features should exist, but about how they are packaged, so the MIT core stays something the community can install, fork, and contribute to with confidence.
Since v2.19.0 (#16110), the repository is dual-licensed: MIT except for the Enterprise Materials listed in
ENTERPRISE-LICENSE.md. Thank you for publishing an explicit path list and for stating that earlier versions remain under MIT — that transparency is appreciated. The concern is that the Enterprise Materials are interleaved with the MIT core rather than separated from it.Observations
Enterprise files live inside core packages. The list has more than 40 paths spread across
packages/core/framework,core-flows,types,utils,js-sdk,packages/medusa, andpackages/admin/dashboard, not only inpackages/modules/rbacandpackages/modules/providers/auth-oidc.MIT entry points re-export Enterprise files. For example, on
develop:packages/core/framework/src/index.ts./policiespackages/core/framework/src/http/middlewares/index.ts./check-permissionspackages/core/utils/src/modules-sdk/index.ts./define-policies,./policy-to-typespackages/core/core-flows/src/index.ts./rbacpackages/core/core-flows/src/user/workflows/index.tsassign-user-roles,get-assignable-roles, …packages/core/types/src/index.ts./rbacpackages/core/js-sdk/src/admin/index.tsRbacRole,RbacPolicyRemoving the Enterprise paths therefore breaks the MIT build.
No MIT-only npm artifact exists. Because compiled forms of Enterprise files are also Enterprise Materials, and the core packages bundle them, installing
@medusajs/framework,@medusajs/utils,@medusajs/core-flows,@medusajs/types, or@medusajs/js-sdk(≥ 2.19) appears to deliver Enterprise code to every user, including users who never enable an Enterprise feature.License enforcement is moving into MIT code paths. The open PR chore(medusa,utils,modules-sdk,rbac,auth-oidc,test-utils,types): add license key checks #16678 adds license-key verification (including a remote check) to
packages/core/utils, themodules-sdkloader, and themedusa build/medusa startcommands.Why this matters to the community
"license": "SEE LICENSE IN LICENSE"), even for MIT-only usage.Proposed options (any of these would resolve most concerns)
Option A — Enterprise as separate plugin/module packages (preferred).
Medusa's module and plugin system seems designed for exactly this. For example,
@medusajs/rbacand@medusajs/auth-oidcwould ship as Enterprise packages, and the admin RBAC routes would ship as an admin extension. Core would keep only small, MIT-licensed, documented extension points (for example, a permission-check hook interface, a policy-registration API, and a login-provider slot). Then core installs, builds, and runs with zero Enterprise code, and Enterprise users simply add the packages.Option B — A single
ee/boundary in the monorepo.If keeping Enterprise code in-repo is important, place all of it under one top-level
ee/directory (an established open-core convention). Add a CI job that deletesee/and verifies that the core builds and tests pass, so the boundary cannot erode.Option C — MIT-only published builds.
Ensure the published core packages contain no Enterprise code (Enterprise code ships only in Enterprise packages), so
npm installof the core is unambiguously MIT.Option D — Keep licensing mechanics out of MIT code paths.
Keep license verification (#16678) inside the Enterprise packages only. Define behavior for offline and air-gapped deployments, and ensure MIT-only installs never perform remote license checks.
RBAC code from v2.18.0 and earlier
RBAC existed in the repository under MIT up to and including v2.18.0. Some clarifications would help users who depend on that code:
Clarifications requested
Closing
Clean separation would make the core easier to adopt and contribute to, make Enterprise easier to reason about and buy, and remove any perception that the MIT core is "open only on paper". Thank you for considering it. I am happy to help test a separation proposal if useful.
All reactions