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

Function validate_descriptor_strings

crates/openshell-driver-vm/src/lifecycle.rs:737–754  ·  view source on GitHub ↗
(descriptor: &ExtensionDescriptor)

Source from the content-addressed store, hash-verified

735}
736
737fn validate_descriptor_strings(descriptor: &ExtensionDescriptor) -> LifecycleResult<()> {
738 for value in descriptor
739 .provides
740 .kernel_profiles
741 .iter()
742 .chain(descriptor.provides.guest_init_dropins.iter())
743 .chain(descriptor.provides.launch_features.iter())
744 .chain(descriptor.provides.host_resources.iter())
745 {
746 validate_extension_identifier(value).map_err(|err| {
747 LifecycleError::new(format!(
748 "lifecycle extension '{}' has invalid provided capability '{}': {err}",
749 descriptor.name, value
750 ))
751 })?;
752 }
753 Ok(())
754}
755
756fn validate_extension_identifier(value: &str) -> Result<(), &'static str> {
757 if value.is_empty() || value == "." || value == ".." {

Callers 1

validateMethod · 0.85

Calls 1

Tested by

no test coverage detected