callbinding

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 11 Imported by: ? 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 callbinding holds the pieces the vMCP uses to bind an access token to the one MCP call its authorization_details entry names.

The argument hash is the shared contract between the client that asks for a call-bound token and the vMCP that checks it: both compute it over params.arguments, so any input on which the two differ makes that call fail. Both sides therefore refuse arguments rather than risk disagreeing on them.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotIJSON = errors.New("callbinding: arguments are not I-JSON")

ErrNotIJSON is returned when params.arguments is not exactly one JSON object that is I-JSON (RFC 7493), so it has no argument hash.

Functions

func ArgumentsSHA256

func ArgumentsSHA256(args json.RawMessage) (string, error)

ArgumentsSHA256 returns the argument hash of params.arguments: the lowercase hex SHA-256 of its RFC 8785 (JCS) serialization. args is the raw value as received, before any routing or rewriting. An absent value (empty, or only JSON whitespace) and JSON null both hash as {}.

It returns an error for which errors.Is(err, ErrNotIJSON) holds for anything that is not exactly one JSON object, or that is not I-JSON: invalid UTF-8, lone or reversed surrogate escapes, duplicate member names (including ones equal only after decoding escapes), non-finite numbers, and numbers with magnitude above 2^53. The error never quotes the arguments.

Arguments that differ only in what RFC 8785 normalizes hash the same: member order, whitespace, string escapes, and number spelling, including -0 against 0 and digits beyond what an IEEE 754 double holds. A caller that forwards the arguments therefore authorizes every such spelling of them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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