Documentation
¶
Overview ¶
Package adapterservice provides the per-user adapter daemon and its protected local management protocol. Each profile owns one fixed platform session.
Index ¶
- Constants
- func CheckPrivate(path string, dir bool) error
- func Token() (string, error)
- func ValidateProfiles(profiles []Profile) error
- type Credential
- type Daemon
- type Event
- type Issue
- type Profile
- type ProfileStatus
- type Status
- type Store
- func (s Store) Init() error
- func (s Store) Install(ctx context.Context, executable string) error
- func (s Store) Installed() bool
- func (s Store) Label() string
- func (s Store) LaunchAgentPath() string
- func (s Store) Load() ([]Profile, error)
- func (s Store) Lock(name string) (*os.File, error)
- func (s Store) Plist(executable string) []byte
- func (s Store) Request(ctx context.Context, method, path string) (Status, error)
- func (s Store) Save(profiles []Profile) error
- func (s Store) Socket() string
- func (s Store) Start(ctx context.Context) error
- func (s Store) Stop(ctx context.Context) error
- func (s Store) Uninstall(ctx context.Context, purge bool) error
Constants ¶
const LocalCredentialHeader = "X-MCP-Local-Token" // #nosec G101 -- this is an HTTP header name, not a credential value.
const ProtocolVersion = 1
Variables ¶
This section is empty.
Functions ¶
func CheckPrivate ¶
CheckPrivate refuses symlinks, foreign owners and group/world access rather than silently adopting an existing path with unsafe permissions.
func ValidateProfiles ¶
Types ¶
type Credential ¶
type Issue ¶
type Issue func(context.Context, Profile) (Credential, error)
Issue must renew only the profile's recorded session, never create a session.
type Profile ¶
type Profile struct {
Name string `json:"name"`
PlatformURL string `json:"platform_url"`
RuntimeURL string `json:"runtime_url"`
Namespace string `json:"namespace"`
Server string `json:"server"`
Agent string `json:"agent"`
Human string `json:"human"`
Team string `json:"team"`
Session string `json:"session"`
TrustDomain string `json:"trust_domain"`
SessionExpires time.Time `json:"session_expires"`
Listen string `json:"listen"`
PlatformToken string `json:"platform_token"`
LocalToken string `json:"local_token"`
}
Profile is stored only in the owner-protected store, never returned as status. PlatformToken authenticates certificate renewal, LocalToken authenticates the local MCP client. Neither is an upstream OAuth bearer.
type ProfileStatus ¶
type ProfileStatus struct {
Name string `json:"name"`
PlatformURL string `json:"platform_url"`
Namespace string `json:"namespace"`
Server string `json:"server"`
Agent string `json:"agent"`
Human string `json:"human"`
Team string `json:"team"`
Endpoint string `json:"endpoint"`
LocalReady bool `json:"local_ready"`
Upstream string `json:"upstream"`
Authentication string `json:"authentication"`
CertificateExpires time.Time `json:"certificate_expires"`
SessionExpires time.Time `json:"session_expires"`
LastCheck time.Time `json:"last_check"`
LastRenewalError string `json:"last_renewal_error,omitempty"`
}
type Status ¶
type Status struct {
Version int `json:"version"`
Running bool `json:"running"`
StartAtLogin bool `json:"start_at_login"`
Profiles []ProfileStatus `json:"profiles"`
Events []Event `json:"events"`
}
type Store ¶
type Store struct{ Dir string }
func DefaultStore ¶
func (Store) Install ¶
Install places a stable daemon binary outside the source checkout. Replace that binary only after stopping the previous service. Profiles are preserved.