Skip to main content

Authentication

Identity Model​

The identity service is the source of truth for authentication, distributor provisioning, customer identity, roles, and downstream JWT claims.

Current JWT Claims​

Downstream authorization depends on explicit claims including:

  • role
  • account_type
  • distributor_id
  • vip_enabled
  • the user subject identifier

Authorization Controls​

SurfaceControl
Distributor-only actionsJWT role=distributor plus account_type=distributor
Moderator reviewJWT role=moderator
Service-to-service actionsX-S2S-Token validated against S2S_WEBHOOK_SECRET
WebSocketsBearer-token validation before accepting session access

Production Secret Requirements​

Production mode rejects development fallbacks and requires explicit configuration for:

  • APP_SECRET_KEY
  • JWT_SECRET_KEY
  • S2S_WEBHOOK_SECRET
  • CHAT_ENCRYPTION_KEY

Handover Notes​

  • Historical seed-domain modules related to influencer/referral flows remain in the identity repository, but they are not part of the active WHOT runtime surface.
  • Administrative access must remain role-based. Email addresses are not a valid substitute for privilege checks.