Make debug and release host builds opt in through demo-auth-bypass so ambient debug-assertion flags cannot contradict the product manifest.
- commit
- 549b90487a583fadf5b744bb29685a39b82ee06f
- parent
- 6223d386717ede704409ebd55d32408d002d0f05
- author
- Dami <dami.etoile@gmail.com>
| M | crates/ | 2 | ++ |
| M | crates/ | 6 | +++--- |
| M | docs/ | 13 | +++++++++---- |
@@ -11,6 +11,8 @@ default-run = "sigil"
1111 1212 [features]1313 default = []14+# Explicitly insecure configured-host authorization mode for bounded tests.15+# Never infer this capability from the optimization or debug-assertion profile.1416 demo-auth-bypass = []1517 in-process-gstreamer = ["dep:gstreamer", "dep:gstreamer-app", "dep:gstreamer-video"]1618 @@ -1062,7 +1062,7 @@ async fn serve_command(args: ServeArgs) -> Result<()> {
10621062 }10631063 10641064 const fn development_auth_bypass_available() -> bool {1065- cfg!(any(debug_assertions, feature = "demo-auth-bypass"))1065+ cfg!(feature = "demo-auth-bypass")10661066 }10671067 10681068 fn validate_development_auth_bypass(@@ -1071,7 +1071,7 @@ fn validate_development_auth_bypass(
10711071 ) -> Result<()> {10721072 ensure!(10731073 !requested || development_auth_bypass_available(),1074- "--dev-allow-unauthorized requires a debug build or the explicit demo-auth-bypass feature; ordinary release builds always require enrollment"1074+ "--dev-allow-unauthorized requires the explicit demo-auth-bypass feature; ordinary builds always require enrollment"10751075 );10761076 if requested {10771077 ensure!(@@ -1271,7 +1271,7 @@ mod tests {
12711271 12721272 12731273 fn ordinary_release_excludes_configured_host_auth_bypass() {1274- if cfg!(not(debug_assertions)) && cfg!(not(feature = "demo-auth-bypass")) {1274+ if cfg!(not(feature = "demo-auth-bypass")) {12751275 assert!(!development_auth_bypass_available());12761276 assert!(validate_development_auth_bypass(true, Some(60)).is_err());12771277 }@@ -68,10 +68,15 @@ with `cargo tauri build --features demo-direct-node`; do not ship that feature
6868 in a production package.6969 7070 `--dev-connect` alone does not authorize its ephemeral Portal identity. For an71-explicit configured-host hardware test without a security key, run a debug72-Sigil build with73-`serve --config <host.toml> --dev-allow-unauthorized --max-runtime-seconds 1800`,74-or build the optimized test binary with `--features demo-auth-bypass`. This host flag71+explicit configured-host hardware test without a security key, run Sigil with72+the explicit development feature:73+74+```bash75+cargo run -p sigil-host --features demo-auth-bypass -- serve \76+ --config <host.toml> --dev-allow-unauthorized --max-runtime-seconds 180077+```78+79+An optimized test binary requires the same feature. This host flag7580 admits any peer that knows the node ID, grants all session capabilities, prints7681 a startup warning, and deliberately avoids reading or mutating enrollment7782 state. It requires `--max-runtime-seconds` between 1 and 3600 so the exposure