lean_ctx/core/shell_allowlist/
mod.rs1mod case_construct;
9mod compound;
10mod config;
11mod enforcement;
12mod heredoc;
13mod mode;
14mod powershell;
15mod ps_statements;
16mod substitution;
17mod tokenizer;
18
19use crate::core::error::ShellError;
20
21use case_construct::find_shell_word;
22use compound::expand_to_leaf_segments;
23use config::{allowlist_block_message, effective_allowlist};
24use enforcement::SHELL_BUILTINS;
25#[cfg(test)]
26use enforcement::{
27 check_all_segments, check_pipe_to_bare_interpreter, check_unconditional_blocked_only,
28 enforce_shell_allowlist, is_bare_interpreter_stdin, is_project_root_binary,
29 normalize_line_continuations,
30};
31use tokenizer::{
32 extract_all_commands, extract_base_from_segment, quote_aware_token_end, skip_env_assignments,
33 split_on_operators,
34};
35
36pub(crate) use case_construct::{contains_double_semicolon, rewrite_case_constructs};
37pub use config::*;
38pub use enforcement::*;
39pub(crate) use heredoc::heredoc_delims;
40pub(crate) use heredoc::read_heredoc_delim;
41pub use heredoc::strip_all_heredoc_bodies;
42pub(crate) use heredoc::{strip_comments, strip_quoted_heredoc_bodies};
43pub use mode::ShellSecurity;
44pub(crate) use substitution::check_substitution_in_args;
45#[cfg(test)]
46pub(crate) use substitution::has_expanding_substitution_in_args;
47#[cfg(test)]
48pub(crate) use tests::allow;
49pub use tokenizer::*;
50
51#[cfg(test)]
52mod tests;
53#[cfg(test)]
54mod tests_conditionals;
55#[cfg(test)]
56mod tests_heredoc_quotes;
57#[cfg(test)]
58mod tests_multiword;
59#[cfg(test)]
60mod tests_pipe_target;
61#[cfg(test)]
62mod tests_ps1930;
63#[cfg(test)]
64mod tests_tokenizer;
65#[cfg(test)]
66mod tests_warn_only;