feat(worker): V1-2.3 sandboxed verify child and sheet-verify job mode
This commit is contained in:
1 parent
345dde59e6
commit
31fbb0317f
24 files changed
+2145
-87
No files matched your search
+20
-13
@@ -1,14 +1,14 @@
|
||||
//! `faunosteo-worker` entry: a plain `main`, no async runtime, no thread, so the `decode`
|
||||
//! child installs its sandbox in a single-threaded process (review Part IV.1).
|
||||
//!
|
||||
//! Subcommands: `decode` (the sandboxed child, R0), `run` (the keyed job loop, R1),
|
||||
//! `run --check` (prints the resolved configuration without secrets), `version`.
|
||||
//! Subcommands: `decode` (the sandboxed child, R0), `verify` (the sandboxed sheet verdict
|
||||
//! child, V1-2.3), `run` (the keyed job loop, R1), `run --jobs sheet-verify` (the verification
|
||||
//! loop), `run --check` (prints the resolved configuration without secrets), `version`.
|
||||
|
||||
#[cfg(feature = "test-hooks")]
|
||||
use std::io::Write;
|
||||
|
||||
use faunosteo_worker::decode;
|
||||
use faunosteo_worker::exit_codes;
|
||||
use faunosteo_worker::{decode, exit_codes, verify};
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
@@ -24,6 +24,17 @@ fn main() {
|
||||
&mut stderr.lock(),
|
||||
)
|
||||
}
|
||||
Some("verify") => {
|
||||
let stdin = std::io::stdin();
|
||||
let stdout = std::io::stdout();
|
||||
let stderr = std::io::stderr();
|
||||
verify::main(
|
||||
&args[2..],
|
||||
&mut stdin.lock(),
|
||||
&mut stdout.lock(),
|
||||
&mut stderr.lock(),
|
||||
)
|
||||
}
|
||||
Some("run") => faunosteo_worker::run::main(&args[2..]),
|
||||
Some("version") => version(),
|
||||
#[cfg(feature = "test-hooks")]
|
||||
@@ -36,7 +47,9 @@ fn main() {
|
||||
exit_codes::OK
|
||||
}
|
||||
_ => {
|
||||
eprintln!("usage: faunosteo-worker <decode | run --check | version>");
|
||||
eprintln!(
|
||||
"usage: faunosteo-worker <decode | verify | run [--jobs sheet-verify] [--check] | version>"
|
||||
);
|
||||
exit_codes::USAGE
|
||||
}
|
||||
};
|
||||
@@ -48,17 +61,11 @@ fn version() -> i32 {
|
||||
println!(
|
||||
"faunosteo-worker {} (core {}, libwebp {major}.{minor}.{revision})",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
faunosteo_core_version()
|
||||
faunosteo_core::CORE_VERSION
|
||||
);
|
||||
exit_codes::OK
|
||||
}
|
||||
|
||||
fn faunosteo_core_version() -> &'static str {
|
||||
// The worker links no core module before R1 (nothing to share yet); the version printed
|
||||
// is the workspace version the two crates share.
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
||||
#[cfg(feature = "test-hooks")]
|
||||
fn fixture(args: &[String]) -> i32 {
|
||||
let Some(bytes) = args
|
||||
@@ -66,7 +73,7 @@ fn fixture(args: &[String]) -> i32 {
|
||||
.and_then(|name| faunosteo_worker::fixtures::by_name(name))
|
||||
else {
|
||||
eprintln!(
|
||||
"usage: faunosteo-worker fixture <png|jpeg|webp|big-jpeg|big-png|tiny|huge-header|gif|truncated>"
|
||||
"usage: faunosteo-worker fixture <png|jpeg|webp|big-jpeg|big-png|tiny|huge-header|iccp-bomb|gif|truncated|verify-clean|verify-caps>"
|
||||
);
|
||||
return exit_codes::USAGE;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user