MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / source_matches

Function source_matches

crates/openshell-server/src/grpc/validation.rs:723–730  ·  view source on GitHub ↗

Check if a log line's source matches the filter list. Empty source is treated as "gateway" for backward compatibility.

(log_source: &str, filters: &[String])

Source from the content-addressed store, hash-verified

721/// Check if a log line's source matches the filter list.
722/// Empty source is treated as "gateway" for backward compatibility.
723pub(super) fn source_matches(log_source: &str, filters: &[String]) -> bool {
724 let effective = if log_source.is_empty() {
725 "gateway"
726 } else {
727 log_source
728 };
729 filters.iter().any(|f| f == effective)
730}
731
732/// Check if a log line's level meets the minimum level threshold.
733/// Empty `min_level` means no filtering (all levels pass).

Callers 2

handle_get_sandbox_logsFunction · 0.85
handle_watch_sandboxFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected