Hmbown/CodeWhale · error · io::Error
secure external credential reads are unsupported on this…
Error message
secure external credential reads are unsupported on this platform
What it means
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.
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
Defensive patterns
Strategy: fallback
Validate before calling
// compile-time guard
#[cfg(not(any(unix, windows)))]
compile_error!("secure external credentials require unix or windows"); Try / catch
match read_to_string(path) {
Ok(s) => use_credential(&s),
Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {
eprintln!("secure credential reads unsupported on this target");
}
Err(e) => return Err(e.into()),
} Prevention
- Target only unix or windows platforms for credential features
- Check the platform before enabling credential-dependent functionality
When it happens
Trigger: 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).
Common situations: Cross-compiling or running Codewhale on an unsupported OS target; embedding the TUI crate in a wasm or embedded host.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- atomic built-in snapshot publication is unsupported on this…
- browser opening is unsupported on this platform
- Confined Fleet artifact I/O is unavailable on this platform
- managed external credential access is unsupported for
- PTY resize is unavailable on this platform
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/b008d858cd2cf460.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/external_credentials.rs:636
continue;
}
let metadata = std::fs::symlink_metadata(¤t)?;
if metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT != 0 {
return Err(io::Error::new(
io::ErrorKind::PermissionDenied,
format!(
"external credential path contains reparse point {}",
codewhale_config::quote_os_path(¤t)
),
));
}
}
Ok(())
}
#[cfg(not(any(unix, windows)))]
fn open_secure_regular_file(_path: &Path, _require_owner_only: bool) -> io::Result<File> {
Err(io::Error::new(
io::ErrorKind::Unsupported,
"secure external credential reads are unsupported on this platform",
))
}
#[cfg(test)]
pub(crate) fn reset_side_effect_trap() {
SIDE_EFFECT_TRAP.with(|trap| trap.set([0; 5]));
}
#[cfg(test)]
#[must_use]
pub(crate) fn side_effect_trap_counts() -> (usize, usize) {
SIDE_EFFECT_TRAP.with(|trap| {
let counts = trap.get();
(counts[0], counts[1])
})
}View on GitHub (pinned to 73e0f67d83)