280f09c60d
Browser consumers (kelvar) need a host-provided password prompt so the
master never appears on the command line. Exposes a single method:
WaferRepl::set_prompter(js_sys::Function) -> Result<(), JsError>
Given a JS function `(prompt: string) => string`, registers it as the
Forth word `READ-PASSWORD` with stack effect
( prompt-addr prompt-u -- pw-addr pw-u )
The returned bytes land in WAFER's PAD region. Enforces PAD_SIZE-1 as
a hard upper bound — a silent truncation would cause a derived password
to mismatch the one used during setup, which is exactly the failure
mode we are trying to avoid.
`js_sys::Function` is !Send/!Sync but `HostFn` requires both. In a
browser WASM build there is only ever one thread, so wrap it in
`send_wrapper::SendWrapper`, which panics if accessed off-thread — an
honest guard rather than a lie.
54 lines
1.2 KiB
TOML
54 lines
1.2 KiB
TOML
[workspace]
|
|
members = ["crates/*"]
|
|
resolver = "2"
|
|
|
|
[workspace.package]
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/ok2/wafer"
|
|
|
|
[workspace.lints.rust]
|
|
unsafe_code = "deny"
|
|
unused_must_use = "deny"
|
|
elided_lifetimes_in_paths = "warn"
|
|
trivial_numeric_casts = "warn"
|
|
unreachable_pub = "warn"
|
|
unused_qualifications = "warn"
|
|
|
|
[workspace.lints.clippy]
|
|
# Pedantic group (selective)
|
|
cloned_instead_of_copied = "warn"
|
|
explicit_iter_loop = "warn"
|
|
flat_map_option = "warn"
|
|
implicit_clone = "warn"
|
|
inconsistent_struct_constructor = "warn"
|
|
inefficient_to_string = "warn"
|
|
manual_let_else = "warn"
|
|
map_unwrap_or = "warn"
|
|
redundant_closure_for_method_calls = "warn"
|
|
semicolon_if_nothing_returned = "warn"
|
|
uninlined_format_args = "warn"
|
|
unnested_or_patterns = "warn"
|
|
unused_self = "warn"
|
|
# Correctness & suspicious
|
|
doc_markdown = "warn"
|
|
match_wildcard_for_single_variants = "warn"
|
|
needless_continue = "warn"
|
|
ref_as_ptr = "warn"
|
|
# Nursery (stable enough to use)
|
|
needless_collect = "warn"
|
|
or_fun_call = "warn"
|
|
|
|
[workspace.dependencies]
|
|
wasm-encoder = "0.246"
|
|
wasmparser = "0.246"
|
|
wasmtime = "43"
|
|
anyhow = "1"
|
|
thiserror = "2"
|
|
proptest = "1"
|
|
insta = "1"
|
|
sha1 = "0.11"
|
|
sha2 = "0.11"
|
|
send_wrapper = "0.6"
|