You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Make the SiteConfig available in the GraphQL context
This commit is contained in:
@@ -193,6 +193,7 @@ impl TestState {
|
||||
pool: pool.clone(),
|
||||
policy_factory: Arc::clone(&policy_factory),
|
||||
homeserver_connection: Arc::clone(&homeserver_connection),
|
||||
site_config: site_config.clone(),
|
||||
rng: Arc::clone(&rng),
|
||||
clock: Arc::clone(&clock),
|
||||
};
|
||||
@@ -307,6 +308,7 @@ impl TestState {
|
||||
struct TestGraphQLState {
|
||||
pool: PgPool,
|
||||
homeserver_connection: Arc<MockHomeserverConnection>,
|
||||
site_config: SiteConfig,
|
||||
policy_factory: Arc<PolicyFactory>,
|
||||
clock: Arc<MockClock>,
|
||||
rng: Arc<Mutex<ChaChaRng>>,
|
||||
@@ -336,6 +338,10 @@ impl mas_graphql::State for TestGraphQLState {
|
||||
Box::new(self.clock.clone())
|
||||
}
|
||||
|
||||
fn site_config(&self) -> &SiteConfig {
|
||||
&self.site_config
|
||||
}
|
||||
|
||||
fn rng(&self) -> BoxRng {
|
||||
let mut parent_rng = self.rng.lock().expect("Failed to lock RNG");
|
||||
let rng = ChaChaRng::from_rng(&mut *parent_rng).expect("Failed to seed RNG");
|
||||
|
Reference in New Issue
Block a user