1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-12-27 22:18:51 +00:00

Add minimal supported version in application configuration

This commit is contained in:
Pierre HUBERT 2021-02-20 09:07:30 +01:00
parent 6ab6278bd4
commit 050d241695
2 changed files with 7 additions and 2 deletions

View File

@ -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,

View File

@ -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);
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";