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

@@ -15,6 +15,7 @@
use std::sync::Arc;
use axum::extract::FromRef;
use mas_axum_utils::http_client_factory::HttpClientFactory;
use mas_email::Mailer;
use mas_keystore::{Encrypter, Keystore};
use mas_policy::PolicyFactory;
@@ -35,6 +36,7 @@ pub struct AppState {
pub homeserver: MatrixHomeserver,
pub policy_factory: Arc<PolicyFactory>,
pub graphql_schema: mas_graphql::Schema,
pub http_client_factory: HttpClientFactory,
}
impl FromRef<AppState> for PgPool {
@@ -90,3 +92,8 @@ impl FromRef<AppState> for Arc<PolicyFactory> {
input.policy_factory.clone()
}
}
impl FromRef<AppState> for HttpClientFactory {
fn from_ref(input: &AppState) -> Self {
input.http_client_factory.clone()
}
}