Documentation
¶
Overview ¶
Package managedentitlement is the fail-closed availability gate for publisher-tagged managed (S2/S3) StackKits surfaces.
Standalone OSS paths stay ungated. A missing source, a check error, an empty decision, or any non-allow is denied before the caller may perform HTTP or other cost-bearing side effects. HMAC service tokens are not a source.
Index ¶
Constants ¶
const ( // FeatureManagedServerless is the commercial feature required for kombify // to provision or operate the managed-serverless half of a StackKit. FeatureManagedServerless = "stackkits.managed_serverless" CapabilityBackupEnroll = "stackkits.managed.backup.enroll" ErrorCode = "feature_entitlement_denied" ReasonCheckFailed = "entitlement_check_failed" ReasonDenied = "entitlement_denied" )
Variables ¶
This section is empty.
Functions ¶
func OverrideSource ¶
func OverrideSource(next Source) func()
OverrideSource installs source for the current process and returns a restore function. Tests use this to inject an allow; production leaves the source nil until the managed entitlement adapter is wired.
Types ¶
type Decision ¶
type Decision struct {
Allowed bool
ReasonCode string
RequiredFeatures []string
MissingFeatures []string
}
Decision is the single allow/deny result consumed by CLI, MCP, and jobs.
type Denial ¶
type Denial struct {
ErrorCode string
ReasonCode string
Capability string
RequiredFeatures []string
MissingFeatures []string
Retryable bool
UserGuidance UserGuidance
Remediation string
SupportContext SupportContext
}
Denial is returned for every failed Evaluate. It is the FEATURE-ENTITLEMENT envelope plus the CLI actionable-error contract.
type Source ¶
Source returns one availability decision for a managed capability.
func AllowAll ¶
func AllowAll() Source
AllowAll is an explicit positive decision used by tests that exercise the allowed managed path. It is not a production adapter.
func CurrentSource ¶
func CurrentSource() Source
CurrentSource is the process-wide entitlement source. Nil is deny.
type SupportContext ¶
type SupportContext struct {
FeatureSource string `json:"feature_source"`
CostBearing bool `json:"cost_bearing"`
}
SupportContext is operator/agent handoff for a managed entitlement denial.
type UserGuidance ¶
type UserGuidance struct {
Title string `json:"title"`
Body string `json:"body"`
NextSteps []string `json:"next_steps"`
}
UserGuidance is the human-readable half of FEATURE-ENTITLEMENT-UX-STANDARD §1.4.