Documentation
¶
Overview ¶
Package muster mocks a muster aggregator on one server: its own OAuth authorization server -- the protected-resource metadata of RFC 9728, the server metadata of RFC 8414, dynamic client registration, an authorization endpoint that redirects straight back with a code the way a browser of a person who is signed in already does, the token endpoint issuing access and refresh tokens, userinfo -- and the MCP endpoint /mcp over streamable HTTP, whose tools answer from the scenario's sequences by tool name. DEVCTL_MUSTER_URL is the server's URL plus /mcp.
Index ¶
Constants ¶
const ClientID = "devctl-e2e-client"
ClientID is the client id the registration endpoint hands out.
const MCPPath = "/mcp"
MCPPath is where the aggregator speaks MCP.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Tools maps a tool name, as muster exposes it (x_<server>_<tool>, or
// core_auth_login), to its sequence of answers: the Nth call gets the
// Nth answer and the last one repeats.
Tools map[string][]ToolResponse `yaml:"tools"`
// Login is the userinfo answer's email; e2e-engineer@example.com when
// left out.
Login string `yaml:"login"`
// Bearer is an access token the MCP endpoint accepts besides the ones it
// issued: the scenario's keyring token.
Bearer string `yaml:"bearer"`
// RefreshToken is a refresh token the token endpoint accepts besides the
// ones it issued: the scenario's keyring refresh token.
RefreshToken string `yaml:"refreshToken"`
}
Config is the mock's script.
type ToolResponse ¶
type ToolResponse struct {
// Result is the tool's answer: a mapping or list becomes the structured
// content (and the JSON text content), a string the text content.
Result any `yaml:"result"`
// Error makes the answer a tool error with this text.
Error string `yaml:"error"`
}
ToolResponse is one scripted answer of a tool.