Documentation
¶
Index ¶
- Constants
- Variables
- func DecodePayload[T any](envelope Envelope) (T, error)
- func ParseToken(raw string) (string, error)
- type Authenticate
- type Claims
- type DaemonConfig
- type Envelope
- type ErrorPayload
- type FullAudit
- type GPUInfo
- type GitAudit
- type GitHubCLIAudit
- type GitHubTokenProbe
- type Goodbye
- type Heartbeat
- type Hello
- type IssueInput
- type IssuedToken
- type MessageType
- type NetworkAudit
- type Registered
- type ResourceSnapshot
- type SystemInfo
- type ToolInfo
Constants ¶
View Source
const ( TokenPrefix = "ase_machine_" EnvMachineID = "OPENASE_MACHINE_ID" EnvMachineChannelToken = "OPENASE_MACHINE_CHANNEL_TOKEN" // #nosec G101 -- environment variable key name, not a credential EnvMachineControlPlaneURL = "OPENASE_MACHINE_CONTROL_PLANE_URL" EnvMachineHeartbeatInterval = "OPENASE_MACHINE_HEARTBEAT_INTERVAL" )
View Source
const ProtocolVersion = 1
Variables ¶
View Source
var ( ErrNotFound = errors.New("machine channel record not found") ErrInvalidToken = errors.New("machine channel token is invalid") ErrTokenExpired = errors.New("machine channel token expired") ErrTokenRevoked = errors.New("machine channel token is revoked") ErrUnexpectedMessage = errors.New("machine channel message is unexpected") ErrUnsupportedVersion = errors.New("machine channel version is unsupported") ErrConnectionMode = errors.New("machine connection mode does not support reverse websocket registration") ErrMachineDisabled = errors.New("machine is disabled for reverse websocket registration") ErrSessionReplaced = errors.New("machine channel session was replaced") ErrHeartbeatTimedOut = errors.New("machine channel heartbeat timed out") ErrAuthenticationFailed = errors.New("machine channel authentication failed") )
Functions ¶
func DecodePayload ¶
func ParseToken ¶
Types ¶
type Authenticate ¶
type Authenticate struct {
Token string `json:"token"`
MachineID string `json:"machine_id"`
TransportMode string `json:"transport_mode"`
SystemInfo SystemInfo `json:"system_info"`
Capabilities []string `json:"capabilities,omitempty"`
ToolInventory []ToolInfo `json:"tool_inventory,omitempty"`
ResourceSnapshot *ResourceSnapshot `json:"resource_snapshot,omitempty"`
}
type DaemonConfig ¶
type Envelope ¶
type Envelope struct {
Version int `json:"version"`
Type MessageType `json:"type"`
SessionID string `json:"session_id,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
func ParseEnvelope ¶
type ErrorPayload ¶
type FullAudit ¶
type FullAudit struct {
Git GitAudit `json:"git"`
GitHubCLI GitHubCLIAudit `json:"gh_cli"`
GitHubTokenProbe GitHubTokenProbe `json:"github_token_probe"`
Network NetworkAudit `json:"network"`
}
type GitHubCLIAudit ¶
type GitHubTokenProbe ¶
type Heartbeat ¶
type Heartbeat struct {
SentAt string `json:"sent_at"`
SystemInfo *SystemInfo `json:"system_info,omitempty"`
ToolInventory []ToolInfo `json:"tool_inventory,omitempty"`
ResourceSnapshot *ResourceSnapshot `json:"resource_snapshot,omitempty"`
}
type IssuedToken ¶
type MessageType ¶
type MessageType string
const ( MessageTypeHello MessageType = "hello" MessageTypeAuthenticate MessageType = "authenticate" MessageTypeRegistered MessageType = "registered" MessageTypeHeartbeat MessageType = "heartbeat" MessageTypeReconnect MessageType = "reconnect" MessageTypeGoodbye MessageType = "goodbye" MessageTypeCapabilities MessageType = "capabilities" MessageTypeSystemInfo MessageType = "system_info" MessageTypeToolInventory MessageType = "tool_inventory" MessageTypeError MessageType = "error" MessageTypeRetryAfter MessageType = "retry_after" MessageTypeRuntime MessageType = "runtime" )
type NetworkAudit ¶
type Registered ¶
type ResourceSnapshot ¶
type ResourceSnapshot struct {
CollectedAt string `json:"collected_at"`
CPUCores int `json:"cpu_cores"`
CPUUsagePercent float64 `json:"cpu_usage_percent"`
MemoryTotalGB float64 `json:"memory_total_gb"`
MemoryUsedGB float64 `json:"memory_used_gb"`
MemoryAvailableGB float64 `json:"memory_available_gb"`
DiskTotalGB float64 `json:"disk_total_gb"`
DiskAvailableGB float64 `json:"disk_available_gb"`
GPUs []GPUInfo `json:"gpus,omitempty"`
FullAudit *FullAudit `json:"full_audit,omitempty"`
}
type SystemInfo ¶
Click to show internal directories.
Click to hide internal directories.