Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ rand = "0.10"
zeroize = "1"

# CSPRNG for placeholder token generation (security-grade randomness).
# Important decision: enable `wasm_js` so the public `wasm32-unknown-unknown`
# build gate stays green; bashkit targets JS-backed wasm for that triple.
# Used by the credential placeholder generator; getrandom is the lowest-level
# CSPRNG primitive and is already transitively in the dep tree via reqwest/rustls.
getrandom = "0.3"
getrandom = { version = "0.3", features = ["wasm_js"] }

# CLI
# Intentionally NOT enabling clap's `env` feature: it makes `Arg::env(...)`
Expand Down
12 changes: 12 additions & 0 deletions crates/bashkit-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ fn apply_real_mounts(
ro_mounts: &[String],
rw_mounts: &[String],
) -> bashkit::BashBuilder {
// Important decision: explicit CLI mount flags are the user's allowlist.
// The library keeps sensitive host paths closed by default for embedders;
// the CLI turns each requested host path into an audit-visible allow entry.
let allowed_mount_paths = ro_mounts
.iter()
.chain(rw_mounts)
.map(|spec| spec.split_once(':').map_or(spec.as_str(), |(host, _)| host))
.collect::<Vec<_>>();
if !allowed_mount_paths.is_empty() {
builder = builder.allowed_mount_paths(allowed_mount_paths);
}

for spec in ro_mounts {
if let Some((host, vfs)) = spec.split_once(':') {
builder = builder.mount_real_readonly_at(host, vfs);
Expand Down
18 changes: 13 additions & 5 deletions crates/bashkit-coreutils-port/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@
//! Action support, current implementation:
//!
//! - `error` — fully implemented (port aborts when matched).
//! - `inline`, `replace_with` — accepted in the schema, but require
//! the future `syn`-based import rewriter; the tool errors at
//! runtime if a module's substitution declares them. Manifest-side
//! declarations stay forward-compatible: when the rewriter lands,
//! the same manifest works without further changes.
//! - `replace_with` — fully implemented. The matched prefix in every
//! `use` path is rewritten to `target`. When the rewritten path's
//! final segment differs from the original, an `as <orig>` rename is
//! inserted so call sites compile unchanged. Use groups are
//! flattened into individual `use` items as a side effect.
//! - `inline` — fully implemented. The file at `inline_source` is
//! vendored next to the module's output dir (under
//! `<out_base>/<leaf>.rs` where `<leaf>` is the prefix's final
//! segment), and matching `use` paths are rewritten to
//! `super::<leaf>::…` so the vendored module compiles. The
//! inlined file goes through the same enforce + rewrite pipeline
//! so transitive uucore references either substitute or surface.

use serde::Deserialize;

Expand Down Expand Up @@ -87,6 +94,7 @@ pub enum Action {
}

impl Action {
#[allow(dead_code)] // Kept for diagnostic strings that don't currently consume it.
pub fn as_str(self) -> &'static str {
match self {
Action::Inline => "inline",
Expand Down
Loading
Loading