Skip to main content

validate_version

Function validate_version 

Source
pub fn validate_version(version: &str) -> Result<(), CoreError>
Expand description

Validate a module version string BEFORE it becomes a filesystem path segment or URL component (ASVS V5, T-15-03): 1–64 characters from [A-Za-z0-9._+-], with no .. window anywhere (path-traversal refusal — this also catches a lone ..). Exit 2 invalid_input — a caller-supplied bad value is the usage class, so no new slug is warranted (the frozen taxonomy’s existing precedent).