adk_openapi_auth_manager behaviour (erlang_adk v0.7.0)

View Source

Opaque credential resolver used by compiled OpenAPI tools.

Request contains only scheme metadata, requested OAuth scopes, and the operation id. It never contains tool arguments or agent context. Returned credentials live only inside the bounded execution worker and are applied immediately to the outgoing request.

Summary

Types

credential/0

-type credential() :: {api_key, binary()} | {bearer, binary()}.

handle/0

-type handle() :: pid() | atom() | reference().

request/0

-type request() ::
          #{operation_id := binary(),
            scheme_name := binary(),
            scheme_type := api_key | bearer | oauth2,
            location => header | query,
            parameter_name => binary(),
            scopes := [binary()]}.

Callbacks

resolve/2

-callback resolve(Handle :: handle(), Request :: request()) -> {ok, credential()} | {error, term()}.