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

Function validate_extension_name

crates/openshell-driver-vm/src/lifecycle.rs:720–735  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

718}
719
720fn validate_extension_name(name: &str) -> LifecycleResult<()> {
721 if name.is_empty() || name == "." || name == ".." {
722 return Err(LifecycleError::new(
723 "lifecycle extension name is empty or reserved",
724 ));
725 }
726 if !name
727 .chars()
728 .all(|ch| ch.is_ascii_alphanumeric() || ch == '-' || ch == '_' || ch == '.')
729 {
730 return Err(LifecycleError::new(format!(
731 "lifecycle extension name '{name}' must contain only ASCII letters, numbers, '.', '-', or '_'"
732 )));
733 }
734 Ok(())
735}
736
737fn validate_descriptor_strings(descriptor: &ExtensionDescriptor) -> LifecycleResult<()> {
738 for value in descriptor

Callers 2

validateMethod · 0.85
extension_state_dirFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected