Put demo code behind a feature flag #19

Open
opened 2026-06-22 02:11:37 +00:00 by maybe-yiyi · 0 comments
maybe-yiyi commented 2026-06-22 02:11:37 +00:00 (Migrated from codeberg.org)

Background

The backend adds demo/dev-only endpoints and HTML: demo_home, the auth-bypass login form, and demo_not_found, etc. These are useful for local development but should be gated so they can be turned off.

Tasks

  • Put demo_home, the bypass login HTML/JS, and demo_not_found behind a cargo feature (e.g. demo) or a runtime config flag, defaulting to off.
  • Wire server.rs so the demo routes and demo fallback are only mounted when the flag is enabled, and verify locally that they are absent when it is off.
  • Ideally, the bypass auth gets automatically used whenever the flag is added, and "Login with CMU SSO" does the bypass automatically.
  • Keep the bypass-auth middleware available for local/dev and CI tests (see TEST-HTTP), but gate the user-facing demo UI.

Files: auth/, server.rs, Cargo.toml

**Background** The backend adds demo/dev-only endpoints and HTML: `demo_home`, the auth-bypass login form, and `demo_not_found`, etc. These are useful for local development but should be gated so they can be turned off. **Tasks** - Put `demo_home`, the bypass login HTML/JS, and `demo_not_found` behind a cargo feature (e.g. `demo`) or a runtime config flag, defaulting to off. - Wire `server.rs` so the demo routes and demo fallback are only mounted when the flag is enabled, and verify locally that they are absent when it is off. - Ideally, the bypass auth gets automatically used whenever the flag is added, and "Login with CMU SSO" does the bypass automatically. - Keep the bypass-auth middleware available for local/dev and CI tests (see `TEST-HTTP`), but gate the user-facing demo UI. Files: `auth/`, `server.rs`, `Cargo.toml`
Sign in to join this conversation.
No description provided.