1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 22:29:45 +00:00

Create password policy

This commit is contained in:
2021-02-17 16:32:49 +01:00
parent 2edffa36d8
commit 9f6b00a62b
2 changed files with 46 additions and 2 deletions

View File

@@ -59,6 +59,25 @@ pub mod database_tables_names {
pub const NOTIFICATIONS_TABLE: &str = "comunic_notifications";
}
/// Password policy
pub mod password_policy {
/// Allow email in password ?
pub const ALLOW_EMAIL_IN_PASSWORD: bool = false;
/// Allow user name in password ?
pub const ALLOW_NAME_IN_PASSWORD: bool = false;
/// Minimal length of password
pub const MIN_PASSWORD_LENGTH: u64 = 8;
/// Password composition policy
pub const MIN_NUMBER_LOWERCASE_LETTER: u64 = 1;
pub const MIN_NUMBER_UPPERCASE_LETTER: u64 = 1;
pub const MIN_NUMBER_DIGITS: u64 = 1;
pub const MIN_NUMBER_SPECIAL_CHARACTERS: u64 = 1;
pub const MIN_CATEGORIES_PRESENCE: u64 = 2;
}
/// Minimal conversation policy
pub mod conservation_policy {
use std::time::Duration;