Callback-agnostic explicit MCP OAuth authorization operations.
begin_authorization/3 discovers and freezes the resource/server/client
binding, creates one pending flow, and returns a one-time URL. Completion
consumes state exactly once, takes the shared grant mutation lease, crosses
the durable code-dispatch fence, exchanges the code once, and atomically
installs the new grant. No operation opens a browser or runs during ordinary
MCP execution.
Summary
Functions
Cancels one pending authorization under a supplied terminal deadline.
Functions
@spec begin_authorization( PtcRunner.Kernel.MCPOAuth.Context.t(), PtcRunner.Kernel.MCPOAuth.Authority.t(), keyword() ) :: {:ok, PtcRunner.Kernel.MCPOAuth.PendingAuthorization.t()} | {:error, atom()}
@spec cancel_authorization( PtcRunner.Kernel.MCPOAuth.Context.t(), PtcRunner.Kernel.MCPOAuth.PendingAuthorization.t(), keyword() ) :: :ok | {:error, atom()}
Cancels one pending authorization under a supplied terminal deadline.
The :cleanup_deadline option is required and belongs to the lifecycle owner
that installed the provider cleanup budget. Cancellation is terminal cleanup,
so it is never charged whatever remained of the interaction it cleans up, and
a caller must not treat an uncommitted cancellation as success.
@spec complete_authorization( PtcRunner.Kernel.MCPOAuth.Context.t(), PtcRunner.Kernel.MCPOAuth.PendingAuthorization.t(), [{binary(), binary()}], keyword() ) :: {:ok, map()} | {:error, atom()}