2019-12-12 23:49:32 +01:00
|
|
|
// Re-export as needed
|
2020-03-26 23:27:07 +01:00
|
|
|
|
|
|
|
pub mod acp;
|
|
|
|
pub mod entries;
|
|
|
|
pub mod schema;
|
2019-12-12 23:49:32 +01:00
|
|
|
pub mod system_config;
|
2020-03-26 23:27:07 +01:00
|
|
|
pub mod uuids;
|
2022-10-05 01:48:48 +02:00
|
|
|
pub mod values;
|
2020-03-26 23:27:07 +01:00
|
|
|
|
|
|
|
pub use crate::constants::acp::*;
|
|
|
|
pub use crate::constants::entries::*;
|
|
|
|
pub use crate::constants::schema::*;
|
|
|
|
pub use crate::constants::system_config::*;
|
|
|
|
pub use crate::constants::uuids::*;
|
2022-10-05 01:48:48 +02:00
|
|
|
pub use crate::constants::values::*;
|
2019-12-12 23:49:32 +01:00
|
|
|
|
2022-10-17 12:09:47 +02:00
|
|
|
use std::time::Duration;
|
|
|
|
|
2019-11-29 01:48:22 +01:00
|
|
|
// Increment this as we add new schema types and values!!!
|
2022-11-01 05:02:52 +01:00
|
|
|
pub const SYSTEM_INDEX_VERSION: i64 = 27;
|
2019-07-12 07:28:46 +02:00
|
|
|
// On test builds, define to 60 seconds
|
|
|
|
#[cfg(test)]
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const PURGE_FREQUENCY: u64 = 60;
|
2020-03-24 23:21:49 +01:00
|
|
|
// For production, 10 minutes.
|
2019-07-12 07:28:46 +02:00
|
|
|
#[cfg(not(test))]
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const PURGE_FREQUENCY: u64 = 600;
|
2020-03-24 23:21:49 +01:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
/// In test, we limit the changelog to 10 minutes.
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const CHANGELOG_MAX_AGE: u64 = 600;
|
2020-03-24 23:21:49 +01:00
|
|
|
#[cfg(not(test))]
|
|
|
|
/// A replica may be less than 1 day out of sync and catch up.
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const CHANGELOG_MAX_AGE: u64 = 86400;
|
2020-03-24 23:21:49 +01:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
/// In test, we limit the recyclebin to 5 minutes.
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const RECYCLEBIN_MAX_AGE: u64 = 300;
|
2020-03-24 23:21:49 +01:00
|
|
|
#[cfg(not(test))]
|
|
|
|
/// In production we allow 1 week
|
2020-05-11 13:12:32 +02:00
|
|
|
pub const RECYCLEBIN_MAX_AGE: u64 = 604_800;
|
2020-03-24 23:21:49 +01:00
|
|
|
|
2019-09-06 05:04:58 +02:00
|
|
|
// 5 minute auth session window.
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const AUTH_SESSION_TIMEOUT: u64 = 300;
|
2020-04-10 07:50:45 +02:00
|
|
|
// 5 minute mfa reg window
|
2020-05-03 08:44:01 +02:00
|
|
|
pub const MFAREG_SESSION_TIMEOUT: u64 = 300;
|
|
|
|
pub const PW_MIN_LENGTH: usize = 10;
|
2021-05-26 08:11:00 +02:00
|
|
|
|
|
|
|
// Default
|
|
|
|
pub const AUTH_SESSION_EXPIRY: u64 = 3600;
|
2022-10-17 12:09:47 +02:00
|
|
|
|
|
|
|
// The time that a token can be used before session
|
|
|
|
// status is enforced. This needs to be longer than
|
|
|
|
// replication delay/cycle.
|
|
|
|
pub const GRACE_WINDOW: Duration = Duration::from_secs(600);
|
|
|
|
|
|
|
|
/// How long access tokens should last. This is NOT the length
|
|
|
|
/// of the refresh token, which is bound to the issuing session.
|
|
|
|
pub const OAUTH2_ACCESS_TOKEN_EXPIRY: u32 = 4 * 3600;
|