eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
37 lines (36 loc) • 1.8 kB
TypeScript
/**
* Framework-shipped callback route used by in-turn interactive
* connection authorization.
*
* The connection callback route is the
* redirect target the workflow body hands to the IdP via
* `startAuthorization`. When the IdP redirects the user's browser back
* with the OAuth `code`/`state` (or whatever payload the protocol
* carries), this handler:
*
* 1. Parses the inbound request into a JSON-serializable
* {@link AuthorizationCallback} (params only — never request headers).
* 2. Calls `resumeHook(token, payload)` to wake the suspended workflow.
* 3. Renders the standard "Authorization complete" landing page so the
* user sees a friendly UI instead of an empty `202 Accepted`.
*
* Owning this route in the framework - instead of routing the IdP at the
* workflow runtime's raw `/.well-known/workflow/v1/webhook/:token` -
* keeps the public surface namespaced under eve and lets the framework
* decide delivery policy (auth, throttling, logging) for connection
* callbacks without leaking generic workflow primitives to the public
* internet.
*/
import type { RouteContext } from "#public/definitions/channel.js";
/**
* Logical name prefix of the framework-shipped connection callback
* channel. The trailing method segment (`get` or `post`) keeps each
* `(method, urlPath)` pair distinct in the channel registry.
*/
/**
* Inbound handler for the connection callback route. Exported for test
* coverage; the framework channel resolver wires it into Nitro via
* {@link getConnectionCallbackChannelDefinitions}.
*/
export declare function handleConnectionCallbackRequest(request: Request, ctx: RouteContext): Promise<Response>;
export declare function handleLegacyConnectionCallbackRequest(request: Request, ctx: RouteContext): Promise<Response>;