barrel_mcp_client_auth behaviour (barrel_mcp v2.0.2)
View SourceAuthorization behaviour for barrel_mcp_client.
The HTTP transport calls into this module to obtain the bearer token to attach to outgoing requests, and to refresh the token when the server returns 401.
A handle is an opaque term passed back into every callback. Static bearer tokens use barrel_mcp_client_auth_bearer; OAuth 2.1 with PKCE will use barrel_mcp_client_auth_oauth (Phase D).
Summary
Functions
Lookup the Authorization header for the current state.
Construct an auth handle from a user-facing config term.
Refresh after a 401, returning a new handle.
Types
Callbacks
Functions
Lookup the Authorization header for the current state.
-spec new(none | {bearer, binary()} | {oauth, map()} | {oauth_client_credentials, map()} | {oauth_enterprise, map()}) -> t() | {error, term()}.
Construct an auth handle from a user-facing config term.
Refresh after a 401, returning a new handle.