Add authentication layer
This commit is contained in:
@ -1,7 +1,20 @@
|
||||
use std::time::Duration;
|
||||
|
||||
/// Name of the cookie that contains session information
|
||||
pub const SESSION_COOKIE_NAME: &str = "X-session-cookie";
|
||||
|
||||
/// 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;
|
||||
|
||||
/// 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"];
|
||||
|
Reference in New Issue
Block a user