{"record":{"id":"b008d858cd2cf460","repo":"Hmbown/CodeWhale","slug":"secure-external-credential-reads-are-unsupported-o","errorCode":null,"errorMessage":"secure external credential reads are unsupported on this platform","messagePattern":"secure external credential reads are unsupported on this platform","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/external_credentials.rs","lineNumber":636,"sourceCode":"            continue;\n        }\n        let metadata = std::fs::symlink_metadata(&current)?;\n        if metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT != 0 {\n            return Err(io::Error::new(\n                io::ErrorKind::PermissionDenied,\n                format!(\n                    \"external credential path contains reparse point {}\",\n                    codewhale_config::quote_os_path(&current)\n                ),\n            ));\n        }\n    }\n    Ok(())\n}\n\n#[cfg(not(any(unix, windows)))]\nfn open_secure_regular_file(_path: &Path, _require_owner_only: bool) -> io::Result<File> {\n    Err(io::Error::new(\n        io::ErrorKind::Unsupported,\n        \"secure external credential reads are unsupported on this platform\",\n    ))\n}\n\n#[cfg(test)]\npub(crate) fn reset_side_effect_trap() {\n    SIDE_EFFECT_TRAP.with(|trap| trap.set([0; 5]));\n}\n\n#[cfg(test)]\n#[must_use]\npub(crate) fn side_effect_trap_counts() -> (usize, usize) {\n    SIDE_EFFECT_TRAP.with(|trap| {\n        let counts = trap.get();\n        (counts[0], counts[1])\n    })\n}","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/external_credentials.rs#L618-L654","documentation":"This error means secure external credential reading is only implemented for Unix and Windows; on any other target the cfg-gated stub always fails. The library throws it unconditionally from open_secure_regular_file when compiled for a platform that is neither unix nor windows.","triggerScenarios":"Calling read_to_string or read_codewhale_owned_to_string for an external credential file on a platform outside unix/windows (e.g. wasm, other exotic targets).","commonSituations":"Cross-compiling or running Codewhale on an unsupported OS target; embedding the TUI crate in a wasm or embedded host.","solutions":["Run Codewhale on a supported platform (Linux/macOS or Windows)","Add a platform implementation of open_secure_regular_file for the target if you control the build","Use a non-secure credential-read fallback path if one exists for the target"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// compile-time guard\n#[cfg(not(any(unix, windows)))]\ncompile_error!(\"secure external credentials require unix or windows\");","typeGuard":null,"tryCatchPattern":"match read_to_string(path) {\n    Ok(s) => use_credential(&s),\n    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {\n        eprintln!(\"secure credential reads unsupported on this target\");\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Target only unix or windows platforms for credential features","Check the platform before enabling credential-dependent functionality"],"tags":["platform","unsupported","credentials"],"backgroundTag":"unsupported-platform","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}