Skip to content

vox-oauth-pkce API Reference (generated)

Crate: vox-oauth-pkce · Version: 0.6.0 · Target: Library (lib.rs)

RFC 8252 loopback-server OAuth PKCE flow, used for in-app free-tier key provisioning.

Minimal RFC 8252 (OAuth for Native Apps) loopback-server PKCE flow, provider-agnostic core + an OpenRouter-specific driver.

DependencyKind
vox-http-clientNormal
ModuleDescription
openrouter—
pkce—
Dependency Topology, diagram 15 nodes, 4 edges: vox-oauth-pkce → vox-http-client; vox-cli → vox-oauth-pkce; vox-cli-research → vox-oauth-pkce; vox-gui → vox-oauth-pkcevox-oauth-pkcevox-http-clientvox-clivox-cli-researchvox-gui
Diagram source
graph {
direction: right
node vox_oauth_pkce: "vox-oauth-pkce"
node vox_http_client: "vox-http-client"
vox_oauth_pkce -> vox_http_client
node vox_cli: "vox-cli"
vox_cli -> vox_oauth_pkce
node vox_cli_research: "vox-cli-research"
vox_cli_research -> vox_oauth_pkce
node vox_gui: "vox-gui"
vox_gui -> vox_oauth_pkce
}
Consumer CrateRole
vox-cliDirect workspace dependent
vox-cli-researchDirect workspace dependent
vox-guiDirect workspace dependent
KindSymbolSignatureSourceDescription
enumopenrouter::OAuthErrorpub enum OAuthErrorcrates/vox-oauth-pkce/src/openrouter.rs#L21-L36—
fnopenrouter::run_openrouter_flowpub async fn run_openrouter_flow() -> Result<String, OAuthError>crates/vox-oauth-pkce/src/openrouter.rs#L139-L205Run the full loopback PKCE flow against OpenRouter and return the provisioned API key on success. Opens the system browser; blocks (async) until the callback arrives or CALLBACK_TIMEOUT elapses.
structpkce::PkcePairpub struct PkcePaircrates/vox-oauth-pkce/src/pkce.rs#L16-L19A generated PKCE pair: the secret verifier (kept in-process) and its S256 challenge (sent to the authorization server). Debug is hand-written to redact verifier so the code verifier — a bearer-adjacent OAuth secret — can never leak into logs/traces via tracing::debug!(?pair). challenge is not secret (it’s sent to the authorization server in the clear) and stays visible.
fnpkce::generatepub fn generate() -> PkcePaircrates/vox-oauth-pkce/src/pkce.rs#L36-L49Generate a new PKCE pair using a 64-byte random verifier (RFC 7636 §4.1 requires 43-128 chars of unreserved base64url chars; 64 raw bytes -> 86 base64url chars, comfortably in range) and its S256 challenge.
fnpkce::generate_statepub fn generate_state() -> Stringcrates/vox-oauth-pkce/src/pkce.rs#L52-L56Generate a random state value (32 bytes, base64url) for CSRF binding.