Documentation
¶
Overview ¶
Package selfcall carries a request to the platform's own HTTP API that is served inside this process on behalf of a caller the platform has already authenticated (#2086).
The built-in platform-admin connection acts as its caller: a call that carries the caller's token forwards it over the loopback, and the admin and portal authenticators check it like any other. A managed script's run has no token -- it presents the roles its owner held at the save -- so its call is handed to the platform's handler directly, with the identity the tool-call middleware authenticated recorded on the request's context. The authenticators read it from there. A request that arrives over the network cannot carry a context value, so this adds no credential anyone can send.
Index ¶
- func ForCall(ctx context.Context, req *http.Request) (*http.Request, bool)
- func From(ctx context.Context) (mcpcontext.Caller, bool)
- func Install[T any](kits []T, h http.Handler)
- func Transport(self, network http.RoundTripper) http.RoundTripper
- func With(ctx context.Context, c mcpcontext.Caller) context.Context
- type Handler
- type PersonaError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForCall ¶
ForCall marks req to be served inside this process when the tool call it belongs to was authenticated as someone and carries no token to forward: a managed script's run. It reports false, leaving req alone, otherwise.
func From ¶
func From(ctx context.Context) (mcpcontext.Caller, bool)
From returns the caller a request served inside this process was made for, and false for every other request.
func Install ¶
Install hands h to every toolkit among kits that serves a connection with the platform's own handler (the api kind's platform-admin connection).
func Transport ¶
func Transport(self, network http.RoundTripper) http.RoundTripper
Transport sends a request ForCall marked through self, and every other request through network.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the platform's own HTTP handler, set once the server has assembled it. The connection that dispatches to it is registered before the server exists, so it holds this and the server fills it in.
type PersonaError ¶
PersonaError refuses a caller whose roles do not resolve to the persona a surface requires. Its text names the persona, the roles that reach it, and the roles the caller presents.
func (*PersonaError) Error ¶
func (e *PersonaError) Error() string