@@ -658,55 +658,6 @@ mod tests {
658658
659659 // ── Container / Docker validators ───────────────────────────────────
660660
661- #[ test]
662- fn test_validate_container_image ( ) {
663- assert ! ( validate_container_image( "node:20-slim" , "mcp" ) . is_empty( ) ) ;
664- assert ! ( validate_container_image( "ghcr.io/org/tool:latest" , "mcp" ) . is_empty( ) ) ;
665- let empty_warnings = validate_container_image ( "" , "mcp" ) ;
666- assert ! ( !empty_warnings. is_empty( ) ) ;
667- assert ! ( empty_warnings[ 0 ] . contains( "empty" ) ) ;
668- let injection_warnings = validate_container_image ( "$(malicious)" , "mcp" ) ;
669- assert ! ( !injection_warnings. is_empty( ) ) ;
670- assert ! ( injection_warnings[ 0 ] . contains( "unexpected characters" ) ) ;
671- }
672-
673- #[ test]
674- fn test_validate_docker_args_privileged_flag ( ) {
675- let warnings = validate_docker_args ( & [ "--privileged" . to_string ( ) ] , "my-mcp" ) ;
676- assert ! ( !warnings. is_empty( ) ) ;
677- assert ! ( warnings[ 0 ] . contains( "elevated privileges" ) ) ;
678- }
679-
680- #[ test]
681- fn test_validate_docker_args_entrypoint_in_args_warns ( ) {
682- let warnings = validate_docker_args (
683- & [ "--entrypoint" . to_string ( ) , "/bin/sh" . to_string ( ) ] ,
684- "my-mcp" ,
685- ) ;
686- assert ! ( !warnings. is_empty( ) ) ;
687- assert ! ( warnings[ 0 ] . contains( "entrypoint" ) ) ;
688- }
689-
690- #[ test]
691- fn test_validate_docker_args_volume_flag_calls_mount_validation ( ) {
692- let warnings = validate_docker_args (
693- & [ "-v" . to_string ( ) , "/etc/passwd:/data:ro" . to_string ( ) ] ,
694- "my-mcp" ,
695- ) ;
696- assert ! ( warnings. len( ) >= 2 ) ; // bypass warning + sensitive path
697- assert ! ( warnings[ 0 ] . contains( "bypasses mounts" ) ) ;
698- assert ! ( warnings[ 1 ] . contains( "sensitive" ) ) ;
699- }
700-
701- #[ test]
702- fn test_validate_mcp_url ( ) {
703- assert ! ( validate_mcp_url( "https://mcp.example.com" , "mcp" ) . is_empty( ) ) ;
704- assert ! ( validate_mcp_url( "http://localhost:8080" , "mcp" ) . is_empty( ) ) ;
705- let warnings = validate_mcp_url ( "ftp://example.com" , "mcp" ) ;
706- assert ! ( !warnings. is_empty( ) ) ;
707- assert ! ( warnings[ 0 ] . contains( "http://" ) || warnings[ 0 ] . contains( "https://" ) ) ;
708- }
709-
710661 #[ test]
711662 fn test_warn_potential_secrets ( ) {
712663 let env = HashMap :: from ( [ ( "AZURE_DEVOPS_EXT_PAT" . to_string ( ) , "secret123" . to_string ( ) ) ] ) ;
0 commit comments