2024-06-29 09:45:39 +00:00
|
|
|
use std::time::Duration;
|
|
|
|
|
2024-06-29 12:43:56 +00:00
|
|
|
/// Name of the cookie that contains session information
|
|
|
|
pub const SESSION_COOKIE_NAME: &str = "X-session-cookie";
|
|
|
|
|
2024-06-29 09:45:39 +00:00
|
|
|
/// Energy refresh operations interval
|
|
|
|
pub const ENERGY_REFRESH_INTERVAL: Duration = Duration::from_secs(30);
|
|
|
|
|
|
|
|
/// Fallback value to use if production cannot be fetched
|
|
|
|
pub const FALLBACK_PRODUCTION_VALUE: i32 = 5000;
|
2024-06-29 12:43:56 +00:00
|
|
|
|
|
|
|
/// Maximum session duration after inactivity, in seconds
|
|
|
|
pub const MAX_INACTIVITY_DURATION: u64 = 3600;
|
|
|
|
|
|
|
|
/// Maximum session duration (1 day)
|
|
|
|
pub const MAX_SESSION_DURATION: u64 = 3600 * 24;
|
|
|
|
|
|
|
|
/// List of routes that do not require authentication
|
|
|
|
pub const ROUTES_WITHOUT_AUTH: [&str; 2] =
|
|
|
|
["/web_api/server/config", "/web_api/auth/password_auth"];
|