pub struct OAuthHttpClient { /* private fields */ }Implementations§
Source§impl OAuthHttpClient
impl OAuthHttpClient
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Wraps a caller-supplied reqwest::Client.
Injected clients are treated as explicitly permissive (no
request-boundary IP guard) because the caller owns the client’s SSRF
policy; this keeps custom clients usable for tests and intentionally
internal deployments. Use OAuthHttpClient::from_config to obtain a
guarded client.
Sourcepub fn reqwest_client(&self) -> &Client
pub fn reqwest_client(&self) -> &Client
Returns the underlying reqwest::Client.
Useful for callers that must issue requests outside the OAuth form-post helpers (for example OIDC discovery, JWKS, or userinfo fetches) while sharing the same SSRF guard, timeout, and connection pool.
pub fn default_client() -> Result<Self, OAuthError>
pub fn from_config(config: OAuthHttpClientConfig) -> Result<Self, OAuthError>
pub async fn get_bytes(&self, url: &str) -> Result<Vec<u8>, OAuthError>
pub async fn get_bytes_with_headers( &self, url: &str, headers: &[(&str, &str)], ) -> Result<Vec<u8>, OAuthError>
pub async fn post_form( &self, token_endpoint: &str, request: OAuthFormRequest, ) -> Result<Value, OAuthError>
Trait Implementations§
Source§impl Clone for OAuthHttpClient
impl Clone for OAuthHttpClient
Source§fn clone(&self) -> OAuthHttpClient
fn clone(&self) -> OAuthHttpClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OAuthHttpClient
impl !UnwindSafe for OAuthHttpClient
impl Freeze for OAuthHttpClient
impl Send for OAuthHttpClient
impl Sync for OAuthHttpClient
impl Unpin for OAuthHttpClient
impl UnsafeUnpin for OAuthHttpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more