Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.4 KB
Raw Blame
/// (max_attempts, expiry_seconds)
pub struct RateLimitConfig {
    pub passwordless: (u64, i64),
    pub passwordless_daily: (u64, i64),
    pub login_code: (u64, i64),
    pub login_code_daily: (u64, i64),
    #[allow(dead_code)]
    pub verify_email_minute: (u64, i64),
    #[allow(dead_code)]
    pub verify_email_daily: (u64, i64),
    #[allow(dead_code)]
    pub merge_email_minute: (u64, i64),
    #[allow(dead_code)]
    pub merge_email_daily: (u64, i64),
    pub create_user_hourly: (u64, i64),
    pub mobile_welcome_email: (u64, i64),
    // pub sso: (u64, i64),
}

pub static RATE_LIMIT_CONFIG: RateLimitConfig = RateLimitConfig {
    passwordless: (1, 30),           // 1 attempt per 30 seconds
    passwordless_daily: (20, 86400), // 20 attempts per day
    login_code: (5, 60),
    login_code_daily: (100, 86400),
    // sso: (5, 300),
    verify_email_minute: (5, 60),
    verify_email_daily: (5, 86400),

    merge_email_minute: (5, 60),
    merge_email_daily: (5, 86400),

    create_user_hourly: (50, 3600),
    // 100 attempts per hour per IP. Mobile carriers put thousands of phones
    // behind one CGNAT address, so a low cap here rejects real visitors on the
    // marketing site's mobile signup form rather than abusers. Abuse stays
    // bounded because an address can only ever be sent this email once (the
    // handler claims it in `mobile_welcome_email` before sending).
    mobile_welcome_email: (100, 3600),
};