Expand description
OAuth authorization_code support for LLM providers.
Specs are loaded from oxicode-catalog/data/catalog/product-meta.toml
([providers.<name>.oauth] tables). Empty/missing table = key-only.
The catalog file is embedded at compile time so the cached loader does not
depend on filesystem layout at runtime. A runtime load_meta helper is
also exposed for callers that want to source the file from a custom
location (tests, user overrides).
Structs§
- OAuth
Meta - Container for every provider’s OAuth spec parsed from
product-meta.toml. - OAuth
Tokens - Tokens returned from a successful OAuth token exchange.
- ProviderO
Auth Spec - One provider’s OAuth configuration parsed from
product-meta.toml. - Refreshed
Tokens - Tokens returned from a successful OAuth token-refresh grant.
Functions§
- build_
auth_ url - Build the authorization URL for the OAuth
authorization_codeflow. - exchange_
code - Exchange an authorization code for tokens at
spec.token_url. - load_
meta - Load and parse
pathas aproduct-meta.tomlcontaining OAuth sections. - load_
meta_ from_ str - Parse the OAuth sections from raw TOML.
- oauth_
meta - Return the cached process-wide
OAuthMeta, parsing the embeddedproduct-meta.tomlon first call. - open_
browser - Hand a URL to the OS so the user’s default browser opens it.
- pkce_
pair - Generate a random PKCE verifier and matching S256 code challenge (RFC 7636 §4.1, §4.2).
- refresh_
grant - Exchange a stored
refresh_tokenfor fresh access tokens atspec.token_url. - spec_
for - Look up the OAuth spec for
provider(e.g."openai","anthropic").