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