simdutf8_cli/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2025,2026 ndaal Gesellschaft für Sicherheit in der Informationstechnik mbH & Co KG, Cologne
3// SPDX-FileCopyrightText: Author: Pierre Gronau <Pierre.Gronau@ndaal.eu>
4
5//! `simdutf8-cli` — a small, security-hardened command-line front-end for the
6//! [`simdutf8`](https://crates.io/crates/simdutf8) crate.
7//!
8//! The crate is split into focused, independently testable modules:
9//!
10//! * [`validate`] — thin, allocation-free wrappers around `simdutf8` that turn a
11//! byte slice into a [`validate::Validity`] verdict.
12//! * [`path_security`] — hardened file opening that resolves symlinks, optionally
13//! confines inputs to a base directory, rejects non-regular files and bounds
14//! the number of bytes read (defence against path traversal, symlink and
15//! resource-exhaustion attacks).
16//! * [`report`] — rendering of verdicts as human-readable text or JSON.
17//! * [`cli`] — argument parsing and the [`cli::run`] entry point used by the
18//! binary and by the integration tests.
19//!
20//! No `unsafe` code is used anywhere in this crate.
21
22#![forbid(unsafe_code)]
23#![warn(missing_docs)]
24#![warn(rust_2018_idioms)]
25
26pub mod cli;
27pub mod path_security;
28pub mod report;
29pub mod validate;