mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-19 10:22:17 +00:00
81b31e4d3b
Retire runtime/API/UI monitored-system volume enforcement now that infrastructure monitoring is no longer capped. Keep only legacy metadata scrubbing and purchase-start compatibility for old max_monitored_systems references. Rename the remaining preview surface to monitored-system impact and make previews explanatory rather than save-blocking. Update subsystem contracts and RA7 evidence for the caps-retired invariant.
83 lines
3.4 KiB
Go
83 lines
3.4 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
|
|
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
|
|
|
|
// DeriveCapabilitiesFromTier derives effective capabilities from tier and explicit features.
|
|
func DeriveCapabilitiesFromTier(tier Tier, explicitFeatures []string) []string {
|
|
return licensing.DeriveCapabilitiesFromTier(tier, explicitFeatures)
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
|
|
// IsCompatibilityOnlyFeature reports capability keys that remain valid runtime
|
|
// contracts for backwards compatibility but should not be marketed as current
|
|
// v6 commercial pillars or generic upgrade prompts.
|
|
func IsCompatibilityOnlyFeature(feature string) bool {
|
|
return licensing.IsCompatibilityOnlyFeature(feature)
|
|
}
|