adk_authorization_flow (erlang_adk v0.7.0)

View Source

Supervised, bounded OAuth/OIDC authorization-code flow manager.

Provider profiles are immutable operator configuration. Public calls select only a configured provider and an allowed scope subset; adapter modules, client credentials, redirect URIs, resources, nonce and PKCE material never come from the browser. Callback state is claimed atomically before a short-lived supervised worker exchanges the code and stores the validated credential under the original opaque flow reference.

Summary

Types

server/0

-type server() :: gen_server:server_ref().

Functions

begin_flow(Server, Request)

-spec begin_flow(server(), map()) -> {ok, map()} | {error, atom()}.

Begin a flow. The returned map is directly compatible with adk_suspension:request_credential/2. Its correlation_id is the OAuth state consumed by complete/3 or cancel/2.

cancel(Server, State)

-spec cancel(server(), binary()) -> ok | {error, atom()}.

child_spec(Opts)

-spec child_spec(map()) -> supervisor:child_spec().

code_change(OldVersion, State, Extra)

complete(Server, State, Code)

-spec complete(server(), binary(), binary()) -> {ok, map()} | {error, atom()}.

complete(Server, State, Code, Timeout)

-spec complete(server(), binary(), binary(), timeout()) -> {ok, map()} | {error, atom()}.

format_status(Status)

handle_call(Request, From, State0)

handle_cast(Request, State)

handle_info(Info, State)

init(Opts)

start_link()

-spec start_link() -> gen_server:start_ret().

start_link(Opts)

-spec start_link(map()) -> gen_server:start_ret().

terminate(Reason, State)