mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 16:20:03 +00:00
fca5975c38
TierBusiness: Pro's feature set, 365-day history retention, uncapped core monitoring like every self-hosted tier, Business display name, and a slot in the min-tier ordering. Differentiation is by max_users limit, retention, and support rather than features (multi-user is already a Pro capability via RBAC; see specs/pricing-segmentation.md binder findings). Dormant until the license server issues business plan versions; no checkout, pricing, or UI surface references it yet. Contract shape recorded as cloud-paid Extension Point 26 and pinned by TestBusinessTierContractShape.
72 lines
2.9 KiB
Go
72 lines
2.9 KiB
Go
// Package license handles Pulse Pro license validation and feature gating.
|
|
package license
|
|
|
|
import "github.com/rcourtman/pulse-go-rewrite/pkg/licensing"
|
|
|
|
// Feature constants represent gated features in Pulse.
|
|
// These are embedded in license JWTs and checked at runtime.
|
|
const (
|
|
FeatureAIPatrol = licensing.FeatureAIPatrol
|
|
FeatureAIAlerts = licensing.FeatureAIAlerts
|
|
FeatureAIAutoFix = licensing.FeatureAIAutoFix
|
|
FeatureKubernetesAI = licensing.FeatureKubernetesAI
|
|
FeatureAgentProfiles = licensing.FeatureAgentProfiles
|
|
FeatureUpdateAlerts = licensing.FeatureUpdateAlerts
|
|
FeatureRBAC = licensing.FeatureRBAC
|
|
FeatureAuditLogging = licensing.FeatureAuditLogging
|
|
FeatureSSO = licensing.FeatureSSO
|
|
FeatureAdvancedSSO = licensing.FeatureAdvancedSSO
|
|
FeatureAdvancedReporting = licensing.FeatureAdvancedReporting
|
|
FeatureLongTermMetrics = licensing.FeatureLongTermMetrics
|
|
FeatureRelay = licensing.FeatureRelay
|
|
FeatureMobileApp = licensing.FeatureMobileApp
|
|
FeaturePushNotifications = licensing.FeaturePushNotifications
|
|
FeatureMultiUser = licensing.FeatureMultiUser
|
|
FeatureWhiteLabel = licensing.FeatureWhiteLabel
|
|
FeatureMultiTenant = licensing.FeatureMultiTenant
|
|
FeatureUnlimited = licensing.FeatureUnlimited
|
|
FeatureDemoFixtures = licensing.FeatureDemoFixtures
|
|
)
|
|
|
|
// Tier represents a license tier.
|
|
type Tier = licensing.Tier
|
|
|
|
const (
|
|
TierFree = licensing.TierFree
|
|
TierRelay = licensing.TierRelay
|
|
TierPro = licensing.TierPro
|
|
TierProPlus = licensing.TierProPlus
|
|
TierProAnnual = licensing.TierProAnnual
|
|
TierLifetime = licensing.TierLifetime
|
|
TierBusiness = licensing.TierBusiness
|
|
TierCloud = licensing.TierCloud
|
|
TierMSP = licensing.TierMSP
|
|
TierEnterprise = licensing.TierEnterprise
|
|
)
|
|
|
|
// TierFeatures maps each tier to its included features.
|
|
var TierFeatures = licensing.TierFeatures
|
|
|
|
// TierHistoryDays defines the maximum metrics history retention per tier.
|
|
var TierHistoryDays = licensing.TierHistoryDays
|
|
|
|
// DeriveEntitlements derives capabilities and limits from tier and canonical monitored-system fields.
|
|
func DeriveEntitlements(tier Tier, features []string, maxMonitoredSystems int, maxGuests int) (capabilities []string, limits map[string]int64) {
|
|
return licensing.DeriveEntitlements(tier, features, maxMonitoredSystems, maxGuests)
|
|
}
|
|
|
|
// TierHasFeature checks if a tier includes a specific feature.
|
|
func TierHasFeature(tier Tier, feature string) bool {
|
|
return licensing.TierHasFeature(tier, feature)
|
|
}
|
|
|
|
// GetTierDisplayName returns a human-readable name for the tier.
|
|
func GetTierDisplayName(tier Tier) string {
|
|
return licensing.GetTierDisplayName(tier)
|
|
}
|
|
|
|
// GetFeatureDisplayName returns a human-readable name for a feature.
|
|
func GetFeatureDisplayName(feature string) string {
|
|
return licensing.GetFeatureDisplayName(feature)
|
|
}
|