From 2c9f717c7bf71f2fec354b490c6cf7b5529dc781 Mon Sep 17 00:00:00 2001 From: dylan Date: Fri, 10 Jan 2025 11:49:59 -0700 Subject: [PATCH] fix: use an async http client - changes the oauth fetcher to use an async http client to play nice with tokio during tests --- src/tasks/oauth.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tasks/oauth.rs b/src/tasks/oauth.rs index 2886aa2..0716bfa 100644 --- a/src/tasks/oauth.rs +++ b/src/tasks/oauth.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use crate::config::BuilderConfig; use oauth2::{ basic::{BasicClient, BasicTokenType}, - reqwest::http_client, + reqwest::async_http_client, AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenUrl, }; use tokio::{sync::RwLock, task::JoinHandle}; @@ -89,7 +89,8 @@ impl Authenticator { Some(TokenUrl::new(config.oauth_token_url.clone())?), ); - let token_result = client.exchange_client_credentials().request(http_client)?; + let token_result = + client.exchange_client_credentials().request_async(async_http_client).await?; Ok(token_result) }