Documentation
¶
Overview ¶
Package controlplane mounts the protected operator status and query HTTP surface for the control-plane persistence/query/event-ledger capability (spec control-plane-persistence-query-event-ledger; tasks 5.3, 5.4).
The handler mounts only when control-plane query exposure is explicitly enabled and the diagnostics shared-secret posture allows it (enforced by the composition root, which wraps this handler with diag.WrapDiagnosticsProtect). It exposes safe JSON status and bounded query pages; it never becomes a client-facing LLM protocol response path and never leaks raw DSNs, SQL, driver text, or privileged raw evidence (requirements 2.1–2.9, 4.6, 4.7, 7.1, 7.4, 8.6, 9.1, 9.4, 10.4, 10.5).
Index ¶
- func AdaptControlPlaneQueries(q *controlplane.QueryService) cp.Queries
- func AdaptReadinessReport(r *controlplane.ReadinessReportService) cp.ReadinessReportReader
- func NewAccountingAuthorityHandler(opts AuthorityOptions) http.Handler
- func NewConcurrencyAuthorityHandler(opts ConcurrencyOptions) http.Handler
- func NewHandler(opts Options) http.Handler
- type AccountingAuthorityQueries
- type AuthorityOptions
- type ConcurrencyAuthorityQueries
- type ConcurrencyOptions
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptControlPlaneQueries ¶
func AdaptControlPlaneQueries(q *controlplane.QueryService) cp.Queries
AdaptControlPlaneQueries projects a concrete query service onto lipcp.Queries. A nil or typed-nil pointer becomes a true nil interface.
func AdaptReadinessReport ¶
func AdaptReadinessReport(r *controlplane.ReadinessReportService) cp.ReadinessReportReader
AdaptReadinessReport projects a concrete readiness service onto ReadinessReportReader. A nil or typed-nil pointer becomes a true nil interface.
func NewAccountingAuthorityHandler ¶
func NewAccountingAuthorityHandler(opts AuthorityOptions) http.Handler
NewAccountingAuthorityHandler returns a protected HTTP handler for live authority status and bounded query views.
func NewConcurrencyAuthorityHandler ¶
func NewConcurrencyAuthorityHandler(opts ConcurrencyOptions) http.Handler
NewConcurrencyAuthorityHandler returns protected HTTP routes for lease queries. Mount under the same diagnostics-protected /authority prefix as accounting queries.
func NewHandler ¶
NewHandler returns an http.Handler that exposes the protected control-plane status and query routes under base. base must be a non-empty absolute path prefix (no trailing slash); routes are mounted as base, base/status, base/sessions, base/attempts, base/usage, base/usage/aggregate, base/policy-audit, and base/events.
Types ¶
type AccountingAuthorityQueries ¶
type AccountingAuthorityQueries interface {
Status(ctx context.Context) (cp.AccountingAuthorityStatus, error)
Limits(ctx context.Context, q cp.AccountingLimitStatusQuery) (authorityapp.LimitStatusResult, error)
Decisions(ctx context.Context, q cp.AccountingDecisionQuery) (authorityapp.DecisionHistoryResult, error)
}
AccountingAuthorityQueries is the narrow status/query surface for authority HTTP routes.
func AdaptAccountingAuthorityQueries ¶
func AdaptAccountingAuthorityQueries(svc *authorityapp.Service) AccountingAuthorityQueries
AdaptAccountingAuthorityQueries projects a concrete usage-authority service onto the narrow HTTP query contract. A nil or typed-nil pointer becomes a true nil interface so mount and handler `== nil` checks leave optional routes disabled.
type AuthorityOptions ¶
type AuthorityOptions struct {
Queries AccountingAuthorityQueries
DefaultPageSize int
MaxPageSize int
}
AuthorityOptions configures the protected accounting-authority HTTP handler.
type ConcurrencyAuthorityQueries ¶
type ConcurrencyAuthorityQueries interface {
ReadinessDomain(ctx context.Context) (concurrencydomain.Readiness, error)
RulesSnapshot(ctx context.Context) (concurrencyapp.RuleSnapshot, error)
Query(ctx context.Context, q concurrencyapp.QueryCommand) (concurrencyapp.QueryResult, error)
}
ConcurrencyAuthorityQueries is the narrow readiness/capacity surface for lease HTTP routes.
func AdaptConcurrencyAuthorityQueries ¶
func AdaptConcurrencyAuthorityQueries(svc *concurrencyapp.Service) ConcurrencyAuthorityQueries
AdaptConcurrencyAuthorityQueries projects a concrete concurrency-authority service onto the narrow HTTP query contract. A nil or typed-nil pointer becomes a true nil interface.
type ConcurrencyOptions ¶
type ConcurrencyOptions struct {
Provider authority.ConcurrencyProvider
Service ConcurrencyAuthorityQueries // optional; enables capacity/readiness summaries
DefaultPageSize int
MaxPageSize int
}
ConcurrencyOptions configures the protected concurrency-lease query handler.
type Options ¶
type Options struct {
// Queries is the bounded query service. When nil, every route returns 404
// so the handler is inert when the capability is disabled or unavailable.
Queries cp.Queries
// ReadinessReport, when non-nil, exposes independent authority/journal
// readiness at /readiness (requirements 15.7, 15.8).
ReadinessReport cp.ReadinessReportReader
// DefaultVisibility is applied when a request omits the visibility query
// parameter. Empty defaults to cp.VisibilityDefault so privileged raw
// evidence is not surfaced (requirement 4.6, 6.5).
DefaultVisibility cp.Visibility
}
Options configures a protected control-plane HTTP handler.