Security & Authentication Architecture
Overview
The security layer provides authentication, authorization, and request validation. It uses Firebase Auth for user identity and implements multiple authentication patterns for different contexts.
Architecture
Request
↓
┌─────────────────────────────────────────────────────────────────┐
│ AUTHENTICATION LAYER │
│ │
│ Bearer Token │
│ ↓ │
│ Firebase.verifyIdToken() │
│ ↓ │
│ User Instance (load from Firestore) │
│ ↓ │
│ Check Plan / Limits / Flags │
└─────────────────────────────────────────────────────────────────┘
↓
Request Context (available to all handlers)
↓
Handler Execution