← Back to architecture

Auth / Security

cross-cutting concern

A cross-cutting security layer that runs through every module. It handles user authentication, action authorization, and data access control at the level of individual records.

Architecture

Entry points
Authentication — who is the user?
Identifying the user. Every entry point converges on a single user_id.
argon2id JWT HS256 NIST 800-63B zxcvbn + HIBP SSO/OIDC MFA TOTP
Authorization — what is allowed?
Owner Admin Member
Endpoints check permissions via require()ROLE_PERMISSIONS, not roles directly
Data-level ACL — what is accessible?
The data source is the sole authority on who sees what.
Double filter: Source ACL + Platform ACL — access is granted only when both pass.
Identity Mapping Container ACL Email auto-match Fail-safe

Tokens and sessions

request Access expired Refresh new pair
Access Token short · 15m
Type JWT, stateless
TTL 15 minutes
Storage In JS memory
Transport Authorization: Bearer
Header alg, typ, kid
Claims sub, role, exp, iat, jti, iss, aud
rotation
Refresh Token long · 30d
Type Stateful (DB)
TTL 30d sliding / 90d ceiling
Storage cookie
Flags httpOnly, Secure, SameSite=Strict
Family family_id (UUIDv7)
⟳ Rotation & Reuse Detection
Every refresh issues a new pair and invalidates the old token. Reusing a revoked token voids the entire chain (token family), but not all of the user's sessions.

Protection

request TLS Headers CORS CSRF Brute force Crypto core Audit log ✓ handling
Brute-force defense line — in detail:
by IP from 3rd failure 10 failures
threshold by IP
Rate limit by IP
20 attempts / 15 min. Redis sliding window.
from 3rd failure
Account-level delay
First 2 attempts with no delay, then 1s → 2s → 4s → 8s (cap 30s). Server-side.
after 10 failures
Alert Owner/Admin
Notify Owner/Admin — without locking out.
API

Workzone Design

Detailed design decisions for the module.


Wireframes Wireframes

Screens — a description and wireframe of each.


Features Features

Multi-screen flows — description, technical requirements, transitions.