diff --git a/src/api_data/server_config.rs b/src/api_data/server_config.rs index b66e8f6..fbc1165 100644 --- a/src/api_data/server_config.rs +++ b/src/api_data/server_config.rs @@ -3,7 +3,7 @@ //! @author Pierre Hubert use serde::Serialize; -use crate::constants::{conservation_policy, password_policy}; +use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy}; #[derive(Serialize)] struct PasswordPolicy { @@ -29,6 +29,7 @@ struct DataConservationPolicy { #[derive(Serialize)] pub struct ServerConfig { + min_supported_mobile_version: &'static str, password_policy: PasswordPolicy, data_conservation_policy: DataConservationPolicy, } @@ -36,6 +37,7 @@ pub struct ServerConfig { impl ServerConfig { pub fn new() -> Self { ServerConfig { + min_supported_mobile_version: MIN_SUPPORTED_MOBILE_VERSION, password_policy: PasswordPolicy { allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD, allow_name_in_password: password_policy::ALLOW_NAME_IN_PASSWORD, diff --git a/src/constants.rs b/src/constants.rs index 60d0dcb..a42314c 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -159,4 +159,7 @@ pub const USER_ACCESS_TOKEN_ACTIVITY_REFRESH: Duration = Duration::from_secs(60 pub const INITIAL_REFRESH_LOAD_INTERVAL: Duration = Duration::from_secs(5); /// Interval between each cleanup operation (every hour) -pub const CLEAN_UP_INTERVAL: Duration = Duration::from_secs(60 * 60); \ No newline at end of file +pub const CLEAN_UP_INTERVAL: Duration = Duration::from_secs(60 * 60); + +/// Minimal mobile version supported +pub const MIN_SUPPORTED_MOBILE_VERSION: &str = "1.1.1"; \ No newline at end of file