Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateServiceSkill(port string) string
- func GenerateToken() (string, error)
- type Principal
- func (p *Principal) AllowsClawID(podName, clawID string) bool
- func (p *Principal) AllowsComposeService(podName, composeName string) bool
- func (p *Principal) AllowsPod(podName string) bool
- func (p *Principal) AllowsService(podName, service string) bool
- func (p *Principal) AllowsVerb(verb string) bool
- type Store
- type ThresholdAlert
- type Thresholds
Constants ¶
View Source
const ( VerbFleetStatus = "fleet.status" VerbFleetLogs = "fleet.logs" VerbFleetQueryMetrics = "fleet.query_metrics" VerbFleetAlerts = "fleet.alerts" VerbFleetRestart = "fleet.restart" VerbFleetQuarantine = "fleet.quarantine" VerbFleetBudgetSet = "fleet.budget.set" VerbFleetModelRestrict = "fleet.model.restrict" )
Variables ¶
View Source
var AllReadVerbs = []string{VerbFleetStatus, VerbFleetLogs, VerbFleetQueryMetrics, VerbFleetAlerts}
View Source
var AllVerbs = append(append([]string{}, AllReadVerbs...), AllWriteVerbs...)
View Source
var AllWriteVerbs = []string{VerbFleetRestart, VerbFleetQuarantine, VerbFleetBudgetSet, VerbFleetModelRestrict}
Functions ¶
func GenerateServiceSkill ¶
func GenerateToken ¶
Types ¶
type Principal ¶
type Principal struct {
Name string `json:"name"`
Token string `json:"token"`
Verbs []string `json:"verbs"`
Pods []string `json:"pods,omitempty"`
Services []string `json:"services,omitempty"`
ClawIDs []string `json:"claw_ids,omitempty"`
ComposeServices []string `json:"compose_services,omitempty"`
}
func BuildMasterPrincipal ¶
func BuildSelfPrincipal ¶ added in v0.3.6
func (*Principal) AllowsClawID ¶
func (*Principal) AllowsComposeService ¶ added in v0.3.6
func (*Principal) AllowsService ¶
func (*Principal) AllowsVerb ¶
type ThresholdAlert ¶ added in v0.3.5
type Thresholds ¶ added in v0.3.5
type Thresholds struct {
ErrorRatePercent float64 `json:"error_rate_percent"`
MaxCostUSD float64 `json:"max_cost_usd"`
FeedErrorRatePercent float64 `json:"feed_error_rate_percent"`
InterventionCount int `json:"intervention_count"`
}
func DefaultThresholds ¶ added in v0.3.5
func DefaultThresholds() Thresholds
func ThresholdsFromEnv ¶ added in v0.3.5
func ThresholdsFromEnv() Thresholds
func (Thresholds) Evaluate ¶ added in v0.3.5
func (th Thresholds) Evaluate(agent audit.AgentSummary) []ThresholdAlert
Click to show internal directories.
Click to hide internal directories.