rest

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package rest is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package rest implements the HTTP+SSE control-plane transport.

Routes (per § REST surface):

GET    /v1/handshake
GET    /v1/health
GET    /v1/sessions                          (catalog)
GET    /v1/sessions/{id}/events  (SSE)       stream
POST   /v1/sessions/{id}/input               SendInput
POST   /v1/sessions/{id}/cancel              CancelTurn
POST   /v1/sessions/{id}/permission          AnswerPermission
POST   /v1/sessions/{id}/model               SetModel
GET    /v1/profiles                          (catalog)
GET    /v1/providers                         (catalog)
GET    /v1/tools                             (catalog)
GET    /v1/skills                            (catalog)
GET    /v1/slash-commands                    (catalog)
GET    /v1/auth/token                        token mint (Unix-socket-only)

Security per § Threat model:

  • Token via X-Harness-Token header (anti-DNS-rebinding).
  • Host header must match localhost / 127.0.0.1 / configured.
  • Origin header must be in the allowlist for non-curl callers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Mux            *multiplex.Mux
	Catalog        *resources.Catalog
	Encoder        *auth.Encoder
	Revocations    *auth.RevocationList
	Features       []string
	AllowedHosts   []string // exact-match Host headers permitted (e.g., "127.0.0.1:8421")
	AllowedOrigins []string // exact-match Origin headers permitted

	// SessionStore, when non-nil, backs the ?past=true query on
	// /v1/sessions to surface historical sessions from disk.
	SessionStore session.Store
	// contains filtered or unexported fields
}

Server is the REST transport.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the http.Handler. Lazy-built on first call.

Jump to

Keyboard shortcuts

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