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