Function validate_command
Source pub fn validate_command(command: &str, allowed_commands: &[&str]) -> Result<()>
Expand description
Validates a command name against an allowlist.
This helps prevent command injection attacks.
§Arguments
command - The command to validate
allowed_commands - List of permitted command names or paths
§Returns
Ok if command is in allowlist, error otherwise