Shared Routers ============== Routers used by both UI and operations. .. contents:: Table of Contents :local: :depth: 2 Auth Routers ------------ **Paths**: ``/auth``, ``/github``, ``/api/tokens`` **Purpose**: Authentication and token management **Key endpoints**: * ``GET /github/login`` - Initiate OAuth * ``GET /github/callback`` - OAuth callback * ``GET /auth/me`` - Current user info * ``GET /api/tokens/scopes`` - Get available scopes * ``POST /api/tokens/`` - Create API token (one-time display) * ``GET /api/tokens/`` - List tokens * ``GET /api/tokens/{id}`` - Get token details * ``PUT /api/tokens/{id}`` - Update token * ``GET /api/tokens/{id}/usage`` - Get usage statistics * ``POST /api/tokens/{id}/regenerate`` - Regenerate token * ``DELETE /api/tokens/{id}`` - Revoke token * ``POST /api/tokens/bulk-revoke`` - Bulk revoke * ``GET /api/tokens/export`` - Export token list See :doc:`../../AuthToken` for complete endpoint documentation. Instruments Router ------------------ **Path**: ``/instruments`` **Purpose**: Query instrument configurations **Key endpoints**: * ``GET /`` - List instruments * ``GET /{id}/modules`` - Get modules * ``GET /modules/{id}/configurations`` - Get configurations **Used by**: * UI: Display instrument info * Operations: Validate configurations Site Router ----------- **Path**: ``/api/site`` **Purpose**: Site configuration and status **Key endpoints**: * ``GET /info`` - Site configuration * ``GET /health`` - Health check * ``GET /buffer-stats`` - Buffer statistics **Example**: .. code-block:: bash curl http://localhost:8000/health .. code-block:: json { "status": "healthy", "database": "connected", "redis": "connected", "transaction_buffer": {"size": 5} } Demo Router ----------- **Path**: ``/api/demo`` **Purpose**: Testing and examples **Key endpoints**: * ``POST /create-observation`` - Demo buffered operation * ``GET /operation-examples`` - List examples * ``GET /site-info`` - Site information Next Steps ---------- * :doc:`../authentication/index` - Authentication details * :doc:`../../architecture/site-configuration` - Site configuration