serverapi

package
v1.0.0-rc.16 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 82 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHealthRoutes

func AddHealthRoutes(mux *http.ServeMux)

func AddUIAuthRoutes added in v0.36.0

func AddUIAuthRoutes(mux *http.ServeMux, token string)

func AddVersionRoutes

func AddVersionRoutes(mux *http.ServeMux, version, nodeInstanceID, tenancy string)

func AuthenticateCredential added in v0.36.0

func AuthenticateCredential(token, cred string) bool

func Handler added in v0.32.8

func Handler(mux *http.ServeMux, config *Config) http.Handler

func IsLoopbackAddress

func IsLoopbackAddress(addr string) bool

func LoadConfig

func LoadConfig[T any](cfg *T) error

func New

func New(ctx context.Context, mux *http.ServeMux, nodeInstanceID, tenancy string, config *Config, deps ...Dependencies) (func() error, error)

func ProtectAPI added in v0.36.0

func ProtectAPI(token, allowedOrigins string, next http.Handler) http.Handler

func ProtectMutatingAPI

func ProtectMutatingAPI(token string, next http.Handler) http.Handler

func ProtectMutatingAPIWithAllowedOrigins added in v0.33.0

func ProtectMutatingAPIWithAllowedOrigins(token, allowedOrigins string, next http.Handler) http.Handler

func ValidateLocalServeSecurity

func ValidateLocalServeSecurity(addr, token string) error

Types

type Config

type Config struct {
	Addr                 string `json:"addr"`
	Port                 string `json:"port"`
	Token                string `json:"token"`
	UIBaseURL            string `json:"ui_base_url"`
	AllowedAPIOrigins    string `json:"allowed_api_origins"`
	ProxyOrigin          string `json:"proxy_origin"`
	HarnessDevProxyURL   string `json:"harness_dev_proxy_url"`
	TerminalEnabled      string `json:"terminal_enabled"`
	TerminalAllowedRoot  string `json:"terminal_allowed_root"`
	TerminalShell        string `json:"terminal_shell"`
	TerminalIdleTimeout  string `json:"terminal_idle_timeout"`
	TerminalMaxSessions  string `json:"terminal_max_sessions"`
	WorkspaceRoots       string `json:"workspace_roots"`
	HITLApprovalTimeout  string `json:"hitl_approval_timeout"`
	TurnMax              string `json:"contenox_turn_max"`
	TurnGrace            string `json:"contenox_turn_grace"`
	SandboxShellScrub    string `json:"sandbox_shell_scrub"`
	SandboxTerminalScrub string `json:"sandbox_terminal_scrub"`
	SandboxEnvAllow      string `json:"sandbox_env_allow"`
	SandboxEnvDeny       string `json:"sandbox_env_deny"`
}

type Dependencies

type Dependencies struct {
	DB                    libdb.DBManager
	PubSub                libbus.Messenger
	State                 *runtimestate.State
	ToolsProviderService  toolsproviderservice.Service
	Connectors            connectorservice.Service
	Auth                  middleware.AuthZReader
	Agent                 agentservice.Agent
	Chains                taskchainservice.Service
	Fleet                 fleetservice.Service
	Missions              missionservice.Service
	MissionChanges        missionchanges.Service
	OperatorInbox         operatorinbox.Service
	HITL                  hitlservice.Service
	Tracker               libtracker.ActivityTracker
	WorkspaceID           string
	ProjectRoot           string
	ContenoxDir           string
	WorkspaceRoots        *vfs.Factory
	WorkspaceRootMutators *localfileapi.RootsMutators
	WorkspaceEvents       workspaceevents.Service
	WorkspaceTriggers     *workspacetriggersapi.Deps
	Defaults              stateservice.RuntimeDefaults
	TerminalService       terminalservice.Service
	TerminalEnabled       bool
	HITLPolicySource      hitlservice.PolicySource
	HITLDefaultPolicyName string
	AgentsConfigApplied   func(ctx context.Context, scope, workspaceRoot string)
}

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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