middleware

package
v0.0.0-...-4821246 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 12 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 middleware holds the HTTP bearer gate and the MCP audit and metrics middleware that wrap the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Observe

func Observe(logger *slog.Logger) mcp.Middleware

Observe logs every tool call with redacted arguments and records its latency and outcome. An IsError result counts as an error even though it is not a JSON-RPC failure.

func RequireBearer

func RequireBearer(sessionTTL time.Duration, next http.Handler) http.Handler

RequireBearer rejects requests without a bearer token. The token is not validated here; Ascender does that when tool calls land. The fingerprint in UserID activates the SDK's session-hijack guard, and the raw token rides along in Extra for tools to forward. sessionTTL bounds how long a token is trusted for the session it opened.

Types

This section is empty.

Jump to

Keyboard shortcuts

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