pub struct OAuthConfig {
pub authorize_url: String,
pub token_url: String,
pub device_url: Option<String>,
pub client_id: String,
pub scope: Option<String>,
pub beta_headers: Vec<(String, String)>,
pub system_preamble: Option<String>,
pub redirect: RedirectSpec,
pub authorize_params: Vec<(String, String)>,
pub account_header: Option<String>,
}Expand description
The OAuth auth-row as data (auth §7.1): endpoints, client_id, scope, and
the auth-mode-dependent beta_headers (e.g. anthropic-beta: oauth-…). The
provider NAME is deliberately absent — it lives once, as the row key /
store_key. The pure OAuth builders take &OAuthConfig, so no vendor policy
is compiled into the core. Like the [[provider]] row (config §2.3),
deny_unknown_fields makes a typo’d or MISPLACED key a MalformedFile rather
than a silent drop — a TOP-LEVEL row key (e.g. unsupported_body_keys) typed
under [provider.oauth] would otherwise vanish and the strip never fire (bl-9649).
Fields§
§token_url: String§device_url: Option<String>§client_id: String§scope: Option<String>§beta_headers: Vec<(String, String)>Auth-mode-dependent STATIC headers (auth §4), e.g. anthropic-beta: oauth-….
system_preamble: Option<String>The system the request body must LEAD with under this auth mode (auth §4.1):
a Claude-Code-scoped Anthropic OAuth token rejects a request whose system does
not begin with You are Claude Code, Anthropic's official CLI for Claude. It is
a BODY fact, so — unlike beta_headers — it cannot ride header-only apply;
resolution prepends it to req.system before encode (lead_with_preamble).
None ⇒ no preamble (the api-key analogue), leaving the system untouched.
redirect: RedirectSpecThe loopback redirect as data (auth §10.1); default reproduces today’s
http://127.0.0.1:{ephemeral}/callback, so existing rows are unchanged.
Extra authorize-URL params (auth §10.2), e.g. OpenAI’s
id_token_add_organizations=true. Default empty ⇒ URL byte-identical.
account_header: Option<String>Header NAME for the credential’s account_id (auth §10.4), e.g.
ChatGPT-Account-ID. None ⇒ the header is not emitted.
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Source§fn clone(&self) -> OAuthConfig
fn clone(&self) -> OAuthConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more