spec

package
v0.0.0-...-419c6d3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package spec defines the machine-readable connector operation spec used by sandbox discovery and generated HTTPS shims.

Index

Constants

View Source
const (
	// SchemaVersion is the current connector spec schema version.
	SchemaVersion = "aileron.connector.v1"
	// FileName is the connector package file loaded from installed entries.
	FileName = "aileron.connector.v1.json"
)

Variables

This section is empty.

Functions

func Validate

func Validate(spec Spec) error

Validate checks the required schema, identity, tool, and operation fields.

Types

type AuditField

type AuditField struct {
	Name        string `json:"name"`
	Source      string `json:"source,omitempty"`
	Redact      bool   `json:"redact,omitempty"`
	Description string `json:"description,omitempty"`
}

AuditField describes one audit metadata field the data plane should record.

type Connector

type Connector struct {
	FQN     string `json:"fqn"`
	Version string `json:"version,omitempty"`
}

Connector identifies the connector package providing the operations.

type Input

type Input struct {
	Name        string `json:"name"`
	Type        string `json:"type,omitempty"`
	Required    bool   `json:"required,omitempty"`
	Description string `json:"description,omitempty"`
}

Input describes one operation argument rendered into shim help.

type Operation

type Operation struct {
	Name        string       `json:"name"`
	Summary     string       `json:"summary,omitempty"`
	Description string       `json:"description,omitempty"`
	Method      string       `json:"method,omitempty"`
	Path        string       `json:"path,omitempty"`
	Hosts       []string     `json:"hosts,omitempty"`
	Idempotency string       `json:"idempotency,omitempty"`
	Approval    string       `json:"approval,omitempty"`
	Credential  string       `json:"credential,omitempty"`
	Inputs      []Input      `json:"inputs,omitempty"`
	Audit       []AuditField `json:"audit,omitempty"`
}

Operation describes one operation exposed by a generated HTTPS shim.

type Spec

type Spec struct {
	SchemaVersion string    `json:"schema_version"`
	Connector     Connector `json:"connector"`
	Tools         []Tool    `json:"tools"`
	SourcePath    string    `json:"-"`
	SourceHash    string    `json:"-"`
}

Spec is the root connector operation spec.

func LoadInstalled

func LoadInstalled(root string) ([]Spec, error)

LoadInstalled loads connector specs from a cstore root.

func Parse

func Parse(path string, data []byte) (Spec, error)

Parse decodes and validates one connector spec.

type Tool

type Tool struct {
	Name        string      `json:"name"`
	Description string      `json:"description,omitempty"`
	Operations  []Operation `json:"operations"`
}

Tool describes one sandbox-visible command rendered as a shim.

Jump to

Keyboard shortcuts

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