┌─────────────────────────────────────────────────────────────────┐
│ Client Applications │
│ (Admin UI, Mobile Apps, Scanner Devices, Automated Systems) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Switchyard Backend │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Auth Provider │ │ Middleware │ │ Route Handlers │ │
│ │ (Supabase) │ │ (authenticate, │ │ │ │
│ │ │ │ authorize) │ │ │ │
│ └────────┬────────┘ └────────┬────────┘ └─────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────────┐│
│ │ Auth Identity Store ││
│ │ (Switchyard auth_identity table) ││
│ └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Supabase │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Auth Service │ │ RBAC Tables │ │ RLS Policies │ │
│ │ (auth.users) │ │ (roles, perms) │ │ │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘