struct
PassiveScan::Matcher
- PassiveScan::Matcher
- Struct
- Value
- Object
Defined in:
models/passive_scan.crConstant Summary
-
ALLOWED_CONDITIONS =
{"and", "or"} -
ALLOWED_TYPES =
{"word", "regex"}
Constructors
Instance Method Summary
- #compiled_regex : Regex | Nil
- #compiled_regex=(compiled_regex : Regex | Nil)
- #compiled_regexes : Array(Regex) | Nil
- #compiled_regexes=(compiled_regexes : Array(Regex) | Nil)
- #condition : String
- #condition=(condition : String)
-
#dead? : Bool
True when this matcher can never produce a hit: its regexes did not compile, so
match_content?returns false for every input. - #patterns : Array(YAML::Any)
- #patterns=(patterns : Array(YAML::Any))
-
#regex_compile_failed? : Bool
True when this matcher's regexes failed to compile.
-
#regex_error : String | Nil
Why this matcher's regexes failed to compile, or nil when they compiled.
-
#string_patterns : Array(String)
Pre-stringified patterns.
-
#string_patterns=(string_patterns : Array(String))
Pre-stringified patterns.
- #type : String
- #type=(type : String)
- #valid? : Bool
- #validation_errors : Array(String)
Constructor Detail
Instance Method Detail
True when this matcher can never produce a hit: its regexes did
not compile, so match_content? returns false for every input.
True when this matcher's regexes failed to compile. detect.cr checks it to short-circuit instead of retrying the (already-broken) compilation on every line.
Why this matcher's regexes failed to compile, or nil when they
compiled. Held as the message rather than a bare flag so the
loader can name the pattern in the warning it prints — the
previous shape wrote the reason straight to Crystal's global
Log, whose default backend is STDOUT, so it landed in the
middle of -f json / -f sarif output and broke every
downstream parser.
Pre-stringified patterns. detect.cr's hot path used to call
pattern.to_s per (file × line × matcher); the conversion is the
same every call so we do it once at load time.
Pre-stringified patterns. detect.cr's hot path used to call
pattern.to_s per (file × line × matcher); the conversion is the
same every call so we do it once at load time.