1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Add a global HTTP client factory

This commit is contained in:
Quentin Gliech
2022-11-23 13:18:48 +01:00
parent d514a8922c
commit 4227fa7a83
14 changed files with 163 additions and 83 deletions

View File

@@ -31,14 +31,17 @@ mod layers;
mod service;
#[cfg(feature = "client")]
pub use self::client::{client, make_traced_connector, make_untraced_client, ClientInitError};
pub use self::client::{
make_traced_client, make_traced_connector, make_untraced_client, ClientInitError, TracedClient,
TracedConnector, UntracedClient, UntracedConnector,
};
pub use self::{
ext::{set_propagator, CorsLayerExt, ServiceExt as HttpServiceExt},
layers::{
body_to_bytes_response::{self, BodyToBytesResponse, BodyToBytesResponseLayer},
bytes_to_body_request::{self, BytesToBodyRequest, BytesToBodyRequestLayer},
catch_http_codes::{self, CatchHttpCodes, CatchHttpCodesLayer},
client::ClientLayer,
client::{ClientLayer, ClientService},
form_urlencoded_request::{self, FormUrlencodedRequest, FormUrlencodedRequestLayer},
json_request::{self, JsonRequest, JsonRequestLayer},
json_response::{self, JsonResponse, JsonResponseLayer},
@@ -48,6 +51,4 @@ pub use self::{
service::{BoxCloneSyncService, HttpService},
};
pub(crate) type BoxError = Box<dyn std::error::Error + Send + Sync>;
pub type EmptyBody = http_body::Empty<bytes::Bytes>;