mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 07:19:22 +00:00
Add minimal supported version in application configuration
This commit is contained in:
parent
6ab6278bd4
commit
050d241695
@ -3,7 +3,7 @@
|
|||||||
//! @author Pierre Hubert
|
//! @author Pierre Hubert
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::constants::{conservation_policy, password_policy};
|
use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy};
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct PasswordPolicy {
|
struct PasswordPolicy {
|
||||||
@ -29,6 +29,7 @@ struct DataConservationPolicy {
|
|||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct ServerConfig {
|
pub struct ServerConfig {
|
||||||
|
min_supported_mobile_version: &'static str,
|
||||||
password_policy: PasswordPolicy,
|
password_policy: PasswordPolicy,
|
||||||
data_conservation_policy: DataConservationPolicy,
|
data_conservation_policy: DataConservationPolicy,
|
||||||
}
|
}
|
||||||
@ -36,6 +37,7 @@ pub struct ServerConfig {
|
|||||||
impl ServerConfig {
|
impl ServerConfig {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
ServerConfig {
|
ServerConfig {
|
||||||
|
min_supported_mobile_version: MIN_SUPPORTED_MOBILE_VERSION,
|
||||||
password_policy: PasswordPolicy {
|
password_policy: PasswordPolicy {
|
||||||
allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD,
|
allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD,
|
||||||
allow_name_in_password: password_policy::ALLOW_NAME_IN_PASSWORD,
|
allow_name_in_password: password_policy::ALLOW_NAME_IN_PASSWORD,
|
||||||
|
@ -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);
|
pub const INITIAL_REFRESH_LOAD_INTERVAL: Duration = Duration::from_secs(5);
|
||||||
|
|
||||||
/// Interval between each cleanup operation (every hour)
|
/// 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";
|
Loading…
Reference in New Issue
Block a user