clawapi

package
v0.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerbFleetStatus        = "fleet.status"
	VerbFleetLogs          = "fleet.logs"
	VerbFleetQueryMetrics  = "fleet.query_metrics"
	VerbFleetAlerts        = "fleet.alerts"
	VerbScheduleRead       = "schedule.read"
	VerbAgentContext       = "agent.context"
	VerbFleetRestart       = "fleet.restart"
	VerbFleetQuarantine    = "fleet.quarantine"
	VerbFleetBudgetSet     = "fleet.budget.set"
	VerbFleetModelRestrict = "fleet.model.restrict"
	VerbScheduleControl    = "schedule.control"
)

Variables

View Source
var AllVerbs = append(append([]string{}, AllReadVerbs...), AllWriteVerbs...)

Functions

func GenerateServiceSkill

func GenerateServiceSkill(port string) string

func GenerateToken

func GenerateToken() (string, error)

func PrincipalVersionSkewWarnings added in v0.8.8

func PrincipalVersionSkewWarnings(store *Store, imageRef string) []string

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 BuildDashboardPrincipal added in v0.9.0

func BuildDashboardPrincipal(podName string) (Principal, error)

func BuildMasterPrincipal

func BuildMasterPrincipal(podName, principalName string) (Principal, error)

func BuildSchedulerPrincipal added in v0.5.2

func BuildSchedulerPrincipal(podName string) (Principal, error)

func BuildSelfPrincipal added in v0.3.6

func BuildSelfPrincipal(podName, serviceName string) (Principal, error)

func (*Principal) AllowsClawID

func (p *Principal) AllowsClawID(podName, clawID string) bool

func (*Principal) AllowsComposeService added in v0.3.6

func (p *Principal) AllowsComposeService(podName, composeName string) bool

func (*Principal) AllowsPod

func (p *Principal) AllowsPod(podName string) bool

func (*Principal) AllowsService

func (p *Principal) AllowsService(podName, service string) bool

func (*Principal) AllowsVerb

func (p *Principal) AllowsVerb(verb string) bool

type Store

type Store struct {
	Principals            []Principal `json:"principals"`
	NormalizationWarnings []string    `json:"-"`
}

func LoadStore

func LoadStore(filePath string) (*Store, error)

func LoadStoreWithWarnings added in v0.8.6

func LoadStoreWithWarnings(filePath string) (*Store, []string, error)

func (*Store) InertPrincipalNames added in v0.8.8

func (s *Store) InertPrincipalNames() []string

func (*Store) ResolveBearer

func (s *Store) ResolveBearer(header string) (*Principal, error)

type ThresholdAlert added in v0.3.5

type ThresholdAlert struct {
	Type     string `json:"type"`
	Severity string `json:"severity"`
	Summary  string `json:"summary"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL