Documentation
¶
Overview ¶
Package management implements the fixed, reviewed Management MCP tool catalog and its dispatch boundary (tools/list + tools/call) for PR-9. The catalog is READ-ONLY plus stateless draft/validate/simulate — there is NO mutation, activation, publication, credential, config-write, secret, log/trace-export, command-execution or arbitrary-access tool, and none can be added without a compile-time catalog change that the tests would reject (MCP-MGMT-001/003).
Every call is independently re-authorized (a client gains no authority by remembering a tool a prior tools/list returned), tenant-scoped (MCP-MGMT-002), and its result is byte-bounded before a JSON-RPC response is built (MCP-MGMT-004). A Gateway-scoped token can never call a Management tool.
Index ¶
Constants ¶
const ( ScopeInventoryRead = "mgmt.inventory.read" ScopeDecisionRead = "mgmt.decision.read" ScopePolicyRead = "mgmt.policy.read" ScopePolicyDraft = "mgmt.policy.draft" ScopeApprovalRead = "mgmt.approval.read" ScopeHealthRead = "mgmt.health.read" )
Management scope names (capability-local; NOT a generic "mcp" scope).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
Backend produces the safe, already-redacted DTO bytes for a tool invocation. The adminapi adapter implements it; management never sees raw data. The backend must itself enforce tenant scoping from id.Tenant.
type Class ¶
type Class uint8
Class classifies a Management tool. Only these two classes exist — there is no mutation class.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher enforces the Management boundary around a Backend.
func NewDispatcher ¶
func NewDispatcher(backend Backend, maxInputBytes, maxOutputBytes int) *Dispatcher
NewDispatcher builds a bounded Management dispatcher.
func (*Dispatcher) ToolsCall ¶
ToolsCall independently authorizes and dispatches one tool invocation, bounding both input and output. An unknown or unauthorized tool fails closed; an oversized result fails closed (never truncated unsafely).
func (*Dispatcher) ToolsList ¶
func (d *Dispatcher) ToolsList(id Identity) []ToolSpec
ToolsList returns only the tools id is authorized to see, sorted by name. A client cannot gain authority by remembering an omitted tool — tools/call re-authorizes independently.
type Identity ¶
Identity is the resolved Management caller context. Capability MUST be "management"; a Gateway token is rejected.
type Role ¶
type Role uint8
Role is a Management authorization role. It mirrors the admin-UI role ladder but is enforced independently per tool.