Skip to main content

Crate forbidden_strings

Crate forbidden_strings 

Source
Expand description

lib support for the forbidden-strings scanner.

Structs§

CompiledRules
Re-exports the forbidden-regex rule compiler’s public surface. One compiled rule set paired with the per-rule names that drive finding identity.

Enums§

LoadError
Re-exports the forbidden-regex rule compiler’s public surface. Re-exports the redacted load-error type as this module’s public failure. A rule-load failure with everything the rule text redacted out.

Constants§

BUILTIN_NAMES
The builtin baseline’s rule-name sidecar, embedded at build time.
BUILTIN_PRECOMPILED
The builtin baseline precompiled into a serialized RegexSet, embedded at build time.
BUILTIN_RULES
What: pub const BUILTIN_RULES: &str = include_str!("../data/builtin-rules.txt"); declares an exported constant whose value is the entire betterleaks-ported baseline ruleset, pasted into the binary at COMPILE time by the include_str! macro. &str is a read-only view of UTF-8 bytes baked into the binary; the sibling String would heap-allocate the same bytes again at runtime for no benefit. Why: Ships the baseline inside the published binary so the opt-in --builtin-rules flag works with no rules file on disk, and lets consumers (the forbidden-regex bench crate) import the same rules instead of include_str!-ing a fragile relative path into this repository. Gotcha: Editing data/builtin-rules.txt changes nothing until the crate is rebuilt, and the file itself is GENERATED by src/mise.port-betterleaks.ts; never edit it by hand.

Functions§

compile_from_text
Re-exports the forbidden-regex rule compiler’s public surface. Compiles a rule source (autodetected format) into a combined RegexSet.
compile_rules
Re-exports the forbidden-regex rule compiler’s public surface. Compiles a rule source into a combined RegexSet plus its per-rule names.
load_precompiled
Re-exports the forbidden-regex rule compiler’s public surface. Loads a precompiled serialized RegexSet from bytes.
run_cli_from_env
Run the scanner from real process arguments and environment values.