From abf5d804038183fed702c28960ce4d482dc86431 Mon Sep 17 00:00:00 2001 From: Kurt Wolf Date: Sun, 24 Dec 2023 19:10:17 -0500 Subject: [PATCH] use httpclient_oauth2 0.1.2 API --- libninja/src/rust/cargo_toml.rs | 2 +- libninja/src/rust/client.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libninja/src/rust/cargo_toml.rs b/libninja/src/rust/cargo_toml.rs index 4fcef98..d9a7c6d 100644 --- a/libninja/src/rust/cargo_toml.rs +++ b/libninja/src/rust/cargo_toml.rs @@ -77,7 +77,7 @@ pub fn update_cargo_toml(extras: &Extras, opts: &OutputConfig, context: &HashMap ensure_dependency(&mut m.dependencies, "base64", "0.21.0", &[]); } if extras.oauth2 { - ensure_dependency(&mut m.dependencies, "httpclient_oauth2", "0.1.0", &[]); + ensure_dependency(&mut m.dependencies, "httpclient_oauth2", "0.1.2", &[]); } m.example = vec![]; fs::write_file(&cargo, &toml::to_string(&m).unwrap())?; diff --git a/libninja/src/rust/client.rs b/libninja/src/rust/client.rs index 9f3596b..2593d0c 100644 --- a/libninja/src/rust/client.rs +++ b/libninja/src/rust/client.rs @@ -378,7 +378,7 @@ pub fn impl_Authentication(spec: &HirSpec, opt: &PackageConfig) -> TokenStream { let oauth2 = spec.oauth2_auth().map(|oauth| { quote! { pub fn oauth2(access: String, refresh: String) -> Self { - let mw = shared_oauth2_flow().middleware_from_pieces(access, refresh, httpclient_oauth2::TokenType::Bearer); + let mw = shared_oauth2_flow().bearer_middleware(access, refresh); Self::OAuth2 { middleware: Arc::new(mw) } } }