ProviderHttpRequest (oauth/provider_http.rs)

prime-agent · crates/pa-ai/src/oauth/provider_http.rs · rust · MIT
auth

Provides a generic HTTP transport interface and a reqwest‑based implementation for OAuth flows.

// Source: https://github.com/PrimeIntellect-ai/prime-agent | License: MIT | Copyright 2025-2026 Prime Intellect Ltd
// Provided via justclaw.it.com; keep this notice with the code.
//! The shared HTTP transport seam for the Anthropic, GitHub Copilot,
//! and xAI flows (the Codex flow keeps its own narrower `CodexHttp`).
//! Dyn-dispatch on purpose: the product plugs in a reqwest client,
//! tests script the responses.

use std::future::Future;
use std::pin::Pin;
use std::time::Duration;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ProviderHttpMethod {
    Get,
    Post,
}

/// One OAuth request; the body is sent verbatim (form-encoded and
/// JSON bodies are built by the caller).
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProviderHttpRequest {
    pub method: ProviderHttp

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key