approval

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package approval obtains human confirmation for write tools, either via MCP elicitation inside the client or via a browser approval page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestartURL

func RestartURL(base, cluster, kind, namespace, name string) string

RestartURL returns the link that requests approval to restart a workload. It holds no secret and changes nothing until a signed-in person approves.

Types

type BrowserAuth

type BrowserAuth interface {
	RequireUser(next func(w http.ResponseWriter, r *http.Request, subject string)) http.Handler
}

BrowserAuth signs a person in for the approval page. Implemented by oauth.Server.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager implements tool.Confirmer.

func New

func New(cfg config.Approval, publicURL string, browser BrowserAuth, logger *audit.Logger) *Manager

New returns a Manager. browser may be nil, which disables web approval. publicURL is the origin used to build approval links.

func (*Manager) Confirm

func (m *Manager) Confirm(ctx context.Context, req *mcp.CallToolRequest, r tool.ConfirmRequest) (method string, err error)

Confirm implements tool.Confirmer.

func (*Manager) Routes

func (m *Manager) Routes(mux *http.ServeMux)

Routes registers the /approve/ pages when web approval is enabled.

func (*Manager) SetDirect

func (m *Manager) SetDirect(lookup func(name string) *tool.Direct)

SetDirect supplies the writes that can run from an approval page.

Jump to

Keyboard shortcuts

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