feat: add enterprise Phase 1-4 feature flags and new permissions

This commit is contained in:
SnapOtter
2026-06-13 16:20:24 +08:00
parent cafd2d8b65
commit 86d6f50ea6
6 changed files with 70 additions and 3 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import {
ENTERPRISE_FEATURES,
type EnterpriseFeature,
type LicensePayload,
PLAN_FEATURES,
validateLicense,
} from "./license.js";
@@ -31,4 +32,4 @@ export type S3StorageModule = typeof import("./storage-s3.js");
export async function loadS3Storage(): Promise<S3StorageModule> {
return import("./storage-s3.js");
}
export { ENTERPRISE_FEATURES, type EnterpriseFeature, type LicensePayload };
export { ENTERPRISE_FEATURES, PLAN_FEATURES, type EnterpriseFeature, type LicensePayload };
+20 -1
View File
@@ -13,12 +13,31 @@ export const ENTERPRISE_FEATURES = [
"audit_export",
"mfa",
"per_tool_permissions",
"siem_forwarding",
"tamper_resistant_audit",
"legal_hold",
"gdpr_lifecycle",
"team_retention_overrides",
"sso_enforcement",
"ip_allowlist",
"config_export_import",
"upgrade_management",
"admin_alerts",
] as const;
export type EnterpriseFeature = (typeof ENTERPRISE_FEATURES)[number];
export const PLAN_FEATURES: Record<string, readonly EnterpriseFeature[]> = {
team: ["saml_sso", "s3_storage", "multi_tenancy"],
team: [
"saml_sso",
"s3_storage",
"multi_tenancy",
"audit_export",
"siem_forwarding",
"sso_enforcement",
"upgrade_management",
"admin_alerts",
],
enterprise: ENTERPRISE_FEATURES,
};