configmcp

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package configmcp serves the configuration MCP endpoint at /admin/mcp: an agent, signed in with one of an administrator's tokens, acts for the administrator: it searches the scanned catalog, scans schemas, previews plans against the administrator's workspace and writes them into it (the one copy the administrator edits in the console, so they see the changes as if made there), and diffs and simulates configurations. It has no tool to publish: the administrator publishes in the console. Each tool calls the configuration service the console's API calls, so permissions, checks and results are the console's; a token may be limited to some datasources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(app Service, tokens Tokens, admins accounts.Store, opts Options) http.Handler

New returns the endpoint's handler. Requests authenticate with Authorization: Bearer <token>, a token an administrator generated in the console for one client; it acts with the administrator's current permissions and stops working when it expires, is revoked or the account is disabled.

Types

type Options

type Options struct {
	Now func() time.Time
}

Options configure the endpoint.

type Service

type Service interface {
	ApplyPlan(ctx context.Context, in configapp.ApplyRequest) (*configapp.AppliedPlan, error)
	Catalog(ctx context.Context, f configapp.CatalogFilter, against configapp.Against, offset, limit int) (
		*configapp.CatalogPage, error)
	CatalogLinks(ctx context.Context, ref string, against configapp.Against) (*configapp.CatalogLinks, error)
	CatalogTable(ctx context.Context, ref string, against configapp.Against) (*configplan.Candidate, error)
	Diff(ctx context.Context, from string, to configapp.Against) (string, error)
	Pending(ctx context.Context, against configapp.Against) (*configapp.PendingWork, error)
	PlanScope(ctx context.Context, scope configplan.Scope, against configapp.Against) (*configapp.ScopeStats, error)
	PlanTemplates(ctx context.Context) ([]configapp.PlanTemplate, error)
	PreviewInWorkspace(ctx context.Context, p configplan.Plan, review bool) (*configapp.Preview, error)
	Previewed(ctx context.Context, planID string) (*configapp.Preview, error)
	Revisions(ctx context.Context, limit int) ([]revision.Revision, error)
	ScanBatches(ctx context.Context, datasource string) ([]configapp.ScanBatch, error)
	SchemaList(ctx context.Context, datasource string, refresh bool) (*configapp.SchemaList, error)
	Simulate(ctx context.Context, in configapp.SimulateRequest) (*configapp.Simulation, error)
	StartScanBatch(ctx context.Context, in configapp.ScanBatchInput) (*configapp.ScanBatch, error)
}

Service is what the endpoint may do with the configuration service: read the catalog, revisions and pending work, scan schemas, preview plans and apply them to the administrator's workspace, diff and simulate. Nothing else of configapp.Service (publishing, tokens, the workspace's versioning operations, saving templates) is reachable from an agent's token: the type says so, not a review.

type Tokens

type Tokens interface {
	AdminTokenByHash(ctx context.Context, hash string) (configstore.AdminToken, bool, error)
	TouchAdminToken(ctx context.Context, id string, at time.Time) error
}

Tokens finds and records the use of administrators' tokens.

Jump to

Keyboard shortcuts

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