clawapi

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerbFleetStatus       = "fleet.status"
	VerbFleetLogs         = "fleet.logs"
	VerbFleetQueryMetrics = "fleet.query_metrics"
	VerbFleetAlerts       = "fleet.alerts"
)

Variables

This section is empty.

Functions

func GenerateServiceSkill

func GenerateServiceSkill(port string) string

func GenerateToken

func GenerateToken() (string, error)

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"`
}

func BuildMasterPrincipal

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

func (*Principal) AllowsClawID

func (p *Principal) AllowsClawID(podName, clawID 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"`
}

func LoadStore

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

func (*Store) ResolveBearer

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

Jump to

Keyboard shortcuts

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