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 access tokens TTL configurable
This commit is contained in:
@@ -48,6 +48,7 @@ use url::Url;
|
||||
use crate::{
|
||||
app_state::ErrorWrapper,
|
||||
passwords::{Hasher, PasswordManager},
|
||||
site_config::SiteConfig,
|
||||
upstream_oauth2::cache::MetadataCache,
|
||||
MatrixHomeserver,
|
||||
};
|
||||
@@ -76,6 +77,7 @@ pub(crate) struct TestState {
|
||||
pub graphql_schema: mas_graphql::Schema,
|
||||
pub http_client_factory: HttpClientFactory,
|
||||
pub password_manager: PasswordManager,
|
||||
pub site_config: SiteConfig,
|
||||
pub clock: Arc<MockClock>,
|
||||
pub rng: Arc<Mutex<ChaChaRng>>,
|
||||
}
|
||||
@@ -133,6 +135,8 @@ impl TestState {
|
||||
|
||||
let http_client_factory = HttpClientFactory::new(10);
|
||||
|
||||
let site_config = SiteConfig::default();
|
||||
|
||||
let clock = Arc::new(MockClock::default());
|
||||
let rng = Arc::new(Mutex::new(ChaChaRng::seed_from_u64(42)));
|
||||
|
||||
@@ -160,6 +164,7 @@ impl TestState {
|
||||
graphql_schema,
|
||||
http_client_factory,
|
||||
password_manager,
|
||||
site_config,
|
||||
clock,
|
||||
rng,
|
||||
})
|
||||
@@ -346,6 +351,12 @@ impl FromRef<TestState> for MetadataCache {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromRef<TestState> for SiteConfig {
|
||||
fn from_ref(input: &TestState) -> Self {
|
||||
input.site_config.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl FromRequestParts<TestState> for BoxClock {
|
||||
type Rejection = Infallible;
|
||||
|
Reference in New Issue
Block a user