mcphost

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 17 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

Overview

Package mcphost supplies immutable synthetic hosts for core protocol tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Connector *ssh.Connector
	// contains filtered or unexported fields
}

Backend preserves the original static-fixture connection behavior, including direct fault-injection access. Production hosts use sshexec or a CLI adapter.

func (*Backend) Inspect

func (b *Backend) Inspect(ctx context.Context, permit ports.Permit, node string, request ports.InspectRequest) (_ remotefile.Metadata, retErr error)

func (*Backend) OpenFiles

func (b *Backend) OpenFiles(ctx context.Context, _ ports.Permit, node string) (ports.FileSession, error)

func (*Backend) OpenPTY added in v0.16.0

func (b *Backend) OpenPTY(ctx context.Context, _ ports.Permit, node string) (ports.PTYSession, error)

func (*Backend) OpenTransfer

func (b *Backend) OpenTransfer(ctx context.Context, permit ports.Permit, node string) (ports.TransferSession, error)

func (*Backend) Run

func (b *Backend) Run(ctx context.Context, _ ports.Permit, node string, command ports.Command) (ports.CommandResult, error)

func (*Backend) RunTunnel

func (b *Backend) RunTunnel(ctx context.Context, _ ports.Permit, spec tunnel.Spec, ready func(string) bool, report func(error)) (retErr error)

func (*Backend) Shutdown

func (b *Backend) Shutdown(context.Context) error

type Configuration

type Configuration struct {
	Nodes                 *concurrent.Map[string, models.Node]
	Hosts                 *concurrent.Map[string, models.Host]
	Identities            *concurrent.Map[string, models.Identity]
	Guardrail             *policy.Config
	PasswordPromptPattern string
}

type GuardrailConfig

type GuardrailConfig = policy.Config

type NodeGuardrailCfg

type NodeGuardrailCfg = policy.NodeConfig

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProviderWithoutOpenSSH

func NewProviderWithoutOpenSSH(cfg *Configuration) *Provider

func (*Provider) Dependencies

func (p *Provider) Dependencies() ports.Dependencies

func (*Provider) DomainID

func (p *Provider) DomainID() string

func (*Provider) Enter

func (p *Provider) Enter(ctx context.Context, admission ports.Admission) (ports.Permit, error)

func (*Provider) GetConfig

func (p *Provider) GetConfig(id string) (*ssh.ClientConfig, error)

func (*Provider) List

func (*Provider) NewBackend

func (p *Provider) NewBackend(ctx context.Context) (ports.Backend, error)

func (*Provider) Policy

func (p *Provider) Policy() policy.Config

func (*Provider) Resolve

func (*Provider) ResolveSecret

func (p *Provider) ResolveSecret(ctx context.Context, request ssh.SecretRequest) ([]byte, error)

func (*Provider) ResolveSelector

func (p *Provider) ResolveSelector(selector string) (string, error)

func (*Provider) SSHOptions

func (p *Provider) SSHOptions() []ssh.Option

Tests set HOME/USERPROFILE to fixture-owned directories. Discovery is limited to this synthetic host; production core never reads these process defaults.

func (*Provider) Snapshot

func (p *Provider) Snapshot() *Configuration

Directories

Path Synopsis
Package models contains synthetic inventory data for migrated protocol tests.
Package models contains synthetic inventory data for migrated protocol tests.

Jump to

Keyboard shortcuts

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