Skip to main content

is_valid_crate_name

Function is_valid_crate_name 

Source
pub fn is_valid_crate_name(s: &str) -> bool
Expand description

Is s a crate name safe to use as an S3 object-key path component?

Permissive enough for real crate names and cc source basenames ([A-Za-z0-9_.-]) but rejects anything that could escape a path or key prefix: separators, .. traversal, NUL/control chars, the empty string, or an absurd length. Like is_valid_cache_key, this guards values that cross the untrusted-remote boundary; reject, do not sanitize.