1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Move public base URL from oauth2 config to http config

This commit is contained in:
Quentin Gliech
2022-02-01 09:34:17 +01:00
parent f96c5b0cec
commit c0e5b66ea4
15 changed files with 166 additions and 74 deletions

View File

@@ -17,6 +17,7 @@ use std::path::PathBuf;
use async_trait::async_trait;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use url::Url;
use super::ConfigurationSection;
@@ -24,6 +25,10 @@ fn default_http_address() -> String {
"[::]:8080".into()
}
fn default_public_base() -> Url {
"http://[::]:8080".parse().unwrap()
}
fn http_address_example_1() -> &'static str {
"[::1]:8080"
}
@@ -54,6 +59,9 @@ pub struct HttpConfig {
/// the static files embedded in the server binary
#[serde(default)]
pub web_root: Option<PathBuf>,
/// Public URL base from where the authentication service is reachable
pub public_base: Url,
}
impl Default for HttpConfig {
@@ -61,6 +69,7 @@ impl Default for HttpConfig {
Self {
address: default_http_address(),
web_root: None,
public_base: default_public_base(),
}
}
}