Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
macro_cache_client
What it is
Belongs to shared infrastructure (authentication): Redis-backed rate limiters for auth-adjacent flows, one module per limited action, each gated behind its own Cargo feature.
Start here
src/lib.rs:MacroCache::new— thin wrapper aroundredis::Client; modules are enabled per feature (auth_rate_limit,login_code_rate_limit,notification_rate_limit,mobile_welcome_email_rate_limit,verify_email_rate_limit).src/passwordless_rate_limit.rs,src/create_user_rate_limit.rs: theauth_rate_limitfeature's two limiters.src/auth.rs: shared auth-cache helpers (featureauth).
Scope
- Owns: rate-limit counters for auth-adjacent flows (login codes, account creation, passwordless, verification emails).
- Not here: general-purpose Redis operations — those are
macro_redis(which this crate does not depend on; it rolls its own Redis calls per limiter module).
Boundaries
- Depends on:
macro_redis,email_validator(optional, per rate-limit feature). - Used by:
authentication_service.
Recipes
- Add a new rate limit: new
src/<name>_rate_limit.rsmodule → feature flag inCargo.toml→pub modgated on it insrc/lib.rs→ add to theallfeature if it should ship by default.
Checks
cargo test -p macro_cache_client(SQLX_OFFLINEunset).
Related
- Rules:
.agents/rules/rust/security.md