1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Add a setPassword GraphQL mutation for setting a user's password (#2820)

* Feed `PasswordManager` through to the GraphQL `State`

* Add `setPassword` GraphQL mutation to update a user's password
This commit is contained in:
reivilibre
2024-06-05 18:04:17 +01:00
committed by GitHub
parent fa0dec737b
commit d76b54b13f
8 changed files with 370 additions and 2 deletions

View File

@@ -198,6 +198,7 @@ impl TestState {
site_config: site_config.clone(),
rng: Arc::clone(&rng),
clock: Arc::clone(&clock),
password_manager: password_manager.clone(),
};
let state: crate::graphql::BoxState = Box::new(graphql_state);
@@ -314,6 +315,7 @@ struct TestGraphQLState {
policy_factory: Arc<PolicyFactory>,
clock: Arc<MockClock>,
rng: Arc<Mutex<ChaChaRng>>,
password_manager: PasswordManager,
}
#[async_trait]
@@ -332,6 +334,10 @@ impl graphql::State for TestGraphQLState {
self.policy_factory.instantiate().await
}
fn password_manager(&self) -> PasswordManager {
self.password_manager.clone()
}
fn homeserver_connection(&self) -> &dyn HomeserverConnection<Error = anyhow::Error> {
&self.homeserver_connection
}