fix: ent gating - #128
fix: ent gating#128
Conversation
|
| const isAtLimit = (resource: OssQuotaResource): boolean => { | ||
| if (isEnterprise || !quotas || !quotaUsage) return false | ||
| const limit = quotas[QUOTA_KEY[resource]] | ||
| if (limit == null) return false | ||
| return quotaUsage[USAGE_KEY[resource]] >= limit |
There was a problem hiding this comment.
These controls use the quota usage stored by the one-time license fetch, but successful resource creation and deletion do not refresh that store. After creating the final allowed resource, the UI remains enabled and leads to an avoidable server rejection. After deleting from a full quota, the UI remains disabled and blocks a valid action until the page is reloaded.
Knowledge Base Used: Web application experience
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
What changed?
This PR separates open-source (OSS) limits from Enterprise-only capabilities across the backend, frontend, and docs. Without a valid
EFFICIENTAI_LICENSE, deployments run in OSS mode with enforced caps; with a license, Enterprise features unlock automatically.Backend — OSS quotas
New
app/core/oss_quotas.pyenforces per-org limits when there is no enterprise entitlement:Quotas are enforced on create/invite flows (metrics, agents, IAM invitations, workspace creation, etc.).
Backend — Enterprise license gating
app/core/license.py—DEFAULT_ENTERPRISE_OFFERINGSauto-enable for any valid license:alerts,metric_studio,db_sharding,llm_gatewayrequire_enterprise_feature()orrequire_enterprise_entitlement():directrouting)has_valid_license()required before Bifrost/LiteLLM routing applies/license-infoexposes quotas, usage, and enabled featuresFrontend — entitlement-aware UI
useOssQuotashook +apiErrors.tsfor structured 403 handling (oss_quota_exceeded,enterprise_license_required)licenseStoreexpanded with feature flags and quota stateDocs
LICENSE/enterprise/LICENSE.mdTests & CI fixes
test_enterprise_gating,test_oss_quotas,test_license_offerings, sharding session testsmedia_urls.py) and operational health endpoint trusted-host testsWhy?
v1.5.34 shipped IAM, Alerting, and LLM gateway as Enterprise capabilities, but enforcement was incomplete — OSS installs could still use gateway routing, multi-member IAM, and unlimited resources. This PR makes licensing boundaries consistent in API responses, UI, and tests so OSS and Enterprise behavior match the docs.
How to test
OSS mode (no license):
unset EFFICIENTAI_LICENSE pytest tests/test_api/test_enterprise_gating.py -vExpect 403 on alerts, metric studio, workspace IAM, gateway routing.
Enterprise mode (with license):
Full suite (CI parity):
Manual UI checks:
Scope note
The branch includes the merged docs revamp from #127 (already released as v1.5.34). The net new work in #128 is roughly 62 files, +3,053 / −417 lines focused on enterprise gating, OSS quotas, frontend entitlement UX, and test/CI fixes.
The PR body on GitHub is still the default template — I can paste this into #128 if you want.