pub const PLATFORM_TENANT: &str = "platform";
pub const RESERVED_SLUGS: &[&str] = &[
"platform", "www", "api", "admin", "app", "mail", "auth", "login", "static",
];
pub const DELETE_AFTER_DAYS: i64 = 0;
pub const LOCKOUT_AFTER: u32 = 5;
pub const LOCKOUT_MAX_MINUTES: i64 = 15;
pub const VERIFICATION_HOURS: i64 = 48;
pub const RESET_MINUTES: i64 = 60;
pub const MAIL_COOLDOWN_MINUTES: i64 = 5;
pub const ACCESS_TOKEN_MINUTES: i64 = 15;
pub const SESSION_IDLE_DAYS: i64 = 14;
pub const SESSION_MAX_DAYS: i64 = 90;
pub const INVITATION_DAYS: i64 = 7;
pub const REUSE_WINDOW: usize = 32;
pub mod orders {
pub const AUTHORIZATION: i32 = -30;
pub const CLEANUP: i32 = -25;
pub const READ_MODELS: i32 = -20;
pub const REACTORS: i32 = -10;
}
pub const MINUTE: i64 = 60_000;
pub const HOUR: i64 = 60 * MINUTE;
pub const DAY: i64 = 24 * HOUR;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct RelyingParty {
pub rp_id: String,
pub rp_name: String,
pub origins: Vec<String>,
}
impl Default for RelyingParty {
fn default() -> RelyingParty {
RelyingParty {
rp_id: "localhost".into(),
rp_name: "kernable".into(),
origins: vec!["http://localhost:3000".into()],
}
}
}
static PASSKEYS: std::sync::RwLock<Option<RelyingParty>> = std::sync::RwLock::new(None);
pub fn use_passkeys(rp: RelyingParty) {
*PASSKEYS.write().unwrap() = Some(rp);
}
pub fn passkeys() -> RelyingParty {
PASSKEYS.read().unwrap().clone().unwrap_or_default()
}
pub const CHALLENGE_SECONDS: i64 = 300;
pub const AUTHORIZATION_STORE: &str = "sqlite:authorization.db";
pub const SNAPSHOT_SCHEMA: &str = "rs-1";