You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Rename the 'hack' configuration section to 'experimental'
This commit is contained in:
@ -140,8 +140,8 @@ impl Options {
|
||||
);
|
||||
|
||||
let site_config = SiteConfig {
|
||||
access_token_ttl: config.hack.access_token_ttl,
|
||||
compat_token_ttl: config.hack.compat_token_ttl,
|
||||
access_token_ttl: config.experimental.access_token_ttl,
|
||||
compat_token_ttl: config.experimental.compat_token_ttl,
|
||||
};
|
||||
|
||||
// Explicitly the config to properly zeroize secret keys
|
||||
|
@ -25,24 +25,27 @@ fn default_token_ttl() -> Duration {
|
||||
Duration::minutes(5)
|
||||
}
|
||||
|
||||
/// Configuration sections for miscellaneous options
|
||||
/// Configuration sections for experimental options
|
||||
///
|
||||
/// Do not change these options unless you know what you are doing.
|
||||
#[serde_as]
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)]
|
||||
pub struct HackConfig {
|
||||
/// Time-to-live of access tokens in seconds
|
||||
pub struct ExperimentalConfig {
|
||||
/// Time-to-live of access tokens in seconds. Defaults to 5 minutes.
|
||||
#[schemars(with = "u64", range(min = 60, max = 86400))]
|
||||
#[serde(default = "default_token_ttl")]
|
||||
#[serde_as(as = "serde_with::DurationSeconds<i64>")]
|
||||
pub access_token_ttl: Duration,
|
||||
|
||||
/// Time-to-live of compatibility access tokens in seconds
|
||||
/// Time-to-live of compatibility access tokens in seconds. Defaults to 5
|
||||
/// minutes.
|
||||
#[schemars(with = "u64", range(min = 60, max = 86400))]
|
||||
#[serde(default = "default_token_ttl")]
|
||||
#[serde_as(as = "serde_with::DurationSeconds<i64>")]
|
||||
pub compat_token_ttl: Duration,
|
||||
}
|
||||
|
||||
impl Default for HackConfig {
|
||||
impl Default for ExperimentalConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
access_token_ttl: default_token_ttl(),
|
||||
@ -52,9 +55,9 @@ impl Default for HackConfig {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl ConfigurationSection for HackConfig {
|
||||
impl ConfigurationSection for ExperimentalConfig {
|
||||
fn path() -> &'static str {
|
||||
"hack"
|
||||
"experimental"
|
||||
}
|
||||
|
||||
async fn generate<R>(_rng: R) -> anyhow::Result<Self>
|
@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
|
||||
mod clients;
|
||||
mod database;
|
||||
mod email;
|
||||
mod hack;
|
||||
mod experimental;
|
||||
mod http;
|
||||
mod matrix;
|
||||
mod passwords;
|
||||
@ -34,7 +34,7 @@ pub use self::{
|
||||
clients::{ClientAuthMethodConfig, ClientConfig, ClientsConfig},
|
||||
database::{ConnectConfig as DatabaseConnectConfig, DatabaseConfig},
|
||||
email::{EmailConfig, EmailSmtpMode, EmailTransportConfig},
|
||||
hack::HackConfig,
|
||||
experimental::ExperimentalConfig,
|
||||
http::{
|
||||
BindConfig as HttpBindConfig, HttpConfig, ListenerConfig as HttpListenerConfig,
|
||||
Resource as HttpResource, TlsConfig as HttpTlsConfig, UnixOrTcp,
|
||||
@ -103,9 +103,9 @@ pub struct RootConfig {
|
||||
#[serde(default)]
|
||||
pub upstream_oauth2: UpstreamOAuth2Config,
|
||||
|
||||
/// Miscellaneous configuration options
|
||||
/// Experimental configuration options
|
||||
#[serde(default)]
|
||||
pub hack: HackConfig,
|
||||
pub experimental: ExperimentalConfig,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -130,7 +130,7 @@ impl ConfigurationSection for RootConfig {
|
||||
matrix: MatrixConfig::generate(&mut rng).await?,
|
||||
policy: PolicyConfig::generate(&mut rng).await?,
|
||||
upstream_oauth2: UpstreamOAuth2Config::generate(&mut rng).await?,
|
||||
hack: HackConfig::generate(&mut rng).await?,
|
||||
experimental: ExperimentalConfig::generate(&mut rng).await?,
|
||||
})
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ impl ConfigurationSection for RootConfig {
|
||||
matrix: MatrixConfig::test(),
|
||||
policy: PolicyConfig::test(),
|
||||
upstream_oauth2: UpstreamOAuth2Config::test(),
|
||||
hack: HackConfig::test(),
|
||||
experimental: ExperimentalConfig::test(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,7 +179,7 @@ pub struct AppConfig {
|
||||
pub policy: PolicyConfig,
|
||||
|
||||
#[serde(default)]
|
||||
pub hack: HackConfig,
|
||||
pub experimental: ExperimentalConfig,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -201,7 +201,7 @@ impl ConfigurationSection for AppConfig {
|
||||
secrets: SecretsConfig::generate(&mut rng).await?,
|
||||
matrix: MatrixConfig::generate(&mut rng).await?,
|
||||
policy: PolicyConfig::generate(&mut rng).await?,
|
||||
hack: HackConfig::generate(&mut rng).await?,
|
||||
experimental: ExperimentalConfig::generate(&mut rng).await?,
|
||||
})
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ impl ConfigurationSection for AppConfig {
|
||||
secrets: SecretsConfig::test(),
|
||||
matrix: MatrixConfig::test(),
|
||||
policy: PolicyConfig::test(),
|
||||
hack: HackConfig::test(),
|
||||
experimental: ExperimentalConfig::test(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,15 +45,15 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"hack": {
|
||||
"description": "Miscellaneous configuration options",
|
||||
"experimental": {
|
||||
"description": "Experimental configuration options",
|
||||
"default": {
|
||||
"access_token_ttl": 300,
|
||||
"compat_token_ttl": 300
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/HackConfig"
|
||||
"$ref": "#/definitions/ExperimentalConfig"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -724,12 +724,12 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"HackConfig": {
|
||||
"description": "Configuration sections for miscellaneous options",
|
||||
"ExperimentalConfig": {
|
||||
"description": "Configuration sections for experimental options\n\nDo not change these options unless you know what you are doing.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token_ttl": {
|
||||
"description": "Time-to-live of access tokens in seconds",
|
||||
"description": "Time-to-live of access tokens in seconds. Defaults to 5 minutes.",
|
||||
"default": 300,
|
||||
"type": "integer",
|
||||
"format": "uint64",
|
||||
@ -737,7 +737,7 @@
|
||||
"minimum": 60.0
|
||||
},
|
||||
"compat_token_ttl": {
|
||||
"description": "Time-to-live of compatibility access tokens in seconds",
|
||||
"description": "Time-to-live of compatibility access tokens in seconds. Defaults to 5 minutes.",
|
||||
"default": 300,
|
||||
"type": "integer",
|
||||
"format": "uint64",
|
||||
|
Reference in New Issue
Block a user