Documentation
¶
Overview ¶
Package controlapi 实现 daemon listener 上的本机内部控制 API(/control/*)。
它是守卫侧的 controller 层:只做协议转换(HTTP/JSON ↔ 桥接调用)与控制令牌鉴权,一切有状态 逻辑交给 Bridge。扁平信任下控制令牌是唯一传输闸门:带令牌即拥有全部能力,不再逐客户端令牌 / scope 判定;调用方自报的客户端标签只用于审计归因。与扩展 WS 面共用同一 listener、走独立路径; 除 /control/health 外均要求控制令牌。请求/响应 DTO 与前端共享,见 internal/client/control。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge interface {
Version() string
Action(name string) (protocol.Action, bool)
ExtConnected() bool
AuditSnapshot() []audit.Event
Call(ctx context.Context, req bridge.Request) (bridge.Response, error)
BeginEnrollment() (string, error)
}
Bridge 是控制 API 依赖的守卫侧能力面,由 *bridge.Server 实现。 收窄到这几个方法既是为了让本包能独立测试,也是为了标明控制 API 不该碰 WS 连接状态。